| Left: | ||
| Right: |
| LEFT | RIGHT |
|---|---|
| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 106 let disabledFilters = 0; | 106 let disabledFilters = 0; |
| 107 for (let i = 0, l = subscription.filters.length; i < l; i++) | 107 for (let i = 0, l = subscription.filters.length; i < l; i++) |
| 108 if (subscription.filters[i] instanceof ActiveFilter && subscription.filter s[i].disabled) | 108 if (subscription.filters[i] instanceof ActiveFilter && subscription.filter s[i].disabled) |
| 109 disabledFilters++; | 109 disabledFilters++; |
| 110 | 110 |
| 111 let node = Templater.process(this._template, { | 111 let node = Templater.process(this._template, { |
| 112 __proto__: null, | 112 __proto__: null, |
| 113 subscription: subscription, | 113 subscription: subscription, |
| 114 isExternal: subscription instanceof ExternalSubscription, | 114 isExternal: subscription instanceof ExternalSubscription, |
| 115 downloading: Synchronizer.isExecuting(subscription.url), | 115 downloading: Synchronizer.isExecuting(subscription.url), |
| 116 disabledFilters: disabledFilters | 116 disabledFilters: disabledFilters, |
| 117 upgradeRequired: ListManager.isUpgradeRequired(subscription) | |
| 117 }); | 118 }); |
| 118 if (insertBefore) | 119 if (insertBefore) |
| 119 this._list.insertBefore(node, insertBefore); | 120 this._list.insertBefore(node, insertBefore); |
| 120 else | 121 else |
| 121 this._list.appendChild(node); | 122 this._list.appendChild(node); |
| 122 return node; | 123 return node; |
| 123 }, | 124 }, |
| 124 | 125 |
| 125 /** | 126 /** |
| 126 * Map indicating subscriptions that need their "disabledFilters" property to | 127 * Map indicating subscriptions that need their "disabledFilters" property to |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 245 } | 246 } |
| 246 case "subscription.title": | 247 case "subscription.title": |
| 247 case "subscription.disabled": | 248 case "subscription.disabled": |
| 248 case "subscription.homepage": | 249 case "subscription.homepage": |
| 249 case "subscription.lastDownload": | 250 case "subscription.lastDownload": |
| 250 case "subscription.downloadStatus": | 251 case "subscription.downloadStatus": |
| 251 { | 252 { |
| 252 let subscriptionNode = Templater.getNodeForData(this._list, "subscriptio n", item); | 253 let subscriptionNode = Templater.getNodeForData(this._list, "subscriptio n", item); |
| 253 if (subscriptionNode) | 254 if (subscriptionNode) |
| 254 { | 255 { |
| 255 Templater.getDataForNode(subscriptionNode).downloading = Synchronizer. isExecuting(item.url); | 256 let data = Templater.getDataForNode(subscriptionNode); |
| 257 data.downloading = Synchronizer.isExecuting(item.url); | |
| 258 data.upgradeRequired = ListManager.isUpgradeRequired(item); | |
| 256 Templater.update(this._template, subscriptionNode); | 259 Templater.update(this._template, subscriptionNode); |
| 257 | 260 |
| 258 if (!document.commandDispatcher.focusedElement) | 261 if (!document.commandDispatcher.focusedElement) |
| 259 this._list.focus(); | 262 this._list.focus(); |
| 260 this._listener(); | 263 this._listener(); |
| 261 } | 264 } |
| 262 break; | 265 break; |
| 263 } | 266 } |
| 264 case "subscription.fixedTitle": | 267 case "subscription.fixedTitle": |
| 265 { | 268 { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 321 Synchronizer.execute(subscription); | 324 Synchronizer.execute(subscription); |
| 322 } | 325 } |
| 323 else | 326 else |
| 324 FilterStorage.removeSubscription(subscription); | 327 FilterStorage.removeSubscription(subscription); |
| 325 }; | 328 }; |
| 326 | 329 |
| 327 /** | 330 /** |
| 328 * Checks whether Adblock Plus needs to be upgraded in order to support filters | 331 * Checks whether Adblock Plus needs to be upgraded in order to support filters |
| 329 * in a particular subscription. | 332 * in a particular subscription. |
| 330 */ | 333 */ |
| 331 ListManager.isUpgradeRequired = function(/**Subscription*/ subscription) | 334 ListManager.isUpgradeRequired = function(/**Subscription*/ subscription) |
|
Thomas Greiner
2016/03/18 16:43:22
Where is this being used? In filters.xul (line 249
Wladimir Palant
2016/03/19 18:59:13
Ouch, not sure what happened here - part of the pa
| |
| 332 { | 335 { |
| 333 if (subscription instanceof DownloadableSubscription && subscription.requiredV ersion) | 336 if (subscription instanceof DownloadableSubscription && subscription.requiredV ersion) |
| 334 { | 337 { |
| 335 let {addonVersion} = require("info"); | 338 let {addonVersion} = require("info"); |
| 336 if (Services.vc.compare(subscription.requiredVersion, addonVersion) > 0) | 339 if (Services.vc.compare(subscription.requiredVersion, addonVersion) > 0) |
| 337 return true; | 340 return true; |
| 338 } | 341 } |
| 339 return false; | 342 return false; |
| 340 }; | 343 }; |
| 341 | 344 |
| 342 window.addEventListener("load", ListManager.init, false); | 345 window.addEventListener("load", ListManager.init, false); |
| LEFT | RIGHT |