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

Side by Side Diff: chrome/content/ui/sendReport.js

Issue 29333150: Issue 3461 - Fixed: Issue Reporter assumes that RequestEntry.filter is a Filter instance, not a str… (Closed)
Patch Set: Created Jan. 4, 2016, 5:46 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 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 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 817
818 for (let i = 0; i < this.needUpdate.length; i++) 818 for (let i = 0; i < this.needUpdate.length; i++)
819 if (Synchronizer.isExecuting(this.needUpdate[i].url)) 819 if (Synchronizer.isExecuting(this.needUpdate[i].url))
820 return; 820 return;
821 821
822 FilterNotifier.removeListener(listener); 822 FilterNotifier.removeListener(listener);
823 E("updateInProgress").hidden = "true"; 823 E("updateInProgress").hidden = "true";
824 824
825 let filtersRemoved = false; 825 let filtersRemoved = false;
826 let requests = requestsDataSource.origRequests; 826 let requests = requestsDataSource.origRequests;
827 for (let i = 0; i < requests.length; i++) 827 for (let i = 0; i < requests.length; i++)
Sebastian Noack 2016/01/04 18:14:52 Nit: While on it, how about using a for-of loop?
Wladimir Palant 2016/01/04 19:23:44 There is too much to be fixed in this code already
Sebastian Noack 2016/01/05 09:20:52 Fair enough.
828 if (requests[i].filter && !requests[i].filter.subscriptions.filter(s = > !s.disabled).length) 828 {
829 if (!requests[i].filter)
830 continue;
831
832 let filter = Filter.fromText(requests[i].filter);
833 if (!filter.subscriptions.filter(s => !s.disabled).length)
Sebastian Noack 2016/01/05 09:20:52 How about |filter.subscriptions.some(s => !s.disab
Wladimir Palant 2016/01/05 09:50:08 This functionality isn't exactly easy to test. But
829 filtersRemoved = true; 834 filtersRemoved = true;
835 }
830 836
831 if (filtersRemoved) 837 if (filtersRemoved)
832 { 838 {
833 // Force the user to reload the page 839 // Force the user to reload the page
834 E("updateFixedIssue").hidden = false; 840 E("updateFixedIssue").hidden = false;
835 document.documentElement.canAdvance = true; 841 document.documentElement.canAdvance = true;
836 842
837 let nextButton = document.documentElement.getButton("next"); 843 let nextButton = document.documentElement.getButton("next");
838 [nextButton.label, nextButton.accessKey] = Utils.splitLabel(E("updateP age").getAttribute("reloadButtonLabel")); 844 [nextButton.label, nextButton.accessKey] = Utils.splitLabel(E("updateP age").getAttribute("reloadButtonLabel"));
839 document.documentElement.addEventListener("wizardnext", function(event ) 845 document.documentElement.addEventListener("wizardnext", function(event )
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after
1584 1590
1585 function censorURL(url) 1591 function censorURL(url)
1586 { 1592 {
1587 return url.replace(/([?;&\/#][^?;&\/#]+?=)[^?;&\/#]+/g, "$1*"); 1593 return url.replace(/([?;&\/#][^?;&\/#]+?=)[^?;&\/#]+/g, "$1*");
1588 } 1594 }
1589 1595
1590 function encodeHTML(str) 1596 function encodeHTML(str)
1591 { 1597 {
1592 return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"). replace(/"/g, "&quot;"); 1598 return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"). replace(/"/g, "&quot;");
1593 } 1599 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld