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

Delta Between Two Patch Sets: options.js

Issue 29321198: Issue 2376 - Implement custom filters in new options page (Closed)
Left Patch Set: Created July 14, 2015, 1:11 p.m.
Right Patch Set: Nit fixes Created July 15, 2015, 2:35 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 | « options.html ('k') | skin/options.css » ('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
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 delete document.body.dataset.dialog; 428 delete document.body.dataset.dialog;
429 }, false); 429 }, false);
430 430
431 // Advanced tab 431 // Advanced tab
432 var filterTextbox = document.querySelector("#custom-filters-add input"); 432 var filterTextbox = document.querySelector("#custom-filters-add input");
433 placeholderValue = ext.i18n.getMessage("options_customFilters_textbox_placeh older"); 433 placeholderValue = ext.i18n.getMessage("options_customFilters_textbox_placeh older");
434 filterTextbox.setAttribute("placeholder", placeholderValue); 434 filterTextbox.setAttribute("placeholder", placeholderValue);
435 function addCustomFilters() 435 function addCustomFilters()
436 { 436 {
437 var filterText = filterTextbox.value; 437 var filterText = filterTextbox.value;
438 if (!filterText)
439 return;
440
441 ext.backgroundPage.sendMessage( 438 ext.backgroundPage.sendMessage(
442 { 439 {
443 type: "filters.add", 440 type: "filters.add",
444 text: filterText 441 text: filterText
445 }); 442 });
446 filterTextbox.value = ""; 443 filterTextbox.value = "";
447 } 444 }
448 E("custom-filters-add").addEventListener("submit", function(e) 445 E("custom-filters-add").addEventListener("submit", function(e)
449 { 446 {
450 e.preventDefault(); 447 e.preventDefault();
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 filter: ["added", "loaded", "removed"] 728 filter: ["added", "loaded", "removed"]
732 }); 729 });
733 ext.backgroundPage.sendMessage( 730 ext.backgroundPage.sendMessage(
734 { 731 {
735 type: "subscriptions.listen", 732 type: "subscriptions.listen",
736 filter: ["added", "disabled", "homepage", "removed", "title"] 733 filter: ["added", "disabled", "homepage", "removed", "title"]
737 }); 734 });
738 735
739 window.addEventListener("DOMContentLoaded", onDOMLoaded, false); 736 window.addEventListener("DOMContentLoaded", onDOMLoaded, false);
740 })(); 737 })();
LEFTRIGHT

Powered by Google App Engine
This is Rietveld