diff --git a/LEGALNOTICE b/LEGALNOTICE index 3b1cb8ede8eefd2d910d2a9eb3d024fd31e02d2a..76a9e9bb9f0d7ac6318c7d2b4d3b66b352d004db 100644 --- a/LEGALNOTICE +++ b/LEGALNOTICE @@ -87,6 +87,10 @@ THIRD-PARTY COMPONENTS AND LIBRARIES The following components/libraries are redistributed in this package, and subject to their respective licenses. + Name: jqPlot + Link: http://www.jqplot.com/ + License: Dual-licensed: MIT or GPL v2 + Name: CSS3PIE Link: http://github.com/lojjic/PIE License: Dual-licensed: Apache v2 or GPL v2 diff --git a/plugins/CoreHome/CoreHome.php b/plugins/CoreHome/CoreHome.php index 7eca027370d3184ede81858ac37289d2081c4ee9..2b2bba29156f434a1b2ba3a53b2988aaeb12b23b 100644 --- a/plugins/CoreHome/CoreHome.php +++ b/plugins/CoreHome/CoreHome.php @@ -80,7 +80,6 @@ class Piwik_CoreHome extends Piwik_Plugin $jsFiles[] = "plugins/CoreHome/templates/jqplot.js"; $jsFiles[] = $jqplot."excanvas.js"; $jsFiles[] = $jqplot."jqplot.core.js"; - $jsFiles[] = $jqplot."jqplot.linearTickGenerator.js"; $jsFiles[] = $jqplot."jqplot.linearAxisRenderer.js"; $jsFiles[] = $jqplot."jqplot.axisTickRenderer.js"; $jsFiles[] = $jqplot."jqplot.axisLabelRenderer.js"; @@ -92,7 +91,6 @@ class Piwik_CoreHome extends Piwik_Plugin $jsFiles[] = $jqplot."jqplot.shadowRenderer.js"; $jsFiles[] = $jqplot."jqplot.shapeRenderer.js"; $jsFiles[] = $jqplot."jqplot.sprintf.js"; - $jsFiles[] = $jqplot."jsdate.js"; $jsFiles[] = $jqplot."jqplot.themeEngine.js"; $jsFiles[] = $jqplot."plugins/jqplot.pieRenderer.js"; $jsFiles[] = $jqplot."plugins/jqplot.barRenderer.js"; diff --git a/plugins/CoreHome/templates/graph_jqplot.tpl b/plugins/CoreHome/templates/graph_jqplot.tpl index e7711ca4e4d0fe6dcdc0a41a1f7a48f81ca303a6..65f1d762e0415171fa810e7d853b9c630ee8fee0 100644 --- a/plugins/CoreHome/templates/graph_jqplot.tpl +++ b/plugins/CoreHome/templates/graph_jqplot.tpl @@ -14,7 +14,11 @@ <script type="text/javascript"> {literal} window.setTimeout(function() { {/literal} - (new JQPlot({$flashParameters.data})).render('{$jqPlotType}', '{$chartDivId}', false, '{'General_NoDataForGraph'|translate}'); + (new JQPlot({$flashParameters.data})).render('{$jqPlotType}', '{$chartDivId}', false, {literal} { {/literal} + noData: '{'General_NoDataForGraph'|translate}', + exportTitle: '{'General_ExportAsImage_js'|translate}', + exportText: '{'General_SaveImageOnYourComputer_js'|translate}' + {literal} }); {/literal} {literal} }, 5); {/literal} </script> diff --git a/plugins/CoreHome/templates/jqplot.js b/plugins/CoreHome/templates/jqplot.js index beae483d2a78e3d237079c12f7de84c47cc5f789..6982a93b8992314961d58345a04216c7e36a5400 100644 --- a/plugins/CoreHome/templates/jqplot.js +++ b/plugins/CoreHome/templates/jqplot.js @@ -55,7 +55,7 @@ JQPlot.prototype = { }, /** Generic render function */ - render: function(type, targetDivId, replotting, noDataString) { + render: function(type, targetDivId, replotting, lang) { // preapare the appropriate chart type switch (type) { case 'graphEvolution': @@ -75,7 +75,7 @@ JQPlot.prototype = { // TODO: this should already be noticed by php and the chart should // not even be generated if (this.data.length == 0) { - $('#' + targetDivId).addClass('pk-emptyGraph').css('height', 'auto').html(noDataString); + $('#' + targetDivId).addClass('pk-emptyGraph').css('height', 'auto').html(lang.noData); return; } @@ -106,7 +106,7 @@ JQPlot.prototype = { plot.replot(); }) .bind('piwikExportAsImage', function(e) { - self.exportAsImage(target); + self.exportAsImage(target, lang); }); var plotWidth = target.innerWidth(); @@ -122,7 +122,7 @@ JQPlot.prototype = { }, /** Export the chart as an image */ - exportAsImage: function(container) { + exportAsImage: function(container, lang) { var exportCanvas = document.createElement('canvas'); exportCanvas.width = container.width(); exportCanvas.height = container.height(); @@ -154,9 +154,10 @@ JQPlot.prototype = { }); $(document.createElement('div')) - .append('Right click, save image as (translate!)<br />').append($(img)) + .append('<div style="font-size: 13px; margin-bottom: 3px;">' + + lang.exportText + '</div>').append($(img)) .dialog({ - title: 'Export (translate!)', + title: lang.exportTitle, modal: true, width: 'auto', position: ['center', 'center'],