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

Delta Between Two Patch Sets: new-options.js

Issue 29445590: Issue 5255 - Advanced tab (HTML, strings and functionality) (Closed)
Left Patch Set: Addressed Thomas comments Created July 14, 2017, 5:09 p.m.
Right Patch Set: Fixed nits Created July 14, 2017, 5:43 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 | « new-options.html ('k') | skin/new-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-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 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 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 else 533 else
534 location.href = link; 534 location.href = link;
535 }); 535 });
536 } 536 }
537 537
538 function switchTab(id) 538 function switchTab(id)
539 { 539 {
540 location.hash = id; 540 location.hash = id;
541 } 541 }
542 542
543 function execAction(action, element, event) 543 function execAction(action, element)
Thomas Greiner 2017/07/14 17:36:12 Detail: `event` is not being used anymore so pleas
saroyanm 2017/07/14 17:45:09 Done.
544 { 544 {
545 switch (action) 545 switch (action)
546 { 546 {
547 case "add-domain-exception": 547 case "add-domain-exception":
548 addWhitelistedDomain(); 548 addWhitelistedDomain();
549 break; 549 break;
550 case "add-language-subscription": 550 case "add-language-subscription":
551 addEnableSubscription(findParentData(element, "access", false)); 551 addEnableSubscription(findParentData(element, "access", false));
552 break; 552 break;
553 case "add-predefined-subscription": { 553 case "add-predefined-subscription": {
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 if (context) 682 if (context)
683 context.classList.remove("show-context-menu"); 683 context.classList.remove("show-context-menu");
684 684
685 let actions = findParentData(e.target, "action", false); 685 let actions = findParentData(e.target, "action", false);
686 if (!actions) 686 if (!actions)
687 return; 687 return;
688 688
689 actions = actions.split(","); 689 actions = actions.split(",");
690 for (let action of actions) 690 for (let action of actions)
691 { 691 {
692 execAction(action, e.target, e); 692 execAction(action, e.target);
693 } 693 }
694 } 694 }
695 695
696 function getKey(e) 696 function getKey(e)
697 { 697 {
698 // e.keyCode has been deprecated so we attempt to use e.key 698 // e.keyCode has been deprecated so we attempt to use e.key
699 if ("key" in e) 699 if ("key" in e)
700 return e.key; 700 return e.key;
701 return getKey.keys[e.keyCode]; 701 return getKey.keys[e.keyCode];
702 } 702 }
(...skipping 26 matching lines...) Expand all
729 { 729 {
730 if (key == "ArrowLeft" || key == "ArrowUp") 730 if (key == "ArrowLeft" || key == "ArrowUp")
731 element = element.previousElementSibling || container.lastElementChild; 731 element = element.previousElementSibling || container.lastElementChild;
732 else if (key == "ArrowRight" || key == "ArrowDown") 732 else if (key == "ArrowRight" || key == "ArrowDown")
733 element = element.nextElementSibling || container.firstElementChild; 733 element = element.nextElementSibling || container.firstElementChild;
734 } 734 }
735 735
736 let actions = container.getAttribute("data-action").split(","); 736 let actions = container.getAttribute("data-action").split(",");
737 for (let action of actions) 737 for (let action of actions)
738 { 738 {
739 execAction(action, element, e); 739 execAction(action, element);
740 } 740 }
741 } 741 }
742 742
743 function selectTabItem(tabId, container, focus) 743 function selectTabItem(tabId, container, focus)
744 { 744 {
745 // Show tab content 745 // Show tab content
746 document.body.setAttribute("data-tab", tabId); 746 document.body.setAttribute("data-tab", tabId);
747 747
748 // Select tab 748 // Select tab
749 let tabList = container.querySelector("[role='tablist']"); 749 let tabList = container.querySelector("[role='tablist']");
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
1355 }); 1355 });
1356 ext.backgroundPage.sendMessage({ 1356 ext.backgroundPage.sendMessage({
1357 type: "subscriptions.listen", 1357 type: "subscriptions.listen",
1358 filter: ["added", "disabled", "homepage", "lastDownload", "removed", 1358 filter: ["added", "disabled", "homepage", "lastDownload", "removed",
1359 "title", "downloadStatus", "downloading"] 1359 "title", "downloadStatus", "downloading"]
1360 }); 1360 });
1361 1361
1362 window.addEventListener("DOMContentLoaded", onDOMLoaded, false); 1362 window.addEventListener("DOMContentLoaded", onDOMLoaded, false);
1363 window.addEventListener("hashchange", onHashChange, false); 1363 window.addEventListener("hashchange", onHashChange, false);
1364 } 1364 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld