| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 { | 121 { |
| 122 if (activateClickHide.timeout) | 122 if (activateClickHide.timeout) |
| 123 { | 123 { |
| 124 window.clearTimeout(activateClickHide.timeout); | 124 window.clearTimeout(activateClickHide.timeout); |
| 125 activateClickHide.timeout = null; | 125 activateClickHide.timeout = null; |
| 126 } | 126 } |
| 127 document.body.classList.remove("clickhide-active"); | 127 document.body.classList.remove("clickhide-active"); |
| 128 browser.tabs.sendMessage(tab.id, {type: "composer.content.finished"}); | 128 browser.tabs.sendMessage(tab.id, {type: "composer.content.finished"}); |
| 129 } | 129 } |
| 130 | 130 |
| 131 function reportIssue() |
| 132 { |
| 133 browser.tabs.create({ |
| 134 url: browser.runtime.getURL("/issue-reporter.html?" + tab.id) |
| 135 }); |
| 136 } |
| 137 |
| 131 function toggleCollapse(event) | 138 function toggleCollapse(event) |
| 132 { | 139 { |
| 133 let collapser = event.currentTarget; | 140 let collapser = event.currentTarget; |
| 134 let collapsible = document.getElementById(collapser.dataset.collapsible); | 141 let collapsible = document.getElementById(collapser.dataset.collapsible); |
| 135 collapsible.classList.toggle("collapsed"); | 142 collapsible.classList.toggle("collapsed"); |
| 136 togglePref(collapser.dataset.option); | 143 togglePref(collapser.dataset.option); |
| 137 } | 144 } |
| 138 | 145 |
| 139 function getDocLinks(notification) | 146 function getDocLinks(notification) |
| 140 { | 147 { |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 | 309 |
| 303 document.getElementById("enabled").addEventListener( | 310 document.getElementById("enabled").addEventListener( |
| 304 "click", toggleEnabled | 311 "click", toggleEnabled |
| 305 ); | 312 ); |
| 306 document.getElementById("clickhide").addEventListener( | 313 document.getElementById("clickhide").addEventListener( |
| 307 "click", activateClickHide | 314 "click", activateClickHide |
| 308 ); | 315 ); |
| 309 document.getElementById("clickhide-cancel").addEventListener( | 316 document.getElementById("clickhide-cancel").addEventListener( |
| 310 "click", cancelClickHide | 317 "click", cancelClickHide |
| 311 ); | 318 ); |
| 319 document.getElementById("issueReporter").addEventListener( |
| 320 "click", reportIssue |
| 321 ) |
| 312 document.getElementById("options").addEventListener("click", () => | 322 document.getElementById("options").addEventListener("click", () => |
| 313 { | 323 { |
| 314 browser.runtime.sendMessage({type: "app.open", what: "options"}); | 324 browser.runtime.sendMessage({type: "app.open", what: "options"}); |
| 315 window.close(); | 325 window.close(); |
| 316 }); | 326 }); |
| 317 | 327 |
| 318 // Set up collapsing of menu items | 328 // Set up collapsing of menu items |
| 319 for (let collapser of document.getElementsByClassName("collapse")) | 329 for (let collapser of document.getElementsByClassName("collapse")) |
| 320 { | 330 { |
| 321 collapser.addEventListener("click", toggleCollapse); | 331 collapser.addEventListener("click", toggleCollapse); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 { | 396 { |
| 387 if (event.target.id == "notification-optout") | 397 if (event.target.id == "notification-optout") |
| 388 setPref("notifications_ignoredcategories", true); | 398 setPref("notifications_ignoredcategories", true); |
| 389 | 399 |
| 390 notificationElement.hidden = true; | 400 notificationElement.hidden = true; |
| 391 notification.onClicked(); | 401 notification.onClicked(); |
| 392 } | 402 } |
| 393 }, true); | 403 }, true); |
| 394 }); | 404 }); |
| 395 }); | 405 }); |
| OLD | NEW |