| OLD | NEW |
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <http://adblockplus.org/>, | 2 * This file is part of Adblock Plus <http://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2014 Eyeo GmbH | 3 * Copyright (C) 2006-2014 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 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 clickHide_activated = true; | 593 clickHide_activated = true; |
| 594 // FIXME: clickHideFilters is erased in clickHide_mouseClick anyway, s
o why set it? | 594 // FIXME: clickHideFilters is erased in clickHide_mouseClick anyway, s
o why set it? |
| 595 clickHideFilters = [msg.filter]; | 595 clickHideFilters = [msg.filter]; |
| 596 // Coerce red highlighted overlay on top of element to remove. | 596 // Coerce red highlighted overlay on top of element to remove. |
| 597 // TODO: Wow, the design of the clickHide stuff is really dumb - gotta
fix it sometime | 597 // TODO: Wow, the design of the clickHide stuff is really dumb - gotta
fix it sometime |
| 598 currentElement = addElementOverlay(target); | 598 currentElement = addElementOverlay(target); |
| 599 // clickHide_mouseOver(lastRightClickEvent); | 599 // clickHide_mouseOver(lastRightClickEvent); |
| 600 clickHide_mouseClick(lastRightClickEvent); | 600 clickHide_mouseClick(lastRightClickEvent); |
| 601 } | 601 } |
| 602 else | 602 else |
| 603 console.log("clickhide-new-filter: URLs don't match. Couldn't find tha
t element.", request.filter, url, lastRightClickEvent.target.src); | 603 console.log("clickhide-new-filter: URLs don't match. Couldn't find tha
t element.", msg.filter, url, lastRightClickEvent.target.src); |
| 604 break; | 604 break; |
| 605 case "clickhide-init": | 605 case "clickhide-init": |
| 606 if (clickHideFiltersDialog) | 606 if (clickHideFiltersDialog) |
| 607 { | 607 { |
| 608 sendResponse({filters: clickHide_filters}); | 608 sendResponse({filters: clickHide_filters}); |
| 609 | 609 |
| 610 clickHideFiltersDialog.style.width = msg.width + "px"; | 610 clickHideFiltersDialog.style.width = msg.width + "px"; |
| 611 clickHideFiltersDialog.style.height = msg.height + "px"; | 611 clickHideFiltersDialog.style.height = msg.height + "px"; |
| 612 clickHideFiltersDialog.style.visibility = "visible"; | 612 clickHideFiltersDialog.style.visibility = "visible"; |
| 613 } | 613 } |
| 614 break; | 614 break; |
| 615 case "clickhide-move": | 615 case "clickhide-move": |
| 616 if (clickHideFiltersDialog) | 616 if (clickHideFiltersDialog) |
| 617 { | 617 { |
| 618 clickHideFiltersDialog.style.left = (parseInt(clickHideFiltersDialog.s
tyle.left, 10) + request.x) + "px"; | 618 clickHideFiltersDialog.style.left = (parseInt(clickHideFiltersDialog.s
tyle.left, 10) + msg.x) + "px"; |
| 619 clickHideFiltersDialog.style.top = (parseInt(clickHideFiltersDialog.st
yle.top, 10) + request.y) + "px"; | 619 clickHideFiltersDialog.style.top = (parseInt(clickHideFiltersDialog.st
yle.top, 10) + msg.y) + "px"; |
| 620 } | 620 } |
| 621 break; | 621 break; |
| 622 case "clickhide-close": | 622 case "clickhide-close": |
| 623 if (clickHideFiltersDialog) | 623 if (clickHideFiltersDialog) |
| 624 { | 624 { |
| 625 // Explicitly get rid of currentElement | 625 // Explicitly get rid of currentElement |
| 626 if (msg.remove && currentElement && currentElement.parentNode) | 626 if (msg.remove && currentElement && currentElement.parentNode) |
| 627 currentElement.parentNode.removeChild(currentElement); | 627 currentElement.parentNode.removeChild(currentElement); |
| 628 } | 628 } |
| 629 clickHide_deactivate(); | 629 clickHide_deactivate(); |
| 630 break; | 630 break; |
| 631 default: | 631 default: |
| 632 sendResponse({}); | 632 sendResponse({}); |
| 633 break; | 633 break; |
| 634 } | 634 } |
| 635 }); | 635 }); |
| 636 | 636 |
| 637 if (window == window.top) | 637 if (window == window.top) |
| 638 ext.backgroundPage.sendMessage({type: "report-html-page"}); | 638 ext.backgroundPage.sendMessage({type: "report-html-page"}); |
| 639 } | 639 } |
| OLD | NEW |