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: Created April 6, 2014, 3:16 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:
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
(no file at all)
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
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17 17
18 /** 18 /**
19 * Initialization function, called when the window is loaded. 19 * Initialization function, called when the window is loaded.
20 */ 20 */
21 function init() 21 function init()
22 { 22 {
23 if (window.arguments && window.arguments.length) 23 if (window.arguments && window.arguments.length)
24 { 24 {
25 let filter = window.arguments[0].wrappedJSObject; 25 let filter = window.arguments[0].wrappedJSObject;
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
30 E("sendStats-container").hidden = !Prefs.savestats;
31 E("sendStats").checked = Prefs.sendstats;
32 Prefs.addListener(function(name)
33 {
34 if (name == "savestats")
35 E("sendStats-container").hidden = !Prefs.savestats;
36 else if (name == "sendstats")
37 E("sendStats").checked = Prefs.sendstats;
38 });
29 } 39 }
30 40
31 /** 41 /**
32 * Called whenever the currently selected tab changes. 42 * Called whenever the currently selected tab changes.
33 */ 43 */
34 function onTabChange(/**Element*/ tabbox) 44 function onTabChange(/**Element*/ tabbox)
35 { 45 {
36 updateSelectedSubscription(); 46 updateSelectedSubscription();
37 47
38 Utils.runAsync(function() 48 Utils.runAsync(function()
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 if (!panel) 102 if (!panel)
93 return; 103 return;
94 104
95 let list = panel.getElementsByTagName("richlistbox")[0]; 105 let list = panel.getElementsByTagName("richlistbox")[0];
96 if (!list) 106 if (!list)
97 return; 107 return;
98 108
99 let data = Templater.getDataForNode(list.selectedItem); 109 let data = Templater.getDataForNode(list.selectedItem);
100 FilterView.subscription = (data ? data.subscription : null); 110 FilterView.subscription = (data ? data.subscription : null);
101 FilterActions.updateCommands(); 111 FilterActions.updateCommands();
112 }
113
114 /**
115 * Toggles option for sending filter hit statistics.
116 */
117 function toggleSendStats(/**Boolean*/ allow)
118 {
119 Prefs.sendstats = allow;
102 } 120 }
103 121
104 /** 122 /**
105 * Template processing functions. 123 * Template processing functions.
106 * @class 124 * @class
107 */ 125 */
108 var Templater = 126 var Templater =
109 { 127 {
110 /** 128 /**
111 * Processes a template node using given data object. 129 * Processes a template node using given data object.
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 * data object. 236 * data object.
219 */ 237 */
220 getNodeForData: function(/**Node*/ parent, /**String*/ property, /**Object*/ d ata) /**Node*/ 238 getNodeForData: function(/**Node*/ parent, /**String*/ property, /**Object*/ d ata) /**Node*/
221 { 239 {
222 for (let child = parent.firstChild; child; child = child.nextSibling) 240 for (let child = parent.firstChild; child; child = child.nextSibling)
223 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)
224 return child; 242 return child;
225 return null; 243 return null;
226 } 244 }
227 }; 245 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld