Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 15 matching lines...) Expand all Loading... | |
26 if (filter instanceof Filter) | 26 if (filter instanceof Filter) |
27 Utils.runAsync(() => SubscriptionActions.selectFilter(filter)); | 27 Utils.runAsync(() => SubscriptionActions.selectFilter(filter)); |
28 } | 28 } |
29 | 29 |
30 E("sendStats-container").hidden = !Prefs.savestats; | 30 E("sendStats-container").hidden = !Prefs.savestats; |
31 E("sendStats").checked = Prefs.sendstats; | 31 E("sendStats").checked = Prefs.sendstats; |
32 Prefs.addListener(function(name) | 32 Prefs.addListener(function(name) |
33 { | 33 { |
34 if (name == "savestats") | 34 if (name == "savestats") |
35 E("sendStats-container").hidden = !Prefs.savestats; | 35 E("sendStats-container").hidden = !Prefs.savestats; |
36 else if (name == "sendStats") | 36 else if (name == "sendstats") |
Wladimir Palant
2016/03/22 21:32:18
The pref is called sendstats, not sendStats.
saroyanm
2016/04/06 15:15:21
Done.
| |
37 E("sendStats").checked = Prefs.sendstats; | 37 E("sendStats").checked = Prefs.sendstats; |
38 }); | 38 }); |
39 } | 39 } |
40 | 40 |
41 /** | 41 /** |
42 * Called whenever the currently selected tab changes. | 42 * Called whenever the currently selected tab changes. |
43 */ | 43 */ |
44 function onTabChange(/**Element*/ tabbox) | 44 function onTabChange(/**Element*/ tabbox) |
45 { | 45 { |
46 updateSelectedSubscription(); | 46 updateSelectedSubscription(); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 /** | 128 /** |
129 * Processes a template node using given data object. | 129 * Processes a template node using given data object. |
130 */ | 130 */ |
131 process: function(/**Node*/ template, /**Object*/ data) /**Node*/ | 131 process: function(/**Node*/ template, /**Object*/ data) /**Node*/ |
132 { | 132 { |
133 // Use a sandbox to resolve attributes (for convenience, not security) | 133 // Use a sandbox to resolve attributes (for convenience, not security) |
134 let sandbox = Cu.Sandbox(window); | 134 let sandbox = Cu.Sandbox(window); |
135 for (let key in data) | 135 for (let key in data) |
136 sandbox[key] = data[key]; | 136 sandbox[key] = data[key]; |
137 sandbox.formatTime = Utils.formatTime; | 137 sandbox.formatTime = Utils.formatTime; |
138 sandbox.getSubscriptionTitle = getSubscriptionTitle; | |
138 | 139 |
139 // Clone template but remove id/hidden attributes from it | 140 // Clone template but remove id/hidden attributes from it |
140 let result = template.cloneNode(true); | 141 let result = template.cloneNode(true); |
141 result.removeAttribute("id"); | 142 result.removeAttribute("id"); |
142 result.removeAttribute("hidden"); | 143 result.removeAttribute("hidden"); |
143 result._data = data; | 144 result._data = data; |
144 | 145 |
145 // Resolve any attributes of the for attr="{obj.foo}" | 146 // Resolve any attributes of the for attr="{obj.foo}" |
146 let conditionals = []; | 147 let conditionals = []; |
147 let nodeIterator = document.createNodeIterator(result, NodeFilter.SHOW_ELEME NT, null, false); | 148 let nodeIterator = document.createNodeIterator(result, NodeFilter.SHOW_ELEME NT, null, false); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
235 * data object. | 236 * data object. |
236 */ | 237 */ |
237 getNodeForData: function(/**Node*/ parent, /**String*/ property, /**Object*/ d ata) /**Node*/ | 238 getNodeForData: function(/**Node*/ parent, /**String*/ property, /**Object*/ d ata) /**Node*/ |
238 { | 239 { |
239 for (let child = parent.firstChild; child; child = child.nextSibling) | 240 for (let child = parent.firstChild; child; child = child.nextSibling) |
240 if ("_data" in child && property in child._data && child._data[property] = = data) | 241 if ("_data" in child && property in child._data && child._data[property] = = data) |
241 return child; | 242 return child; |
242 return null; | 243 return null; |
243 } | 244 } |
244 }; | 245 }; |
LEFT | RIGHT |