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 |
*/ |