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

Unified Diff: background.js

Issue 29333819: Issue 2375 - Implement "Blocking lists" section in new options page (Closed)
Patch Set: Small fixes and improved download messages for filter lists Created Feb. 3, 2016, 5:41 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 | « README.md ('k') | i18n.js » ('j') | options.html » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 = 0;
+ 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,16 @@
};
modules.synchronizer = {
- Synchronizer: {}
+ Synchronizer: {
+ execute: function(subscription, manual)
+ {
+ subscription.lastDownload = 0;
+ setTimeout(function()
+ {
+ subscription.lastDownload = Date.now() / 1000;
+ }, 500);
+ }
+ }
};
modules.matcher = {
@@ -283,7 +311,10 @@
];
var knownSubscriptions = Object.create(null);
for (var subscriptionUrl of subscriptions)
+ {
knownSubscriptions[subscriptionUrl] = modules.subscriptionClasses.Subscription.fromURL(subscriptionUrl);
+ knownSubscriptions[subscriptionUrl].lastDownload = 1234;
Thomas Greiner 2016/02/04 15:28:16 This will trigger the "subscriptions.lastDownload"
saroyanm 2016/02/04 17:50:06 Done.
+ }
var customSubscription = knownSubscriptions["~user~786254"];
global.seenDataCorruption = params.seenDataCorruption;
« no previous file with comments | « README.md ('k') | i18n.js » ('j') | options.html » ('J')

Powered by Google App Engine
This is Rietveld