| LEFT | RIGHT |
| 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 Loading... |
| 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 Loading... |
| 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 }); |
| LEFT | RIGHT |