 Issue 29339387:
  Issue 3890 - Fix "Downloading..." indication for subscriptions on the options page  (Closed)
    
  
    Issue 29339387:
  Issue 3890 - Fix "Downloading..." indication for subscriptions on the options page  (Closed) 
  | Left: | ||
| Right: | 
| LEFT | RIGHT | 
|---|---|
| 1 /* | 1 /* | 
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 
| 3 * Copyright (C) 2006-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 Eyeo GmbH | 
| 4 * | 4 * | 
| 5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify | 
| 6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as | 
| 7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. | 
| 8 * | 8 * | 
| 9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, | 
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 406 } | 406 } | 
| 407 for (var i in collections) | 407 for (var i in collections) | 
| 408 collections[i].updateItem(subscription); | 408 collections[i].updateItem(subscription); | 
| 409 } | 409 } | 
| 410 } | 410 } | 
| 411 | 411 | 
| 412 if (!Object.observe) | 412 if (!Object.observe) | 
| 413 { | 413 { | 
| 414 Object.keys(subscription).forEach(function(property) | 414 Object.keys(subscription).forEach(function(property) | 
| 415 { | 415 { | 
| 416 var value = subscription[property]; | 416 var value = subscription[property]; | 
| 
Thomas Greiner
2016/04/06 14:19:43
Well spotted.
 | |
| 417 Object.defineProperty(subscription, property, | 417 Object.defineProperty(subscription, property, | 
| 418 { | 418 { | 
| 419 get: function() | 419 get: function() | 
| 420 { | 420 { | 
| 421 return value; | 421 return value; | 
| 422 }, | 422 }, | 
| 423 set: function(newValue) | 423 set: function(newValue) | 
| 424 { | 424 { | 
| 425 if (value != newValue) | 425 if (value != newValue) | 
| 426 { | 426 { | 
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 904 { | 904 { | 
| 905 var customFilterItems = collections.customFilters.items; | 905 var customFilterItems = collections.customFilters.items; | 
| 906 var filterTexts = []; | 906 var filterTexts = []; | 
| 907 for (var i = 0; i < customFilterItems.length; i++) | 907 for (var i = 0; i < customFilterItems.length; i++) | 
| 908 filterTexts.push(customFilterItems[i].text); | 908 filterTexts.push(customFilterItems[i].text); | 
| 909 E("custom-filters-raw").value = filterTexts.join("\n"); | 909 E("custom-filters-raw").value = filterTexts.join("\n"); | 
| 910 } | 910 } | 
| 911 | 911 | 
| 912 function getAcceptableAdsURL(callback) | 912 function getAcceptableAdsURL(callback) | 
| 913 { | 913 { | 
| 914 getPref("subscriptions_exceptionsurl", callback); | 914 getPref("subscriptions_exceptionsurl", function(value) | 
| 
Sebastian Noack
2016/04/06 17:22:23
Please ignore this change. It's not part of this p
 | |
| 915 { | |
| 916 getAcceptableAdsURL = function(callback) | |
| 917 { | |
| 918 callback(value); | |
| 919 }; | |
| 920 getAcceptableAdsURL(callback); | |
| 921 }); | |
| 915 } | 922 } | 
| 916 | 923 | 
| 917 function addEnableSubscription(url, title, homepage) | 924 function addEnableSubscription(url, title, homepage) | 
| 918 { | 925 { | 
| 919 var messageType = null; | 926 var messageType = null; | 
| 920 var knownSubscription = subscriptionsMap[url]; | 927 var knownSubscription = subscriptionsMap[url]; | 
| 921 if (knownSubscription && knownSubscription.disabled == true) | 928 if (knownSubscription && knownSubscription.disabled == true) | 
| 922 messageType = "subscriptions.toggle" | 929 messageType = "subscriptions.toggle" | 
| 923 else | 930 else | 
| 924 messageType = "subscriptions.add" | 931 messageType = "subscriptions.add" | 
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1163 }); | 1170 }); | 
| 1164 ext.backgroundPage.sendMessage( | 1171 ext.backgroundPage.sendMessage( | 
| 1165 { | 1172 { | 
| 1166 type: "subscriptions.listen", | 1173 type: "subscriptions.listen", | 
| 1167 filter: ["added", "disabled", "homepage", "lastDownload", "removed", | 1174 filter: ["added", "disabled", "homepage", "lastDownload", "removed", | 
| 1168 "title", "downloadStatus", "downloading"] | 1175 "title", "downloadStatus", "downloading"] | 
| 1169 }); | 1176 }); | 
| 1170 | 1177 | 
| 1171 window.addEventListener("DOMContentLoaded", onDOMLoaded, false); | 1178 window.addEventListener("DOMContentLoaded", onDOMLoaded, false); | 
| 1172 })(); | 1179 })(); | 
| LEFT | RIGHT |