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

Unified Diff: stats.js

Issue 29317001: Relocated icon and redesigned icon popup (Closed)
Patch Set: Created Nov. 7, 2013, 5:44 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « skin/popup.png ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: stats.js
===================================================================
--- a/stats.js
+++ b/stats.js
@@ -21,6 +21,7 @@
var require = backgroundPage.require;
var getStats = require("stats").getStats;
var FilterNotifier = require("filterNotifier").FilterNotifier;
+ var Prefs = require("prefs").Prefs;
var currentTabId;
var shareURL = "https://adblockplus.org/";
@@ -68,8 +69,12 @@
function onLoad()
{
- document.getElementById("shareBox").addEventListener("click", share, false);
+ document.getElementById("share-box").addEventListener("click", share, false);
document.getElementById("share").addEventListener("click", toggleShareBox, false);
+ var showIconNumber = document.getElementById("show-iconnumber");
+ showIconNumber.setAttribute("aria-checked", Prefs.show_iconnumber);
+ showIconNumber.addEventListener("click", toggleIconNumber, false);
+ document.querySelector("label[for='show-iconnumber']").addEventListener("click", toggleIconNumber, false);
// Update stats
chrome.tabs.query({
@@ -84,7 +89,7 @@
FilterNotifier.addListener(onNotify);
- document.getElementById("statsContainer").removeAttribute("hidden");
+ document.getElementById("stats-container").removeAttribute("hidden");
}
});
}
@@ -102,18 +107,18 @@
function updateStats()
{
- var statsPage = document.getElementById("statsPage");
+ var statsPage = document.getElementById("stats-page");
var blockedPage = getStats("blocked", currentTabId).toLocaleString();
i18n.setElementText(statsPage, "stats_label_page", [blockedPage]);
- var statsTotal = document.getElementById("statsTotal");
+ var statsTotal = document.getElementById("stats-total");
var blockedTotal = getStats("blocked").toLocaleString();
i18n.setElementText(statsTotal, "stats_label_total", [blockedTotal]);
}
function toggleShareBox(ev)
{
- var shareBox = document.getElementById("shareBox");
+ var shareBox = document.getElementById("share-box");
shareBox.hidden = !shareBox.hidden;
}
@@ -130,6 +135,12 @@
chrome.tabs.create({url: url});
}
+ function toggleIconNumber()
+ {
+ Prefs.show_iconnumber = !Prefs.show_iconnumber;
+ document.getElementById("show-iconnumber").setAttribute("aria-checked", Prefs.show_iconnumber);
+ }
+
document.addEventListener("DOMContentLoaded", onLoad, false);
window.addEventListener("unload", onUnload, false);
})();
« no previous file with comments | « skin/popup.png ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld