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

Unified Diff: stats.js

Issue 5968535989780480: Issue 2567 - Simplified stats data structure, fixed regression resetting ad counter (Closed)
Patch Set: Created May 22, 2015, 1:07 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 | « lib/stats.js ('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
@@ -19,7 +19,7 @@
{
var backgroundPage = ext.backgroundPage.getWindow();
var require = backgroundPage.require;
- var getStats = require("stats").getStats;
+ var getBlockedPerPage = require("stats").getBlockedPerPage;
var FilterNotifier = require("filterNotifier").FilterNotifier;
var Prefs = require("prefs").Prefs;
@@ -101,18 +101,18 @@
function updateStats()
{
var statsPage = document.getElementById("stats-page");
- var blockedPage = getStats("blocked", currentPage).toLocaleString();
+ var blockedPage = getBlockedPerPage(currentPage).toLocaleString();
i18n.setElementText(statsPage, "stats_label_page", [blockedPage]);
var statsTotal = document.getElementById("stats-total");
- var blockedTotal = getStats("blocked").toLocaleString();
+ var blockedTotal = Prefs.blocked_total.toLocaleString();
i18n.setElementText(statsTotal, "stats_label_total", [blockedTotal]);
}
function share(ev)
{
// Easter Egg
- var blocked = getStats("blocked");
+ var blocked = Prefs.blocked_total;
if (blocked <= 9000 || blocked >= 10000)
blocked = blocked.toLocaleString();
else
« no previous file with comments | « lib/stats.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld