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

Side by Side Diff: stats.js

Issue 29366773: Issue 4698 - Popup window is broken in Edge (Closed)
Patch Set: Created Dec. 5, 2016, 12:15 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/ext/popup.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 89
90 function onUnload() 90 function onUnload()
91 { 91 {
92 FilterNotifier.off("filter.hitCount", updateStats); 92 FilterNotifier.off("filter.hitCount", updateStats);
93 } 93 }
94 94
95 function updateStats() 95 function updateStats()
96 { 96 {
97 var statsPage = document.getElementById("stats-page"); 97 var statsPage = document.getElementById("stats-page");
98 var blockedPage = getBlockedPerPage(currentPage).toLocaleString(); 98 var blockedPage = getBlockedPerPage(currentPage).toLocaleString();
99 i18n.setElementText(statsPage, "stats_label_page", [blockedPage]); 99 i18n.setElementText(statsPage, "stats_label_page", blockedPage);
Oleksandr 2016/12/05 00:27:36 Edge throws if passed an array as a second paramet
kzar 2016/12/05 12:22:52 How come that throws, since according to the Mozil
100 100
101 var statsTotal = document.getElementById("stats-total"); 101 var statsTotal = document.getElementById("stats-total");
102 var blockedTotal = Prefs.blocked_total.toLocaleString(); 102 var blockedTotal = Prefs.blocked_total.toLocaleString();
103 i18n.setElementText(statsTotal, "stats_label_total", [blockedTotal]); 103 i18n.setElementText(statsTotal, "stats_label_total", blockedTotal);
104 } 104 }
105 105
106 function share(ev) 106 function share(ev)
107 { 107 {
108 // Easter Egg 108 // Easter Egg
109 var blocked = Prefs.blocked_total; 109 var blocked = Prefs.blocked_total;
110 if (blocked <= 9000 || blocked >= 10000) 110 if (blocked <= 9000 || blocked >= 10000)
111 blocked = blocked.toLocaleString(); 111 blocked = blocked.toLocaleString();
112 else 112 else
113 blocked = i18n.getMessage("stats_over", (9000).toLocaleString()); 113 blocked = i18n.getMessage("stats_over", (9000).toLocaleString());
114 114
115 ext.pages.open(createShareLink(ev.target.dataset.social, blocked)); 115 ext.pages.open(createShareLink(ev.target.dataset.social, blocked));
116 } 116 }
117 117
118 function toggleIconNumber() 118 function toggleIconNumber()
119 { 119 {
120 Prefs.show_statsinicon = !Prefs.show_statsinicon; 120 Prefs.show_statsinicon = !Prefs.show_statsinicon;
121 document.getElementById("show-iconnumber").setAttribute("aria-checked", Pref s.show_statsinicon); 121 document.getElementById("show-iconnumber").setAttribute("aria-checked", Pref s.show_statsinicon);
122 } 122 }
123 123
124 document.addEventListener("DOMContentLoaded", onLoad, false); 124 document.addEventListener("DOMContentLoaded", onLoad, false);
125 window.addEventListener("unload", onUnload, false); 125 window.addEventListener("unload", onUnload, false);
126 })(); 126 })();
OLDNEW
« no previous file with comments | « chrome/ext/popup.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld