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

Delta Between Two Patch Sets: options.js

Issue 29339387: Issue 3890 - Fix "Downloading..." indication for subscriptions on the options page (Closed)
Left Patch Set: Created April 5, 2016, 5:26 p.m.
Right Patch Set: Pass URL to Synchronizer.isExecuting() Created April 6, 2016, 5:20 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « messageResponder.js ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 } 404 }
405 } 405 }
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)
Sebastian Noack 2016/04/05 18:38:49 We would have to add "isDownloading" and "download
415 { 415 {
416 var value = subscription[property]; 416 var value = subscription[property];
Sebastian Noack 2016/04/05 18:38:49 This is unrelated, but why using a prefixed key, i
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
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
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 })();
LEFTRIGHT

Powered by Google App Engine
This is Rietveld