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-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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 // elt.parentNode.appendChild(overlay, elt); | 246 // elt.parentNode.appendChild(overlay, elt); |
247 document.documentElement.appendChild(overlay); | 247 document.documentElement.appendChild(overlay); |
248 return overlay; | 248 return overlay; |
249 } | 249 } |
250 | 250 |
251 // Show dialog asking user whether she wants to add the proposed filters derived | 251 // Show dialog asking user whether she wants to add the proposed filters derived |
252 // from selected page element | 252 // from selected page element |
253 function clickHide_showDialog(left, top, filters) | 253 function clickHide_showDialog(left, top, filters) |
254 { | 254 { |
255 // If we are already selecting, abort now | 255 // If we are already selecting, abort now |
256 if (clickHide_activated || clickHideFiltersDialog) | 256 if (clickHide_activated) |
257 clickHide_rulesPending(); | 257 clickHide_rulesPending(); |
258 | 258 |
259 clickHide_filters = filters; | 259 clickHide_filters = filters; |
260 | 260 |
261 clickHideFiltersDialog = document.createElement("iframe"); | 261 clickHideFiltersDialog = document.createElement("iframe"); |
262 clickHideFiltersDialog.src = ext.getURL("block.html"); | 262 clickHideFiltersDialog.src = ext.getURL("block.html"); |
263 clickHideFiltersDialog.setAttribute("style", "position: fixed !important; visi
bility: hidden; display: block !important; border: 0px !important;"); | 263 clickHideFiltersDialog.setAttribute("style", "position: fixed !important; visi
bility: hidden; display: block !important; border: 0px !important;"); |
264 clickHideFiltersDialog.style.WebkitBoxShadow = "5px 5px 20px rgba(0,0,0,0.5)"; | 264 clickHideFiltersDialog.style.WebkitBoxShadow = "5px 5px 20px rgba(0,0,0,0.5)"; |
265 clickHideFiltersDialog.style.zIndex = 0x7FFFFFFF; | 265 clickHideFiltersDialog.style.zIndex = 0x7FFFFFFF; |
266 | 266 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 | 340 |
341 if (clickHideFiltersDialog) | 341 if (clickHideFiltersDialog) |
342 { | 342 { |
343 document.documentElement.removeChild(clickHideFiltersDialog); | 343 document.documentElement.removeChild(clickHideFiltersDialog); |
344 clickHideFiltersDialog = null; | 344 clickHideFiltersDialog = null; |
345 } | 345 } |
346 | 346 |
347 clickHide_filters = null; | 347 clickHide_filters = null; |
348 lastRightClickEvent = null; | 348 lastRightClickEvent = null; |
349 | 349 |
350 if (currentElement) { | 350 if (currentElement) |
| 351 { |
351 currentElement.removeEventListener("contextmenu", clickHide_elementClickHan
dler, true); | 352 currentElement.removeEventListener("contextmenu", clickHide_elementClickHan
dler, true); |
352 unhighlightElements(); | 353 unhighlightElements(); |
353 unhighlightElement(currentElement); | 354 unhighlightElement(currentElement); |
354 currentElement = null; | 355 currentElement = null; |
355 } | 356 } |
356 unhighlightElements(); | 357 unhighlightElements(); |
357 | 358 |
358 var overlays = document.getElementsByClassName("__adblockplus__overlay"); | 359 var overlays = document.getElementsByClassName("__adblockplus__overlay"); |
359 while (overlays.length > 0) | 360 while (overlays.length > 0) |
360 overlays[0].parentNode.removeChild(overlays[0]); | 361 overlays[0].parentNode.removeChild(overlays[0]); |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 lastRightClickEventValid = false; | 725 lastRightClickEventValid = false; |
725 else | 726 else |
726 lastRightClickEvent = null; | 727 lastRightClickEvent = null; |
727 break; | 728 break; |
728 } | 729 } |
729 }); | 730 }); |
730 | 731 |
731 if (window == window.top) | 732 if (window == window.top) |
732 ext.backgroundPage.sendMessage({type: "report-html-page"}); | 733 ext.backgroundPage.sendMessage({type: "report-html-page"}); |
733 } | 734 } |
OLD | NEW |