Index: lib/api.js |
diff --git a/lib/api.js b/lib/api.js |
index ca656b898f6680637d15e84a030a5c8b02986738..bc6803b34575cb0ae99167b053de748e3f7299c9 100644 |
--- a/lib/api.js |
+++ b/lib/api.js |
@@ -137,6 +137,36 @@ var API = (function() |
return result; |
}, |
+ isAASubscription: function(subscription) |
+ { |
+ return subscription.url == Prefs.subscriptions_exceptionsurl; |
+ }, |
+ |
+ setAASubscriptionEnabled: function(enabled) |
+ { |
+ var aaSubscription = FilterStorage.subscriptions.find(API.isAASubscription); |
+ if (!enabled) |
+ { |
+ if (aaSubscription && !aaSubscription.disabled) |
+ aaSubscription.disabled = true; |
+ return; |
+ } |
+ if (!aaSubscription) { |
hub
2017/03/17 20:04:15
'nit: new line before the {
sergei
2017/03/17 22:10:06
Done.
|
+ aaSubscription = Subscription.fromURL(Prefs.subscriptions_exceptionsurl); |
+ FilterStorage.addSubscription(aaSubscription); |
+ } |
+ if (aaSubscription.disabled) |
+ aaSubscription.disabled = false; |
+ if (!aaSubscription.lastDownload) |
+ Synchronizer.execute(aaSubscription); |
+ }, |
+ |
+ isAASubscriptionEnabled: function() |
+ { |
+ var aaSubscription = FilterStorage.subscriptions.find(API.isAASubscription); |
+ return aaSubscription && !aaSubscription.disabled; |
+ }, |
+ |
showNextNotification: function(url) |
{ |
Notification.showNext(url); |
@@ -181,7 +211,7 @@ var API = (function() |
getHostFromUrl: function(url) |
{ |
- return extractHostFromURL(url); |
+ return extractHostFromURL(url); |
}, |
compareVersions: function(v1, v2) |