Left: | ||
Right: |
OLD | NEW |
---|---|
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-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 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 let {FilterHits} = require("filterHits"); | |
19 | |
18 /** | 20 /** |
19 * Fills a list of filter groups and keeps it updated. | 21 * Fills a list of filter groups and keeps it updated. |
20 * @param {Element} list richlistbox element to be filled | 22 * @param {Element} list richlistbox element to be filled |
21 * @param {Node} template template to use for the groups | 23 * @param {Node} template template to use for the groups |
22 * @param {Function} filter filter to decide which lists should be included | 24 * @param {Function} filter filter to decide which lists should be included |
23 * @param {Function} listener function to be called on changes | 25 * @param {Function} listener function to be called on changes |
24 * @constructor | 26 * @constructor |
25 */ | 27 */ |
26 function ListManager(list, template, filter, listener) | 28 function ListManager(list, template, filter, listener) |
27 { | 29 { |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
317 if (allow) | 319 if (allow) |
318 { | 320 { |
319 FilterStorage.addSubscription(subscription); | 321 FilterStorage.addSubscription(subscription); |
320 if (subscription instanceof DownloadableSubscription && !subscription.lastDo wnload) | 322 if (subscription instanceof DownloadableSubscription && !subscription.lastDo wnload) |
321 Synchronizer.execute(subscription); | 323 Synchronizer.execute(subscription); |
322 } | 324 } |
323 else | 325 else |
324 FilterStorage.removeSubscription(subscription); | 326 FilterStorage.removeSubscription(subscription); |
325 }; | 327 }; |
326 | 328 |
327 window.addEventListener("load", ListManager.init, false); | 329 /** |
330 * Toggles option for sending filter hit statistics. | |
331 */ | |
332 function toggleSendStats(/**Boolean*/ allow) | |
333 { | |
334 if (!allow) | |
335 FilterHits.resetFilterHits(); | |
Wladimir Palant
2016/02/15 12:25:39
Two notes:
1) I think this code is better placed
saroyanm
2016/02/19 17:38:09
Good point. Done.
| |
336 | |
337 Prefs.sendstats = allow; | |
338 } | |
Wladimir Palant
2016/02/15 12:25:39
This code doesn't really belong here - all the log
saroyanm
2016/02/19 17:38:10
Done.
| |
339 | |
340 window.addEventListener("load", function() | |
341 { | |
342 ListManager.init(); | |
343 E("sendStats").checked = Prefs.sendstats; | |
Wladimir Palant
2016/02/15 12:25:39
What if Prefs.savestats isn't set? I think we don'
saroyanm
2016/02/19 17:38:09
Good point, Done.
| |
344 }, false); | |
OLD | NEW |