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: Created March 4, 2015, 10:19 a.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 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 case "clickhide-move": 714 case "clickhide-move":
715 if (clickHideFiltersDialog) 715 if (clickHideFiltersDialog)
716 { 716 {
717 clickHideFiltersDialog.style.left = (parseInt(clickHideFiltersDialog.s tyle.left, 10) + msg.x) + "px"; 717 clickHideFiltersDialog.style.left = (parseInt(clickHideFiltersDialog.s tyle.left, 10) + msg.x) + "px";
718 clickHideFiltersDialog.style.top = (parseInt(clickHideFiltersDialog.st yle.top, 10) + msg.y) + "px"; 718 clickHideFiltersDialog.style.top = (parseInt(clickHideFiltersDialog.st yle.top, 10) + msg.y) + "px";
719 } 719 }
720 break; 720 break;
721 case "clickhide-close": 721 case "clickhide-close":
722 if (currentElement && msg.remove) 722 if (currentElement && msg.remove)
723 { 723 {
724 // Explicitly get rid of currentElement 724 checkCollapse(currentElement.prisoner || currentElement);
kzar 2015/03/04 13:09:03 IMHO there should be a comment here to mention we'
725 var element = currentElement.prisoner || currentElement; 725
726 if (element && element.parentNode) 726 var selectors = msg.selectors;
kzar 2015/03/04 11:04:02 Shouldn't we check msg.remove is true first?
Sebastian Noack 2015/03/04 11:34:52 Well, we do above. ;)
kzar 2015/03/04 13:09:03 Gah, sorry!
kzar 2015/03/04 13:09:03 I think there should also be a comment here to say
Sebastian Noack 2015/03/04 14:02:01 I don't think it needs to be that verbose. But the
kzar 2015/03/04 14:04:14 Looks great.
727 element.parentNode.removeChild(element); 727 if (selectors.length > 0)
728 hideElements(selectors);
728 } 729 }
729 clickHide_deactivate(); 730 clickHide_deactivate();
730 break; 731 break;
731 case "clickhide-show-dialog": 732 case "clickhide-show-dialog":
732 if (window.self == window.top) 733 if (window.self == window.top)
733 clickHide_showDialog(msg.screenX + window.pageXOffset, 734 clickHide_showDialog(msg.screenX + window.pageXOffset,
734 msg.screenY + window.pageYOffset, 735 msg.screenY + window.pageYOffset,
735 msg.clickHideFilters); 736 msg.clickHideFilters);
736 break; 737 break;
737 case "clickhide-clear-last-right-click-event": 738 case "clickhide-clear-last-right-click-event":
738 if (lastRightClickEventValid) 739 if (lastRightClickEventValid)
739 lastRightClickEventValid = false; 740 lastRightClickEventValid = false;
740 else 741 else
741 lastRightClickEvent = null; 742 lastRightClickEvent = null;
742 break; 743 break;
743 } 744 }
744 }); 745 });
745 746
746 if (window == window.top) 747 if (window == window.top)
747 ext.backgroundPage.sendMessage({type: "report-html-page"}); 748 ext.backgroundPage.sendMessage({type: "report-html-page"});
748 } 749 }
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