Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: chrome/content/ui/filters-subscriptionview.js

Issue 29338626: Issue 3835 - Update dependency on adblockpluscore to revision 2d4888611240 (Closed)
Patch Set: Fixed updateRequired replacement Created March 19, 2016, 6:57 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/content/ui/filters-subscriptionactions.js ('k') | chrome/content/ui/sendReport.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « chrome/content/ui/filters-subscriptionactions.js ('k') | chrome/content/ui/sendReport.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld