| 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 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 reload: function() | 80 reload: function() |
| 81 { | 81 { |
| 82 // Remove existing entries if any | 82 // Remove existing entries if any |
| 83 while (this._list.firstChild) | 83 while (this._list.firstChild) |
| 84 this._list.removeChild(this._list.firstChild); | 84 this._list.removeChild(this._list.firstChild); |
| 85 | 85 |
| 86 // Now add all subscriptions | 86 // Now add all subscriptions |
| 87 let subscriptions = FilterStorage.subscriptions.filter(this._filter, this); | 87 let subscriptions = FilterStorage.subscriptions.filter(this._filter, this); |
| 88 if (subscriptions.length) | 88 if (subscriptions.length) |
| 89 { | 89 { |
| 90 for each (let subscription in subscriptions) | 90 for (let subscription of subscriptions) |
| 91 this.addSubscription(subscription, null); | 91 this.addSubscription(subscription, null); |
| 92 | 92 |
| 93 // Make sure first list item is selected after list initialization | 93 // Make sure first list item is selected after list initialization |
| 94 Utils.runAsync(function() | 94 Utils.runAsync(function() |
| 95 { | 95 { |
| 96 this._list.selectItem(this._list.getItemAtIndex(this._list.getIndexOfFir
stVisibleRow())); | 96 this._list.selectItem(this._list.getItemAtIndex(this._list.getIndexOfFir
stVisibleRow())); |
| 97 }, this); | 97 }, this); |
| 98 } | 98 } |
| 99 | 99 |
| 100 this._deck.selectedIndex = (subscriptions.length ? 1 : 0); | 100 this._deck.selectedIndex = (subscriptions.length ? 1 : 0); |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 new ListManager(E("subscriptions"), | 291 new ListManager(E("subscriptions"), |
| 292 E("subscriptionTemplate"), | 292 E("subscriptionTemplate"), |
| 293 function(s) s instanceof RegularSubscription && !(ListManager.
acceptableAdsCheckbox && s.url == Prefs.subscriptions_exceptionsurl), | 293 function(s) s instanceof RegularSubscription && !(ListManager.
acceptableAdsCheckbox && s.url == Prefs.subscriptions_exceptionsurl), |
| 294 SubscriptionActions.updateCommands); | 294 SubscriptionActions.updateCommands); |
| 295 new ListManager(E("groups"), | 295 new ListManager(E("groups"), |
| 296 E("groupTemplate"), | 296 E("groupTemplate"), |
| 297 function(s) s instanceof SpecialSubscription, | 297 function(s) s instanceof SpecialSubscription, |
| 298 SubscriptionActions.updateCommands); | 298 SubscriptionActions.updateCommands); |
| 299 E("acceptableAds").checked = FilterStorage.subscriptions.some(function(s) s.ur
l == Prefs.subscriptions_exceptionsurl); | 299 E("acceptableAds").checked = FilterStorage.subscriptions.some(function(s) s.ur
l == Prefs.subscriptions_exceptionsurl); |
| 300 E("acceptableAds").parentNode.hidden = !ListManager.acceptableAdsCheckbox; | 300 E("acceptableAds").parentNode.hidden = !ListManager.acceptableAdsCheckbox; |
| 301 E("useElementHiding").checked = Prefs.element_hiding_enabled; |
| 301 }; | 302 }; |
| 302 | 303 |
| 303 /** | 304 /** |
| 304 * Defines whether the "acceptable ads" subscription needs special treatment. | 305 * Defines whether the "acceptable ads" subscription needs special treatment. |
| 305 * @type Boolean | 306 * @type Boolean |
| 306 */ | 307 */ |
| 307 ListManager.acceptableAdsCheckbox = Prefs.subscriptions_exceptionscheckbox; | 308 ListManager.acceptableAdsCheckbox = Prefs.subscriptions_exceptionscheckbox; |
| 308 | 309 |
| 309 /** | 310 /** |
| 310 * Adds or removes filter subscription allowing acceptable ads. | 311 * Adds or removes filter subscription allowing acceptable ads. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 321 { | 322 { |
| 322 FilterStorage.addSubscription(subscription); | 323 FilterStorage.addSubscription(subscription); |
| 323 if (subscription instanceof DownloadableSubscription && !subscription.lastDo
wnload) | 324 if (subscription instanceof DownloadableSubscription && !subscription.lastDo
wnload) |
| 324 Synchronizer.execute(subscription); | 325 Synchronizer.execute(subscription); |
| 325 } | 326 } |
| 326 else | 327 else |
| 327 FilterStorage.removeSubscription(subscription); | 328 FilterStorage.removeSubscription(subscription); |
| 328 }; | 329 }; |
| 329 | 330 |
| 330 window.addEventListener("load", ListManager.init, false); | 331 window.addEventListener("load", ListManager.init, false); |
| OLD | NEW |