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

Delta Between Two Patch Sets: chrome/content/ui/filters.js

Issue 6337686776315904: Issue 394 - hit statistics tool data collection (Closed)
Left Patch Set: Addressed Wladimir comments (bunch of changes) Created March 18, 2016, 5:32 p.m.
Right Patch Set: Use Downloader to send the data to server Created April 6, 2016, 3 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | chrome/content/ui/filters.xul » ('j') | lib/filterHits.js » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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
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
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
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 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld