Skip to content

Commit 56bc69d

Browse files
author
Eugene Manuilov
committed
Replaced flattr image on widget and added donate link to plugin meta data
1 parent 909ec6e commit 56bc69d

File tree

7 files changed

+53
-16
lines changed

7 files changed

+53
-16
lines changed

classes/Visualizer/Module/Admin.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,13 @@ public function getPluginMetaLinks( $plugin_meta, $plugin_file ) {
343343
if ( $plugin_file == plugin_basename( VISUALIZER_BASEFILE ) ) {
344344
// knowledge base link
345345
$plugin_meta[] = sprintf(
346-
'<a href="https://github.com/madpixelslabs/visualizer/wiki">%s</a>',
347-
esc_html__( 'Knowledge Base' )
346+
'<a href="https://github.com/madpixelslabs/visualizer/wiki" target="_blank">%s</a>',
347+
esc_html__( 'Knowledge Base', Visualizer_Plugin::NAME )
348+
);
349+
// flattr link
350+
$plugin_meta[] = sprintf(
351+
'<a href="http://flattr.com/thing/2574985/WordPress-Visualizer" target="_blank">%s</a>',
352+
esc_html__( 'Donate', Visualizer_Plugin::NAME )
348353
);
349354
}
350355

classes/Visualizer/Module/Chart.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,8 @@ private function _handleDataPage() {
323323
),
324324
) );
325325

326+
$this->_addAction( 'admin_head', 'render_flattr_script' );
327+
326328
wp_iframe( array( $render, 'render') );
327329
}
328330

@@ -382,9 +384,35 @@ private function _handleSettingsPage() {
382384
$render->button = esc_attr__( 'Insert Chart', Visualizer_Plugin::NAME );
383385
}
384386

387+
$this->_addAction( 'admin_head', 'render_flattr_script' );
388+
385389
wp_iframe( array( $render, 'render') );
386390
}
387391

392+
/**
393+
* Renders flattr script in the iframe <head>
394+
*
395+
* @since 1.4.2
396+
* @action admin_head
397+
*
398+
* @access public
399+
*/
400+
public function render_flattr_script() {
401+
echo <<<EOL
402+
<script type="text/javascript">
403+
/* <![CDATA[ */
404+
(function() {
405+
var s = document.createElement('script'), t = document.getElementsByTagName('script')[0];
406+
s.type = 'text/javascript';
407+
s.async = true;
408+
s.src = 'http://api.flattr.com/js/0.6/load.js?mode=auto';
409+
t.parentNode.insertBefore(s, t);
410+
})();
411+
/* ]]> */
412+
</script>
413+
EOL;
414+
}
415+
388416
/**
389417
* Parses uploaded CSV file and saves new data for the chart.
390418
*

classes/Visualizer/Render/Page.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@ protected function _renderSidebar() {
7777
esc_html_e( 'Rate it on WordPress.org', Visualizer_Plugin::NAME );
7878
echo '</a>';
7979
echo '<div id="flattr">';
80-
echo '<a href="http://goo.gl/hN9FYf" target="_blank">';
81-
echo '<img src="//api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" border="0">';
82-
echo '</a>';
80+
echo '<a class="FlattrButton" style="display:none;" rev="flattr;button:compact;" href="http://wordpress.org/plugins/visualizer/"></a>';
8381
echo '</div>';
8482
echo '</div>';
8583
echo '</div>';

index.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
Version: 1.4.1.1
77
Author: Madpixels
88
Author URI: http://madpixels.net
9+
Donate link: http://flattr.com/thing/2574985/WordPress-Visualizer
910
License: GPL v2.0 or later
1011
License URI: http://www.opensource.org/licenses/gpl-license.php
1112
*/

languages/visualizer-en_US.mo

56 Bytes
Binary file not shown.

languages/visualizer-en_US.po

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ msgid ""
22
msgstr ""
33
"Project-Id-Version: Visualizer\n"
44
"Report-Msgid-Bugs-To: \n"
5-
"POT-Creation-Date: 2013-12-14 23:05+0300\n"
6-
"PO-Revision-Date: 2013-12-14 23:05+0300\n"
5+
"POT-Creation-Date: 2014-02-06 11:31+0300\n"
6+
"PO-Revision-Date: 2014-02-06 11:31+0300\n"
77
"Last-Translator: Eugene Manuilov <[email protected]>\n"
88
"Language-Team: Eugene Manuilov <[email protected]>\n"
99
"Language: en_US\n"
@@ -1270,7 +1270,7 @@ msgid "The stroke width of rising candles."
12701270
msgstr "The stroke width of rising candles."
12711271

12721272
#: classes/Visualizer/Render/Page/Settings.php:56
1273-
#: classes/Visualizer/Render/Page/Data.php:99
1273+
#: classes/Visualizer/Render/Page/Data.php:102
12741274
msgid "Back"
12751275
msgstr "Back"
12761276

@@ -1305,11 +1305,11 @@ msgstr "or read how you can add Google spreadsheet in following %sarticle%s."
13051305
msgid "From Computer"
13061306
msgstr "From Computer"
13071307

1308-
#: classes/Visualizer/Render/Page/Data.php:83
1308+
#: classes/Visualizer/Render/Page/Data.php:85
13091309
msgid "From Web"
13101310
msgstr "From Web"
13111311

1312-
#: classes/Visualizer/Render/Page/Data.php:102
1312+
#: classes/Visualizer/Render/Page/Data.php:105
13131313
#: classes/Visualizer/Render/Page/Types.php:84
13141314
msgid "Next"
13151315
msgstr "Next"
@@ -1374,6 +1374,10 @@ msgstr "Library"
13741374
msgid "Knowledge Base"
13751375
msgstr "Knowledge Base"
13761376

1377+
#: classes/Visualizer/Module/Admin.php:352
1378+
msgid "Donate"
1379+
msgstr "Donate"
1380+
13771381
#: classes/Visualizer/Module/Chart.php:318
13781382
msgid "Please, enter the URL of CSV file:"
13791383
msgstr "Please, enter the URL of CSV file:"
@@ -1382,22 +1386,22 @@ msgstr "Please, enter the URL of CSV file:"
13821386
msgid "You have entered invalid URL. Please, insert proper URL."
13831387
msgstr "You have entered invalid URL. Please, insert proper URL."
13841388

1385-
#: classes/Visualizer/Module/Chart.php:379
1389+
#: classes/Visualizer/Module/Chart.php:381
13861390
msgid "Save Chart"
13871391
msgstr "Save Chart"
13881392

1389-
#: classes/Visualizer/Module/Chart.php:380
1393+
#: classes/Visualizer/Module/Chart.php:382
13901394
msgid "Create Chart"
13911395
msgstr "Create Chart"
13921396

1393-
#: classes/Visualizer/Module/Chart.php:382
1397+
#: classes/Visualizer/Module/Chart.php:384
13941398
msgid "Insert Chart"
13951399
msgstr "Insert Chart"
13961400

1397-
#: classes/Visualizer/Module/Chart.php:416
1401+
#: classes/Visualizer/Module/Chart.php:444
13981402
msgid "CSV file with chart data was not uploaded. Please, try again."
13991403
msgstr "CSV file with chart data was not uploaded. Please, try again."
14001404

1401-
#: classes/Visualizer/Module/Chart.php:431
1405+
#: classes/Visualizer/Module/Chart.php:459
14021406
msgid "CSV file is broken or invalid. Please, try again."
14031407
msgstr "CSV file is broken or invalid. Please, try again."

readme.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
=== Visualizer ===
22
Contributors: madpixels, straightforward
3-
Donate link: http://goo.gl/hN9FYf
3+
Donate link: http://flattr.com/thing/2574985/WordPress-Visualizer
44
Tags: chart, charts, charting, graph, graphs, graphing, visualisation, visualise data, visualization, visualize data, HTML5, canvas, pie chart, line chart, bar chart, column chart, gauge chart, area chart, scatter chart, candlestick chart, geo chart, google visualization api
55
Requires at least: 3.5
66
Tested up to: 3.8.1
@@ -60,6 +60,7 @@ Pay attention that to turn your shortcodes into graphs, your theme has to have `
6060

6161
= 1.4.2 =
6262
* Fixed remote CSV uploading issue when allow_url_fopen option is disabled in php.ini
63+
* Replaced flattr image on widget and added donate link to plugin meta data
6364

6465
= 1.4.1.1 =
6566
* Removed CSV parser escape constant to prevent warnings which appears when PHP 5.2.x or less is used

0 commit comments

Comments
 (0)