Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: stats.js

Issue 29532767: Issue 5593 - Use messaging in popup for prefs, whitelisting, and stats (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Left Patch Set: Rebase on next Created Sept. 24, 2017, 9:21 p.m.
Right Patch Set: Revert one more instance of ext.pages.open Created Sept. 27, 2017, 9:40 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « skin/popup.css ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17 17
18 /* global i18n */ 18 /* global i18n, getPref, togglePref */
19 19
20 "use strict"; 20 "use strict";
21 21
22 (function() 22 (function()
23 { 23 {
24 const {require} = ext.backgroundPage.getWindow(); 24 const {require} = ext.backgroundPage.getWindow();
25 25
26 const {FilterNotifier} = require("filterNotifier"); 26 const {FilterNotifier} = require("filterNotifier");
27 27
28 let currentTab; 28 let currentTab;
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 function share(ev) 126 function share(ev)
127 { 127 {
128 getPref("blocked_total", blockedTotal => 128 getPref("blocked_total", blockedTotal =>
129 { 129 {
130 // Easter Egg 130 // Easter Egg
131 if (blockedTotal <= 9000 || blockedTotal >= 10000) 131 if (blockedTotal <= 9000 || blockedTotal >= 10000)
132 blockedTotal = blockedTotal.toLocaleString(); 132 blockedTotal = blockedTotal.toLocaleString();
133 else 133 else
134 blockedTotal = i18n.getMessage("stats_over", (9000).toLocaleString()); 134 blockedTotal = i18n.getMessage("stats_over", (9000).toLocaleString());
135 135
136 chrome.tabs.create({ 136 ext.pages.open(createShareLink(ev.target.dataset.social, blockedTotal));
Manish Jethani 2017/09/27 09:42:32 Sorry, I forgot this one.
137 url: createShareLink(ev.target.dataset.social, blockedTotal)
138 });
139 }); 137 });
140 } 138 }
141 139
142 function toggleIconNumber() 140 function toggleIconNumber()
143 { 141 {
144 togglePref("show_statsinicon", showStatsInIcon => 142 togglePref("show_statsinicon", showStatsInIcon =>
145 { 143 {
146 document.getElementById("show-iconnumber").setAttribute( 144 document.getElementById("show-iconnumber").setAttribute(
147 "aria-checked", showStatsInIcon 145 "aria-checked", showStatsInIcon
148 ); 146 );
149 }); 147 });
150 } 148 }
151 149
152 document.addEventListener("DOMContentLoaded", onLoad, false); 150 document.addEventListener("DOMContentLoaded", onLoad, false);
153 window.addEventListener("unload", onUnload, false); 151 window.addEventListener("unload", onUnload, false);
154 }()); 152 }());
LEFTRIGHT

Powered by Google App Engine
This is Rietveld