OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <http://adblockplus.org/>, | 2 * This file is part of Adblock Plus <http://adblockplus.org/>, |
3 * Copyright (C) 2006-2014 Eyeo GmbH | 3 * Copyright (C) 2006-2014 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 */ | 169 */ |
170 _onChange: function(action, item, param1, param2) | 170 _onChange: function(action, item, param1, param2) |
171 { | 171 { |
172 if ((action == "subscription.added" || action == "subscription.removed") &&
item.url == Prefs.subscriptions_exceptionsurl) | 172 if ((action == "subscription.added" || action == "subscription.removed") &&
item.url == Prefs.subscriptions_exceptionsurl) |
173 E("acceptableAds").checked = FilterStorage.subscriptions.some(function(s)
s.url == Prefs.subscriptions_exceptionsurl); | 173 E("acceptableAds").checked = FilterStorage.subscriptions.some(function(s)
s.url == Prefs.subscriptions_exceptionsurl); |
174 | 174 |
175 if (action == "filter.disabled") | 175 if (action == "filter.disabled") |
176 { | 176 { |
177 if (this._scheduledUpdateDisabled == null) | 177 if (this._scheduledUpdateDisabled == null) |
178 { | 178 { |
179 this._scheduledUpdateDisabled = {__proto__: null}; | 179 this._scheduledUpdateDisabled = Object.create(null); |
180 Utils.runAsync(this.updateDisabled, this); | 180 Utils.runAsync(this.updateDisabled, this); |
181 } | 181 } |
182 for (let i = 0; i < item.subscriptions.length; i++) | 182 for (let i = 0; i < item.subscriptions.length; i++) |
183 this._scheduledUpdateDisabled[item.subscriptions[i].url] = true; | 183 this._scheduledUpdateDisabled[item.subscriptions[i].url] = true; |
184 return; | 184 return; |
185 } | 185 } |
186 | 186 |
187 if (action != "load" && !this._filter(item)) | 187 if (action != "load" && !this._filter(item)) |
188 return; | 188 return; |
189 | 189 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 } | 266 } |
267 case "subscription.fixedTitle": | 267 case "subscription.fixedTitle": |
268 { | 268 { |
269 SubscriptionActions.updateCommands(); | 269 SubscriptionActions.updateCommands(); |
270 break; | 270 break; |
271 } | 271 } |
272 case "subscription.updated": | 272 case "subscription.updated": |
273 { | 273 { |
274 if (this._scheduledUpdateDisabled == null) | 274 if (this._scheduledUpdateDisabled == null) |
275 { | 275 { |
276 this._scheduledUpdateDisabled = {__proto__: null}; | 276 this._scheduledUpdateDisabled = Object.create(null); |
277 Utils.runAsync(this.updateDisabled, this); | 277 Utils.runAsync(this.updateDisabled, this); |
278 } | 278 } |
279 this._scheduledUpdateDisabled[item.url] = true; | 279 this._scheduledUpdateDisabled[item.url] = true; |
280 break; | 280 break; |
281 } | 281 } |
282 } | 282 } |
283 } | 283 } |
284 }; | 284 }; |
285 | 285 |
286 /** | 286 /** |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 { | 321 { |
322 FilterStorage.addSubscription(subscription); | 322 FilterStorage.addSubscription(subscription); |
323 if (subscription instanceof DownloadableSubscription && !subscription.lastDo
wnload) | 323 if (subscription instanceof DownloadableSubscription && !subscription.lastDo
wnload) |
324 Synchronizer.execute(subscription); | 324 Synchronizer.execute(subscription); |
325 } | 325 } |
326 else | 326 else |
327 FilterStorage.removeSubscription(subscription); | 327 FilterStorage.removeSubscription(subscription); |
328 }; | 328 }; |
329 | 329 |
330 window.addEventListener("load", ListManager.init, false); | 330 window.addEventListener("load", ListManager.init, false); |
OLD | NEW |