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

Delta Between Two Patch Sets: popup.js

Issue 29570774: Issue 5593 - Merge notification.js and stats.js into popup.js (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Left Patch Set: Remove optional useCapture argument Created Oct. 10, 2017, 5:14 a.m.
Right Patch Set: Rename ev to event Created Oct. 10, 2017, 5:17 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 | « popup.html ('k') | stats.js » ('j') | 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
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 }); 213 });
214 214
215 let statsTotal = document.getElementById("stats-total"); 215 let statsTotal = document.getElementById("stats-total");
216 getPref("blocked_total", blockedTotal => 216 getPref("blocked_total", blockedTotal =>
217 { 217 {
218 ext.i18n.setElementText(statsTotal, "stats_label_total", 218 ext.i18n.setElementText(statsTotal, "stats_label_total",
219 [blockedTotal.toLocaleString()]); 219 [blockedTotal.toLocaleString()]);
220 }); 220 });
221 } 221 }
222 222
223 function share(ev) 223 function share(event)
224 { 224 {
225 getPref("blocked_total", blockedTotal => 225 getPref("blocked_total", blockedTotal =>
226 { 226 {
227 // Easter Egg 227 // Easter Egg
228 if (blockedTotal <= 9000 || blockedTotal >= 10000) 228 if (blockedTotal <= 9000 || blockedTotal >= 10000)
229 { 229 {
230 blockedTotal = blockedTotal.toLocaleString(); 230 blockedTotal = blockedTotal.toLocaleString();
231 } 231 }
232 else 232 else
233 { 233 {
234 blockedTotal = chrome.i18n.getMessage("stats_over", 234 blockedTotal = chrome.i18n.getMessage("stats_over",
235 (9000).toLocaleString()); 235 (9000).toLocaleString());
236 } 236 }
237 237
238 chrome.tabs.create({ 238 chrome.tabs.create({
239 url: createShareLink(ev.target.dataset.social, blockedTotal) 239 url: createShareLink(event.target.dataset.social, blockedTotal)
240 }); 240 });
241 }); 241 });
242 } 242 }
243 243
244 function toggleIconNumber() 244 function toggleIconNumber()
245 { 245 {
246 togglePref("show_statsinicon", showStatsInIcon => 246 togglePref("show_statsinicon", showStatsInIcon =>
247 { 247 {
248 document.getElementById("show-iconnumber").setAttribute( 248 document.getElementById("show-iconnumber").setAttribute(
249 "aria-checked", showStatsInIcon 249 "aria-checked", showStatsInIcon
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 { 386 {
387 if (event.target.id == "notification-optout") 387 if (event.target.id == "notification-optout")
388 setPref("notifications_ignoredcategories", true); 388 setPref("notifications_ignoredcategories", true);
389 389
390 notificationElement.hidden = true; 390 notificationElement.hidden = true;
391 notification.onClicked(); 391 notification.onClicked();
392 } 392 }
393 }, true); 393 }, true);
394 }); 394 });
395 }); 395 });
LEFTRIGHT

Powered by Google App Engine
This is Rietveld