OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <http://adblockplus.org/>, | 2 * This file is part of Adblock Plus <http://adblockplus.org/>, |
3 * Copyright (C) 2006-2013 Eyeo GmbH | 3 * Copyright (C) 2006-2013 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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 | 317 |
318 function testFilter(/**String*/ filter) /**Boolean*/ | 318 function testFilter(/**String*/ filter) /**Boolean*/ |
319 { | 319 { |
320 return RegExpFilter.fromText(filter + "$" + item.typeDescr).matches(item.loc
ation, item.typeDescr, item.docDomain, item.thirdParty); | 320 return RegExpFilter.fromText(filter + "$" + item.typeDescr).matches(item.loc
ation, item.typeDescr, item.docDomain, item.thirdParty); |
321 } | 321 } |
322 | 322 |
323 let anchorStartCheckbox = E("anchorStart"); | 323 let anchorStartCheckbox = E("anchorStart"); |
324 if (!/^\*/.test(pattern) && testFilter("||" + pattern)) | 324 if (!/^\*/.test(pattern) && testFilter("||" + pattern)) |
325 { | 325 { |
326 disableElement(anchorStartCheckbox, false, "checked", false); | 326 disableElement(anchorStartCheckbox, false, "checked", false); |
327 anchorStartCheckbox.setAttribute("label", anchorStartCheckbox.getAttribute("
labelFlexible")); | 327 [anchorStartCheckbox.label, anchorStartCheckbox.accessKey] = Utils.splitLabe
l(anchorStartCheckbox.getAttribute("labelFlexible")); |
328 anchorStartCheckbox.accessKey = anchorStartCheckbox.getAttribute("accesskey
Flexible"); | |
329 anchorStartCheckbox.flexibleAnchor = true; | 328 anchorStartCheckbox.flexibleAnchor = true; |
330 } | 329 } |
331 else | 330 else |
332 { | 331 { |
333 disableElement(anchorStartCheckbox, /^\*/.test(pattern) || !testFilter("|" +
pattern), "checked", false); | 332 disableElement(anchorStartCheckbox, /^\*/.test(pattern) || !testFilter("|" +
pattern), "checked", false); |
334 anchorStartCheckbox.setAttribute("label", anchorStartCheckbox.getAttribute("
labelRegular")); | 333 [anchorStartCheckbox.label, anchorStartCheckbox.accessKey] = Utils.splitLabe
l(anchorStartCheckbox.getAttribute("labelRegular")); |
335 anchorStartCheckbox.accessKey = anchorStartCheckbox.getAttribute("accesskeyR
egular"); | |
336 anchorStartCheckbox.flexibleAnchor = false; | 334 anchorStartCheckbox.flexibleAnchor = false; |
337 } | 335 } |
338 disableElement(E("anchorEnd"), /[\*\^]$/.test(pattern) || !testFilter(pattern
+ "|"), "checked", false); | 336 disableElement(E("anchorEnd"), /[\*\^]$/.test(pattern) || !testFilter(pattern
+ "|"), "checked", false); |
339 | 337 |
340 updateFilter(); | 338 updateFilter(); |
341 setAdvancedMode(document.documentElement.getAttribute("advancedMode") == "true
"); | 339 setAdvancedMode(document.documentElement.getAttribute("advancedMode") == "true
"); |
342 } | 340 } |
343 | 341 |
344 function updateCustomPattern() | 342 function updateCustomPattern() |
345 { | 343 { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 * Selects or unselects all type checkboxes except those | 402 * Selects or unselects all type checkboxes except those |
405 * that are disabled. | 403 * that are disabled. |
406 */ | 404 */ |
407 function selectAllTypes(/**Boolean*/ select) | 405 function selectAllTypes(/**Boolean*/ select) |
408 { | 406 { |
409 for (let typeNode = E("typeGroup").firstChild; typeNode; typeNode = typeNode.n
extSibling) | 407 for (let typeNode = E("typeGroup").firstChild; typeNode; typeNode = typeNode.n
extSibling) |
410 if (typeNode.getAttribute("disabled") != "true") | 408 if (typeNode.getAttribute("disabled") != "true") |
411 typeNode.checked = select; | 409 typeNode.checked = select; |
412 updateFilter(); | 410 updateFilter(); |
413 } | 411 } |
OLD | NEW |