Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: include.postload.js

Issue 5838948538515456: Issue 370 - Make "Block element" hide elements for added filters (Closed)
Patch Set: Improved comment Created March 4, 2015, 7:34 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « block.js ('k') | include.preload.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 case "clickhide-move": 700 case "clickhide-move":
701 if (clickHideFiltersDialog) 701 if (clickHideFiltersDialog)
702 { 702 {
703 clickHideFiltersDialog.style.left = (parseInt(clickHideFiltersDialog.s tyle.left, 10) + msg.x) + "px"; 703 clickHideFiltersDialog.style.left = (parseInt(clickHideFiltersDialog.s tyle.left, 10) + msg.x) + "px";
704 clickHideFiltersDialog.style.top = (parseInt(clickHideFiltersDialog.st yle.top, 10) + msg.y) + "px"; 704 clickHideFiltersDialog.style.top = (parseInt(clickHideFiltersDialog.st yle.top, 10) + msg.y) + "px";
705 } 705 }
706 break; 706 break;
707 case "clickhide-close": 707 case "clickhide-close":
708 if (currentElement && msg.remove) 708 if (currentElement && msg.remove)
709 { 709 {
710 // Explicitly get rid of currentElement 710 // Hide the selected element itself if an added blocking
711 var element = currentElement.prisoner || currentElement; 711 // filter is causing it to collapse. Note that this
712 if (element && element.parentNode) 712 // behavior is incomplete, but the best we can do here,
713 element.parentNode.removeChild(element); 713 // e.g. if an added blocking filter matches other elements,
714 // the effect won't be visible until the page is is reloaded.
715 checkCollapse(currentElement.prisoner || currentElement);
716
717 // Apply added element hiding filters.
718 var selectors = msg.selectors;
719 if (selectors.length > 0)
720 hideElements(selectors);
714 } 721 }
715 clickHide_deactivate(); 722 clickHide_deactivate();
716 break; 723 break;
717 case "clickhide-show-dialog": 724 case "clickhide-show-dialog":
718 if (window.self == window.top) 725 if (window.self == window.top)
719 clickHide_showDialog(msg.screenX + window.pageXOffset, 726 clickHide_showDialog(msg.screenX + window.pageXOffset,
720 msg.screenY + window.pageYOffset, 727 msg.screenY + window.pageYOffset,
721 msg.clickHideFilters); 728 msg.clickHideFilters);
722 break; 729 break;
723 case "clickhide-clear-last-right-click-event": 730 case "clickhide-clear-last-right-click-event":
724 if (lastRightClickEventValid) 731 if (lastRightClickEventValid)
725 lastRightClickEventValid = false; 732 lastRightClickEventValid = false;
726 else 733 else
727 lastRightClickEvent = null; 734 lastRightClickEvent = null;
728 break; 735 break;
729 } 736 }
730 }); 737 });
731 738
732 if (window == window.top) 739 if (window == window.top)
733 ext.backgroundPage.sendMessage({type: "report-html-page"}); 740 ext.backgroundPage.sendMessage({type: "report-html-page"});
734 } 741 }
OLDNEW
« no previous file with comments | « block.js ('k') | include.preload.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld