aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorgorhill <rhill@raymondhill.net>2015-03-11 11:21:29 -0400
committergorhill <rhill@raymondhill.net>2015-03-11 11:21:29 -0400
commitca0057e7247c6f9d17f17754de07fb99db8b73ae (patch)
tree06778d9234ebcccd8d750e9ad5a83c3133c8cb3e /src
parent5b6a7b3aa4cf89edc5288edf517ac62ec0364283 (diff)
downloaduBlock-ca0057e7247c6f9d17f17754de07fb99db8b73ae.zip
uBlock-ca0057e7247c6f9d17f17754de07fb99db8b73ae.tar.gz
uBlock-ca0057e7247c6f9d17f17754de07fb99db8b73ae.tar.bz2
using new string for blocked stats
Diffstat (limited to 'src')
-rw-r--r--src/js/popup.js29
1 files changed, 11 insertions, 18 deletions
diff --git a/src/js/popup.js b/src/js/popup.js
index 291dd47..010460e 100644
--- a/src/js/popup.js
+++ b/src/js/popup.js
@@ -19,7 +19,7 @@
Home: https://github.com/gorhill/uBlock
*/
-/* global vAPI, uDom */
+/* global punycode, vAPI, uDom */
/******************************************************************************/
@@ -49,7 +49,7 @@ var allHostnameRows = [];
var touchedDomainCount = 0;
var rowsToRecycle = uDom();
var cachedPopupHash = '';
-var orStr = vAPI.i18n('popupOr');
+var statsStr = vAPI.i18n('popupBlockedStats');
var domainsHitStr = vAPI.i18n('popupHitDomainCount');
/******************************************************************************/
@@ -383,33 +383,26 @@ var renderPopup = function () {
.attr('href', 'devtools.html?tabId=' + popupData.tabId);
uDom('#gotoPick').toggleClass('enabled', popupData.canElementPicker === true);
+ var text;
var blocked = popupData.pageBlockedRequestCount;
var total = popupData.pageAllowedRequestCount + blocked;
- var text = [];
if ( total === 0 ) {
- text.push(formatNumber(0));
+ text = formatNumber(0);
} else {
- text.push(
- formatNumber(blocked),
- '\u00a0', orStr, '\u00a0',
- formatNumber(Math.floor(blocked * 100 / total)), '%'
- );
+ text = statsStr.replace('{{count}}', formatNumber(blocked))
+ .replace('{{percent}}', formatNumber(Math.floor(blocked * 100 / total)));
}
- uDom('#page-blocked').text(text.join(''));
+ uDom('#page-blocked').text(text);
blocked = popupData.globalBlockedRequestCount;
total = popupData.globalAllowedRequestCount + blocked;
- text = [];
if ( total === 0 ) {
- text.push(formatNumber(0));
+ text = formatNumber(0);
} else {
- text.push(
- formatNumber(blocked),
- '\u00a0', orStr, '\u00a0',
- formatNumber(Math.floor(blocked * 100 / total)), '%'
- );
+ text = statsStr.replace('{{count}}', formatNumber(blocked))
+ .replace('{{percent}}', formatNumber(Math.floor(blocked * 100 / total)));
}
- uDom('#total-blocked').text(text.join(''));
+ uDom('#total-blocked').text(text);
// This will collate all domains, touched or not
renderPrivacyExposure();