diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2015-10-15 16:43:35 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2015-10-15 16:43:35 +0300 |
commit | bb80b8f831e10f037c8d2722c9967943defef95e (patch) | |
tree | 3ce0a28cb1d15148cd15d48b83a39e0c92bf38b8 /plugins/Transitions | |
parent | 713a124cc2c118697f3f2801679bc0e2bb5c5dc3 (diff) | |
parent | 1e139be2c8c3c6f974e740dd1c9f905e8f673f98 (diff) |
Merge branch 'master' into 3.0
Conflicts:
CHANGELOG.md
core/Plugin/Controller.php
core/Version.php
plugins/API/ProcessedReport.php
plugins/CoreHome/CoreHome.php
plugins/CoreHome/javascripts/corehome.js
plugins/CoreHome/javascripts/menu.js
plugins/CoreHome/javascripts/menu_init.js
plugins/CoreHome/lang/en.json
plugins/CoreHome/stylesheets/zen-mode.less
plugins/CoreHome/templates/ReportsByDimension/_reportsByDimension.twig
plugins/CoreHome/templates/_indexContent.twig
plugins/CoreHome/templates/getDefaultIndexView.twig
plugins/Dashboard/Menu.php
plugins/Dashboard/javascripts/dashboard.js
plugins/Dashboard/javascripts/dashboardObject.js
plugins/Goals/templates/_titleAndEvolutionGraph.twig
plugins/Goals/templates/getOverviewView.twig
plugins/Morpheus/javascripts/piwikHelper.js
plugins/Referrers/templates/index.twig
plugins/UserCountry/templates/index.twig
plugins/VisitFrequency/templates/_sparklines.twig
plugins/ZenMode/ZenMode.php
plugins/ZenMode/javascripts/zen-mode.js
tests/PHPUnit/Fixtures/UITestFixture.php
tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getReportMetadata_day.xml
tests/UI/expected-ui-screenshots
tests/UI/specs/Dashboard_spec.js
tests/UI/specs/Menus_spec.js
tests/UI/specs/UIIntegration_spec.js
Diffstat (limited to 'plugins/Transitions')
-rw-r--r-- | plugins/Transitions/javascripts/transitions.js | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/plugins/Transitions/javascripts/transitions.js b/plugins/Transitions/javascripts/transitions.js index 52e20800f6..cb98e3d045 100644 --- a/plugins/Transitions/javascripts/transitions.js +++ b/plugins/Transitions/javascripts/transitions.js @@ -231,10 +231,10 @@ Piwik_Transitions.prototype.preparePopover = function () { var totalNbPageviews = self.model.getTotalNbPageviews(); if (totalNbPageviews > 0) { - var share = Math.round(self.model.pageviews / totalNbPageviews * 1000) / 10; + var share = NumberFormatter.formatPercent(Math.round(self.model.pageviews / totalNbPageviews * 1000) / 10); var text = Piwik_Transitions_Translations.ShareOfAllPageviews; - text = text.replace(/%s/, self.model.pageviews).replace(/%s/, share + '%'); + text = text.replace(/%s/, NumberFormatter.formatNumber(self.model.pageviews)).replace(/%s/, share); text += '<br /><em>' + Piwik_Transitions_Translations.DateRange + ' ' + self.model.date + '</em>'; var title = '<h3>' + piwikHelper.addBreakpointsToUrl(self.actionName) + '</h3>'; @@ -341,12 +341,12 @@ Piwik_Transitions.prototype.renderCenterBox = function () { var box = this.centerBox; Piwik_Transitions_Util.replacePlaceholderInHtml( - box.find('.Transitions_Pageviews'), this.model.pageviews); + box.find('.Transitions_Pageviews'), NumberFormatter.formatNumber(this.model.pageviews)); var self = this; var showMetric = function (cssClass, modelProperty, highlightCurveOnSide, groupCanBeExpanded) { var el = box.find('.Transitions_' + cssClass); - Piwik_Transitions_Util.replacePlaceholderInHtml(el, self.model[modelProperty]); + Piwik_Transitions_Util.replacePlaceholderInHtml(el, NumberFormatter.formatNumber(self.model[modelProperty])); if (self.model[modelProperty] == 0) { el.addClass('Transitions_Value0'); @@ -404,7 +404,7 @@ Piwik_Transitions.prototype.renderLoops = function () { } var loops = this.popover.find('#Transitions_Loops').show(); - Piwik_Transitions_Util.replacePlaceholderInHtml(loops, this.model.loops); + Piwik_Transitions_Util.replacePlaceholderInHtml(loops, NumberFormatter.formatNumber(this.model.loops)); this.addTooltipShowingPercentageOfAllPageviews(loops, 'loops'); @@ -562,7 +562,7 @@ Piwik_Transitions.prototype.renderOpenGroup = function (groupName, side, onlyBg) boxText: label, boxTextTooltip: isOthers || !shortened ? false : fullLabel, boxTextNumLines: 3, - curveText: data.percentage + '%', + curveText: NumberFormatter.formatPercent(data.percentage), curveTextTooltip: tooltip, onClick: onClick }); @@ -1375,8 +1375,9 @@ Piwik_Transitions_Model.prototype.getPercentage = function (metric, formatted) { var percentage = (this.pageviews == 0 ? 0 : this[metric] / this.pageviews); if (formatted) { + percentage = this.roundPercentage(percentage); - percentage += '%'; + return NumberFormatter.formatPercent(percentage); } return percentage; |