Index: background.js |
=================================================================== |
--- a/background.js |
+++ b/background.js |
@@ -36,7 +36,8 @@ |
seenDataCorruption: false, |
filterlistsReinitialized: false, |
addSubscription: false, |
- filterError: false |
+ filterError: false, |
+ downloadStatus: "synchronize_ok" |
}; |
updateFromURL(params); |
@@ -71,7 +72,9 @@ |
this.url = url; |
this.title = "Subscription " + url; |
this.disabled = false; |
- this.lastDownload = 1234; |
+ this._lastDownload = 1234; |
+ this.homepage = "https://easylist.adblockplus.org/"; |
+ this.downloadStatus = params.downloadStatus; |
}, |
SpecialSubscription: function(url) |
@@ -83,6 +86,9 @@ |
}; |
modules.subscriptionClasses.Subscription.fromURL = function(url) |
{ |
+ if (url in knownSubscriptions) |
+ return knownSubscriptions[url]; |
+ |
if (/^https?:\/\//.test(url)) |
return new modules.subscriptionClasses.Subscription(url); |
else |
@@ -90,6 +96,19 @@ |
}; |
modules.subscriptionClasses.DownloadableSubscription = modules.subscriptionClasses.Subscription; |
+ modules.subscriptionClasses.Subscription.prototype = |
+ { |
+ get lastDownload() |
+ { |
+ return this._lastDownload; |
+ }, |
+ set lastDownload(value) |
+ { |
+ this._lastDownload = value; |
+ modules.filterNotifier.FilterNotifier.triggerListeners("subscription.lastDownload", this); |
+ } |
+ }; |
+ |
modules.filterStorage = { |
FilterStorage: { |
get subscriptions() |
@@ -184,7 +203,23 @@ |
}; |
modules.synchronizer = { |
- Synchronizer: {} |
+ Synchronizer: { |
+ downloading: false, |
Thomas Greiner
2016/02/04 20:23:46
Detail: Since this is a "private" property I'd sug
|
+ execute: function(subscription, manual) |
+ { |
+ subscription.lastDownload = 0; |
+ modules.synchronizer.Synchronizer.downloading = true; |
+ setTimeout(function() |
+ { |
+ modules.synchronizer.Synchronizer.downloading = false; |
+ subscription.lastDownload = Date.now() / 1000; |
+ }, 500); |
+ }, |
+ isExecuting: function(url) |
+ { |
+ return modules.synchronizer.Synchronizer.downloading; |
+ } |
+ } |
}; |
modules.matcher = { |
@@ -284,6 +319,7 @@ |
var knownSubscriptions = Object.create(null); |
for (var subscriptionUrl of subscriptions) |
knownSubscriptions[subscriptionUrl] = modules.subscriptionClasses.Subscription.fromURL(subscriptionUrl); |
+ |
Thomas Greiner
2016/02/04 20:23:45
Detail: This empty line has been added without tou
|
var customSubscription = knownSubscriptions["~user~786254"]; |
global.seenDataCorruption = params.seenDataCorruption; |