Index: chrome/content/ui/filters-subscriptionview.js |
=================================================================== |
--- a/chrome/content/ui/filters-subscriptionview.js |
+++ b/chrome/content/ui/filters-subscriptionview.js |
@@ -108,17 +108,18 @@ ListManager.prototype = |
if (subscription.filters[i] instanceof ActiveFilter && subscription.filters[i].disabled) |
disabledFilters++; |
let node = Templater.process(this._template, { |
__proto__: null, |
subscription: subscription, |
isExternal: subscription instanceof ExternalSubscription, |
downloading: Synchronizer.isExecuting(subscription.url), |
- disabledFilters: disabledFilters |
+ disabledFilters: disabledFilters, |
+ upgradeRequired: ListManager.isUpgradeRequired(subscription) |
}); |
if (insertBefore) |
this._list.insertBefore(node, insertBefore); |
else |
this._list.appendChild(node); |
return node; |
}, |
@@ -247,17 +248,19 @@ ListManager.prototype = |
case "subscription.disabled": |
case "subscription.homepage": |
case "subscription.lastDownload": |
case "subscription.downloadStatus": |
{ |
let subscriptionNode = Templater.getNodeForData(this._list, "subscription", item); |
if (subscriptionNode) |
{ |
- Templater.getDataForNode(subscriptionNode).downloading = Synchronizer.isExecuting(item.url); |
+ let data = Templater.getDataForNode(subscriptionNode); |
+ data.downloading = Synchronizer.isExecuting(item.url); |
+ data.upgradeRequired = ListManager.isUpgradeRequired(item); |
Templater.update(this._template, subscriptionNode); |
if (!document.commandDispatcher.focusedElement) |
this._list.focus(); |
this._listener(); |
} |
break; |
} |
@@ -319,9 +322,24 @@ ListManager.allowAcceptableAds = functio |
FilterStorage.addSubscription(subscription); |
if (subscription instanceof DownloadableSubscription && !subscription.lastDownload) |
Synchronizer.execute(subscription); |
} |
else |
FilterStorage.removeSubscription(subscription); |
}; |
+/** |
+ * Checks whether Adblock Plus needs to be upgraded in order to support filters |
+ * in a particular subscription. |
+ */ |
+ListManager.isUpgradeRequired = function(/**Subscription*/ subscription) |
+{ |
+ if (subscription instanceof DownloadableSubscription && subscription.requiredVersion) |
+ { |
+ let {addonVersion} = require("info"); |
+ if (Services.vc.compare(subscription.requiredVersion, addonVersion) > 0) |
+ return true; |
+ } |
+ return false; |
+}; |
+ |
window.addEventListener("load", ListManager.init, false); |