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

Delta Between Two Patch Sets: chrome/content/ui/composer.js

Issue 29329450: Issue 3208 - Don`t use numerical content types outside nsIContentPolicy.shouldLoad (Closed)
Left Patch Set: Created Oct. 29, 2015, 12:23 p.m.
Right Patch Set: Removed unrelated change Created Nov. 4, 2015, 9:27 a.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 | « no previous file | lib/contentPolicy.js » ('j') | 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-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
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17 17
18 var nodes = null; 18 var nodes = null;
19 var item = null; 19 var item = null;
20 var advancedMode = false; 20 var advancedMode = false;
Thomas Greiner 2015/11/02 18:54:36 How is this change related to the issue?
Wladimir Palant 2015/11/03 11:26:49 It is only related to testing here. We have an eve
Thomas Greiner 2015/11/03 11:54:54 I see. In that case fine to fix it separately.
Wladimir Palant 2015/11/04 09:30:41 Ok, I removed that change here and created https:/
21 21
22 function init() 22 function init()
23 { 23 {
24 [nodes, item] = window.arguments; 24 [nodes, item] = window.arguments;
25 25
26 E("filterType").value = (!item.filter || item.filter.disabled || item.filter i nstanceof WhitelistFilter ? "filterlist" : "whitelist"); 26 E("filterType").value = (!item.filter || item.filter.disabled || item.filter i nstanceof WhitelistFilter ? "filterlist" : "whitelist");
27 E("customPattern").value = item.location; 27 E("customPattern").value = item.location;
28 28
29 let insertionPoint = E("customPatternBox"); 29 let insertionPoint = E("customPatternBox");
30 let addSuggestion = function(address) 30 let addSuggestion = function(address)
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 addSuggestion(item.location); 113 addSuggestion(item.location);
114 E("patternGroup").value = ""; 114 E("patternGroup").value = "";
115 } 115 }
116 if (Prefs.composer_default == 0) 116 if (Prefs.composer_default == 0)
117 E("customPattern").focus(); 117 E("customPattern").focus();
118 else 118 else
119 E("patternGroup").focus(); 119 E("patternGroup").focus();
120 120
121 let types = []; 121 let types = [];
122 for (let type of Policy.localizedDescr.keys()) 122 for (let type of Policy.localizedDescr.keys())
123 types.push(type); 123 types.push(type);
Thomas Greiner 2015/11/02 18:54:36 Detail: What about writing `let types = Array.from
Wladimir Palant 2015/11/03 11:26:49 Nice one, I didn't know about Array.from() yet. Ho
Thomas Greiner 2015/11/03 11:54:54 I agree that, with that change in mind, it's not n
124 types.sort(); 124 types.sort();
125 125
126 let docDomain = item.docDomain; 126 let docDomain = item.docDomain;
127 let thirdParty = item.thirdParty; 127 let thirdParty = item.thirdParty;
128 128
129 if (docDomain) 129 if (docDomain)
130 docDomain = docDomain.replace(/^www\./i, "").replace(/\.+$/, ""); 130 docDomain = docDomain.replace(/^www\./i, "").replace(/\.+$/, "");
131 if (docDomain) 131 if (docDomain)
132 E("domainRestriction").value = docDomain; 132 E("domainRestriction").value = docDomain;
133 133
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 * Selects or unselects all type checkboxes except those 394 * Selects or unselects all type checkboxes except those
395 * that are disabled. 395 * that are disabled.
396 */ 396 */
397 function selectAllTypes(/**Boolean*/ select) 397 function selectAllTypes(/**Boolean*/ select)
398 { 398 {
399 for (let typeNode = E("typeGroup").firstChild; typeNode; typeNode = typeNode.n extSibling) 399 for (let typeNode = E("typeGroup").firstChild; typeNode; typeNode = typeNode.n extSibling)
400 if (typeNode.getAttribute("disabled") != "true") 400 if (typeNode.getAttribute("disabled") != "true")
401 typeNode.checked = select; 401 typeNode.checked = select;
402 updateFilter(); 402 updateFilter();
403 } 403 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld