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

Delta Between Two Patch Sets: stats.js

Issue 29317001: Relocated icon and redesigned icon popup (Closed)
Left Patch Set: Rebased Created Nov. 19, 2013, 1:43 p.m.
Right Patch Set: Merged setBadgeNumber and setBadgeBackgroundColor Created Dec. 13, 2013, 10:36 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
« skin/popup.css ('K') | « skin/popup.png ('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 <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2013 Eyeo GmbH 3 * Copyright (C) 2006-2013 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 value = i18n.getMessage("stats_share_message", blockedCount); 64 value = i18n.getMessage("stats_share_message", blockedCount);
65 querystring.push(encodeURIComponent(key) + "=" + encodeURIComponent(value) ); 65 querystring.push(encodeURIComponent(key) + "=" + encodeURIComponent(value) );
66 } 66 }
67 return url + "?" + querystring.join("&"); 67 return url + "?" + querystring.join("&");
68 } 68 }
69 69
70 function onLoad() 70 function onLoad()
71 { 71 {
72 document.getElementById("share-box").addEventListener("click", share, false) ; 72 document.getElementById("share-box").addEventListener("click", share, false) ;
73 var showIconNumber = document.getElementById("show-iconnumber"); 73 var showIconNumber = document.getElementById("show-iconnumber");
74 showIconNumber.setAttribute("aria-checked", Prefs.show_iconnumber); 74 showIconNumber.setAttribute("aria-checked", Prefs.show_statsinicon);
75 showIconNumber.addEventListener("click", toggleIconNumber, false); 75 showIconNumber.addEventListener("click", toggleIconNumber, false);
76 document.querySelector("label[for='show-iconnumber']").addEventListener("cli ck", toggleIconNumber, false); 76 document.querySelector("label[for='show-iconnumber']").addEventListener("cli ck", toggleIconNumber, false);
77 77
78 // Update stats 78 // Update stats
79 ext.windows.getLastFocused(function(win) 79 ext.windows.getLastFocused(function(win)
80 { 80 {
81 win.getActiveTab(function(tab) 81 win.getActiveTab(function(tab)
82 { 82 {
83 currentTab = tab; 83 currentTab = tab;
84 updateStats(); 84 updateStats();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 blocked = blocked.toLocaleString(); 120 blocked = blocked.toLocaleString();
121 else 121 else
122 blocked = i18n.getMessage("stats_over", (9000).toLocaleString()); 122 blocked = i18n.getMessage("stats_over", (9000).toLocaleString());
123 123
124 var url = createShareLink(ev.target.dataset.social, blocked); 124 var url = createShareLink(ev.target.dataset.social, blocked);
125 ext.windows.getLastFocused(function(win) { win.openTab(url); }); 125 ext.windows.getLastFocused(function(win) { win.openTab(url); });
126 } 126 }
127 127
128 function toggleIconNumber() 128 function toggleIconNumber()
129 { 129 {
130 Prefs.show_iconnumber = !Prefs.show_iconnumber; 130 Prefs.show_statsinicon = !Prefs.show_statsinicon;
131 document.getElementById("show-iconnumber").setAttribute("aria-checked", Pref s.show_iconnumber); 131 document.getElementById("show-iconnumber").setAttribute("aria-checked", Pref s.show_statsinicon);
132 } 132 }
133 133
134 document.addEventListener("DOMContentLoaded", onLoad, false); 134 document.addEventListener("DOMContentLoaded", onLoad, false);
135 window.addEventListener("unload", onUnload, false); 135 window.addEventListener("unload", onUnload, false);
136 })(); 136 })();
LEFTRIGHT

Powered by Google App Engine
This is Rietveld