Index: options.js |
diff --git a/options.js b/options.js |
index 2d01e713331036259ac4423439a4b31d600d6e64..3055baa441154856edac4c5b9f556150d27fbb6c 100644 |
--- a/options.js |
+++ b/options.js |
@@ -192,6 +192,21 @@ function loadOptions() |
} |
$(loadOptions); |
+function convertSpecialSubscription(subscription) |
+{ |
+ getFilters(subscription.url, function(filters) |
+ { |
+ for (var j = 0; j < filters.length; j++) |
+ { |
+ var filter = filters[j].text; |
+ if (whitelistedDomainRegexp.test(filter)) |
+ appendToListBox("excludedDomainsBox", RegExp.$1); |
+ else |
+ appendToListBox("userFiltersBox", filter); |
+ } |
+ }); |
+} |
+ |
// Reloads the displayed subscriptions and filters |
function reloadFilters() |
{ |
@@ -219,17 +234,7 @@ function reloadFilters() |
clearListBox("excludedDomainsBox"); |
for (var i = 0; i < subscriptions.length; i++) |
- getFilters(subscriptions[i].url, function(filters) |
- { |
- for (var j = 0; j < filters.length; j++) |
- { |
- var filter = filters[j].text; |
- if (whitelistedDomainRegexp.test(filter)) |
- appendToListBox("excludedDomainsBox", RegExp.$1); |
- else |
- appendToListBox("userFiltersBox", filter); |
- } |
- }); |
+ convertSpecialSubscription(subscriptions[i]); |
}); |
} |
@@ -469,7 +474,9 @@ function onSubscriptionMessage(action, subscription) |
updateSubscriptionInfo(element, subscription); |
break; |
case "added": |
- if (subscription.url == acceptableAdsUrl) |
+ if (subscription.url.indexOf("~user") == 0) |
kzar
2016/04/14 09:55:22
I decided to go with your approach in the end, rat
|
+ convertSpecialSubscription(subscription); |
+ else if (subscription.url == acceptableAdsUrl) |
$("#acceptableAds").prop("checked", true); |
else if (!element) |
addSubscriptionEntry(subscription); |