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

Unified Diff: chrome/content/ui/filters.js

Issue 6337686776315904: Issue 394 - hit statistics tool data collection (Closed)
Patch Set: Addressed Wladimir comments (save data in the database instead of memory) Created Feb. 19, 2016, 5:20 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 | « no previous file | chrome/content/ui/filters.xul » ('j') | defaults/prefs.json » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/content/ui/filters.js
===================================================================
--- a/chrome/content/ui/filters.js
+++ b/chrome/content/ui/filters.js
@@ -15,6 +15,8 @@
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
+let {Prefs} = require("prefs");
+
/**
* Initialization function, called when the window is loaded.
*/
@@ -26,6 +28,14 @@
if (filter instanceof Filter)
Utils.runAsync(() => SubscriptionActions.selectFilter(filter));
}
+
+ E("sendStats").hidden = !Prefs.savestats;
+ E("sendStats").getElementsByTagName("checkbox")[0].checked = Prefs.sendstats;
Wladimir Palant 2016/02/29 14:35:43 Please don't access elements like that, they shoul
saroyanm 2016/03/18 18:23:11 Done.
+ Prefs.addListener(function(name)
+ {
+ if (name == "savestats")
+ E("sendStats").hidden = !Prefs[name];
Wladimir Palant 2016/02/29 14:35:43 Nit: No point obfuscating this - just use Prefs.sa
saroyanm 2016/03/18 18:23:11 Done.
+ });
}
/**
@@ -102,6 +112,14 @@
}
/**
+ * Toggles option for sending filter hit statistics.
+ */
+function toggleSendStats(/**Boolean*/ allow)
+{
+ Prefs.sendstats = allow;
+}
+
+/**
* Template processing functions.
* @class
*/
« no previous file with comments | « no previous file | chrome/content/ui/filters.xul » ('j') | defaults/prefs.json » ('J')

Powered by Google App Engine
This is Rietveld