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

Unified Diff: messageResponder.js

Issue 29333819: Issue 2375 - Implement "Blocking lists" section in new options page (Closed)
Patch Set: Created Jan. 18, 2016, 9:50 a.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
Index: messageResponder.js
===================================================================
--- a/messageResponder.js
+++ b/messageResponder.js
@@ -47,7 +47,7 @@
}
var convertSubscription = convertObject.bind(null, ["disabled",
- "downloadStatus", "homepage", "lastSuccess", "title", "url"]);
+ "downloadStatus", "lastDownload", "homepage", "lastSuccess", "title", "url"]);
Thomas Greiner 2016/01/19 11:27:27 Do we want "lastDownload", "lastSuccess" or both?
Thomas Greiner 2016/01/19 11:27:27 Detail: What about keeping it alphabetically order
saroyanm 2016/01/22 09:55:05 Done.
saroyanm 2016/01/22 09:55:06 In current option page, seems like we are using la
Thomas Greiner 2016/01/25 15:40:27 There's already a ticket requesting for this infor
saroyanm 2016/01/26 18:36:14 Acknowledged.
var convertFilter = convertObject.bind(null, ["text"]);
var changeListeners = null;
@@ -333,8 +333,17 @@
break;
case "subscriptions.toggle":
var subscription = Subscription.fromURL(message.url);
- if (subscription.url in FilterStorage.knownSubscriptions && !subscription.disabled)
- FilterStorage.removeSubscription(subscription);
+ if (subscription.url in FilterStorage.knownSubscriptions)
+ {
+ if (subscription.disabled)
+ {
+ subscription.disabled = !subscription.disabled;
+ FilterNotifier.triggerListeners("subscription.disabled",
+ subscription);
+ }
+ else
+ FilterStorage.removeSubscription(subscription);
+ }
else
{
subscription.disabled = false;
@@ -345,6 +354,33 @@
Synchronizer.execute(subscription);
}
break;
+ case "subscriptions.toggleState":
Thomas Greiner 2016/01/19 11:27:27 I'd rather add this to "subscriptions.toggle" to a
saroyanm 2016/01/22 09:55:06 Done.
+ var subscription = Subscription.fromURL(message.url);
+ if (subscription.url in FilterStorage.knownSubscriptions)
+ {
+ subscription.disabled = !subscription.disabled;
+ FilterNotifier.triggerListeners("subscription.disabled",
+ subscription);
+ }
+ break;
+ case "subscriptions.updateAll":
Thomas Greiner 2016/01/19 11:27:27 Why not add this to "subscriptions.update"? If `me
saroyanm 2016/01/22 09:55:06 Done.
+ for (var i = 0; i < FilterStorage.subscriptions.length; i++)
+ {
+ var subscription = FilterStorage.subscriptions[i];
+ if (subscription instanceof DownloadableSubscription)
+ Synchronizer.execute(subscription, true);
+ }
+ break;
+ case "subscriptions.update":
+ var subscription = Subscription.fromURL(message.url);
+ if (subscription instanceof DownloadableSubscription)
+ Synchronizer.execute(subscription, true);
+ break;
+ case "subscriptions.website":
Thomas Greiner 2016/01/19 11:27:27 This belongs into "app.open". However, I'd sugges
saroyanm 2016/01/22 09:55:05 Done.
+ var subscription = Subscription.fromURL(message.url);
+ if(subscription.homepage)
+ window.open(subscription.homepage);
+ break;
}
});
})(this);

Powered by Google App Engine
This is Rietveld