OLD | NEW |
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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 docDomain = docDomain.replace(/^www\./i, "").replace(/\.+$/, ""); | 139 docDomain = docDomain.replace(/^www\./i, "").replace(/\.+$/, ""); |
140 if (docDomain) | 140 if (docDomain) |
141 E("domainRestriction").value = docDomain; | 141 E("domainRestriction").value = docDomain; |
142 | 142 |
143 E("thirdParty").hidden = !thirdParty; | 143 E("thirdParty").hidden = !thirdParty; |
144 E("firstParty").hidden = thirdParty; | 144 E("firstParty").hidden = thirdParty; |
145 | 145 |
146 let typeGroup = E("typeGroup"); | 146 let typeGroup = E("typeGroup"); |
147 let defaultTypes = RegExpFilter.prototype.contentType & ~RegExpFilter.typeMap.
DOCUMENT; | 147 let defaultTypes = RegExpFilter.prototype.contentType & ~RegExpFilter.typeMap.
DOCUMENT; |
148 let isDefaultType = (RegExpFilter.typeMap[item.typeDescr] & defaultTypes) != 0
; | 148 let isDefaultType = (RegExpFilter.typeMap[item.typeDescr] & defaultTypes) != 0
; |
149 for each (let type in types) | 149 for (let type of types) |
150 { | 150 { |
151 if (type == Policy.type.ELEMHIDE) | 151 if (type == Policy.type.ELEMHIDE) |
152 continue; | 152 continue; |
153 | 153 |
154 let typeNode = document.createElement("checkbox"); | 154 let typeNode = document.createElement("checkbox"); |
155 typeNode.setAttribute("value", Policy.typeDescr[type].toLowerCase().replace(
/\_/g, "-")); | 155 typeNode.setAttribute("value", Policy.typeDescr[type].toLowerCase().replace(
/\_/g, "-")); |
156 typeNode.setAttribute("label", Policy.localizedDescr[type].toLowerCase()); | 156 typeNode.setAttribute("label", Policy.localizedDescr[type].toLowerCase()); |
157 | 157 |
158 let typeMask = RegExpFilter.typeMap[Policy.typeDescr[type]]; | 158 let typeMask = RegExpFilter.typeMap[Policy.typeDescr[type]]; |
159 typeNode._defaultType = (typeMask & defaultTypes) != 0; | 159 typeNode._defaultType = (typeMask & defaultTypes) != 0; |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 * Selects or unselects all type checkboxes except those | 403 * Selects or unselects all type checkboxes except those |
404 * that are disabled. | 404 * that are disabled. |
405 */ | 405 */ |
406 function selectAllTypes(/**Boolean*/ select) | 406 function selectAllTypes(/**Boolean*/ select) |
407 { | 407 { |
408 for (let typeNode = E("typeGroup").firstChild; typeNode; typeNode = typeNode.n
extSibling) | 408 for (let typeNode = E("typeGroup").firstChild; typeNode; typeNode = typeNode.n
extSibling) |
409 if (typeNode.getAttribute("disabled") != "true") | 409 if (typeNode.getAttribute("disabled") != "true") |
410 typeNode.checked = select; | 410 typeNode.checked = select; |
411 updateFilter(); | 411 updateFilter(); |
412 } | 412 } |
OLD | NEW |