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-present eyeo GmbH | 3 * Copyright (C) 2006-present 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 "click", toggleEnabled, false | 115 "click", toggleEnabled, false |
116 ); | 116 ); |
117 document.getElementById("clickhide").addEventListener( | 117 document.getElementById("clickhide").addEventListener( |
118 "click", activateClickHide, false | 118 "click", activateClickHide, false |
119 ); | 119 ); |
120 document.getElementById("clickhide-cancel").addEventListener( | 120 document.getElementById("clickhide-cancel").addEventListener( |
121 "click", cancelClickHide, false | 121 "click", cancelClickHide, false |
122 ); | 122 ); |
123 document.getElementById("options").addEventListener("click", () => | 123 document.getElementById("options").addEventListener("click", () => |
124 { | 124 { |
125 ext.showOptions(window.close); | 125 chrome.runtime.sendMessage({type: "app.open", what: "options"}); |
| 126 window.close(); |
126 }, false); | 127 }, false); |
127 | 128 |
128 // Set up collapsing of menu items | 129 // Set up collapsing of menu items |
129 for (let collapser of document.getElementsByClassName("collapse")) | 130 for (let collapser of document.getElementsByClassName("collapse")) |
130 { | 131 { |
131 collapser.addEventListener("click", toggleCollapse, false); | 132 collapser.addEventListener("click", toggleCollapse, false); |
132 getPref(collapser.dataset.option, value => | 133 getPref(collapser.dataset.option, value => |
133 { | 134 { |
134 if (value) | 135 if (value) |
135 { | 136 { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 | 175 |
175 function toggleCollapse(event) | 176 function toggleCollapse(event) |
176 { | 177 { |
177 let collapser = event.currentTarget; | 178 let collapser = event.currentTarget; |
178 let collapsible = document.getElementById(collapser.dataset.collapsible); | 179 let collapsible = document.getElementById(collapser.dataset.collapsible); |
179 collapsible.classList.toggle("collapsed"); | 180 collapsible.classList.toggle("collapsed"); |
180 togglePref(collapser.dataset.option); | 181 togglePref(collapser.dataset.option); |
181 } | 182 } |
182 | 183 |
183 document.addEventListener("DOMContentLoaded", onLoad, false); | 184 document.addEventListener("DOMContentLoaded", onLoad, false); |
OLD | NEW |