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

Side by Side Diff: options.js

Issue 29327244: Issue 3024 - Added opt-out to Chrome notifications (Closed)
Patch Set: Fixed documentation of shouldDisplay function Created Sept. 11, 2015, 1:54 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« lib/notificationHelper.js ('K') | « options.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 101
102 // Show user's filters 102 // Show user's filters
103 reloadFilters(); 103 reloadFilters();
104 } 104 }
105 $(loadOptions); 105 $(loadOptions);
106 106
107 function onMessage(msg) 107 function onMessage(msg)
108 { 108 {
109 if (msg.type == "add-subscription") 109 if (msg.type == "add-subscription")
110 startSubscriptionSelection(msg.title, msg.url); 110 startSubscriptionSelection(msg.title, msg.url);
111 else if (msg.type == "focus-section")
112 {
113 var tabs = document.getElementsByClassName("ui-tabs-panel");
114 for (var i = 0; i < tabs.length; i++)
115 {
116 var found = tabs[i].querySelector("[data-section='" + msg.section + "']");
117 if (!found)
118 continue;
119
120 var previous = document.getElementsByClassName("focused");
121 if (previous.length > 0)
122 previous[0].classList.remove("focused");
123
124 var tab = $("[href='#" + tabs[i].id + "']");
125 $("#tabs").tabs("select", tab.parent().index());
126 found.classList.add("focused");
127 }
128 }
111 }; 129 };
112 130
113 // Reloads the displayed subscriptions and filters 131 // Reloads the displayed subscriptions and filters
114 function reloadFilters() 132 function reloadFilters()
115 { 133 {
116 // Load user filter URLs 134 // Load user filter URLs
117 var container = document.getElementById("filterLists"); 135 var container = document.getElementById("filterLists");
118 while (container.lastChild) 136 while (container.lastChild)
119 container.removeChild(container.lastChild); 137 container.removeChild(container.lastChild);
120 138
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 links[i].href = arguments[i + 1]; 682 links[i].href = arguments[i + 1];
665 links[i].setAttribute("target", "_blank"); 683 links[i].setAttribute("target", "_blank");
666 } 684 }
667 else if (typeof arguments[i + 1] == "function") 685 else if (typeof arguments[i + 1] == "function")
668 { 686 {
669 links[i].href = "javascript:void(0);"; 687 links[i].href = "javascript:void(0);";
670 links[i].addEventListener("click", arguments[i + 1], false); 688 links[i].addEventListener("click", arguments[i + 1], false);
671 } 689 }
672 } 690 }
673 } 691 }
OLDNEW
« lib/notificationHelper.js ('K') | « options.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld