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-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 { | 56 { |
57 if (checkWhitelisted(page)) | 57 if (checkWhitelisted(page)) |
58 document.body.classList.add("disabled"); | 58 document.body.classList.add("disabled"); |
59 | 59 |
60 page.sendMessage({type: "composer.content.getState"}, function(response) | 60 page.sendMessage({type: "composer.content.getState"}, function(response) |
61 { | 61 { |
62 if (response && response.active) | 62 if (response && response.active) |
63 document.body.classList.add("clickhide-active"); | 63 document.body.classList.add("clickhide-active"); |
64 }); | 64 }); |
65 } | 65 } |
66 | |
67 // For Safari, if the content blocking API is active we need to hide the | |
68 // stats section. (The content blocking API doesn't provide a way for us to | |
69 // offer those blocking statistics.) | |
70 ext.backgroundPage.sendMessage({type: "safari.contentBlockingActive"}, | |
71 function (contentBlockingActive) | |
72 { | |
73 if (contentBlockingActive) | |
74 document.body.classList.add("contentblocking-active"); | |
75 } | |
76 ); | |
77 }); | 66 }); |
78 | 67 |
79 document.getElementById("enabled").addEventListener("click", toggleEnabled, fa
lse); | 68 document.getElementById("enabled").addEventListener("click", toggleEnabled, fa
lse); |
80 document.getElementById("clickhide").addEventListener("click", activateClickHi
de, false); | 69 document.getElementById("clickhide").addEventListener("click", activateClickHi
de, false); |
81 document.getElementById("clickhide-cancel").addEventListener("click", cancelCl
ickHide, false); | 70 document.getElementById("clickhide-cancel").addEventListener("click", cancelCl
ickHide, false); |
82 document.getElementById("options").addEventListener("click", function() | 71 document.getElementById("options").addEventListener("click", function() |
83 { | 72 { |
84 ext.showOptions(); | 73 ext.showOptions(); |
85 }, false); | 74 }, false); |
86 | 75 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 } | 134 } |
146 | 135 |
147 function toggleCollapse(event) | 136 function toggleCollapse(event) |
148 { | 137 { |
149 var collapser = event.currentTarget; | 138 var collapser = event.currentTarget; |
150 Prefs[collapser.dataset.option] = !Prefs[collapser.dataset.option]; | 139 Prefs[collapser.dataset.option] = !Prefs[collapser.dataset.option]; |
151 collapser.parentNode.classList.toggle("collapsed"); | 140 collapser.parentNode.classList.toggle("collapsed"); |
152 } | 141 } |
153 | 142 |
154 document.addEventListener("DOMContentLoaded", onLoad, false); | 143 document.addEventListener("DOMContentLoaded", onLoad, false); |
OLD | NEW |