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

Delta Between Two Patch Sets: include.postload.js

Issue 5838948538515456: Issue 370 - Make "Block element" hide elements for added filters (Closed)
Left Patch Set: Restored failsafe code Created March 4, 2015, 3:07 p.m.
Right Patch Set: Addressed comments and simplified loop Created March 4, 2015, 9:35 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | include.preload.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 if (currentElement && msg.remove) 708 if (currentElement && msg.remove)
709 { 709 {
710 // Hide the selected element itself if an added blocking 710 // Hide the selected element itself if an added blocking
711 // filter is causing it to collapse. Note that this 711 // filter is causing it to collapse. Note that this
712 // behavior is incomplete, but the best we can do here, 712 // behavior is incomplete, but the best we can do here,
713 // e.g. if an added blocking filter matches other elements, 713 // e.g. if an added blocking filter matches other elements,
714 // the effect won't be visible until the page is is reloaded. 714 // the effect won't be visible until the page is is reloaded.
715 checkCollapse(currentElement.prisoner || currentElement); 715 checkCollapse(currentElement.prisoner || currentElement);
716 716
717 // Apply added element hiding filters. 717 // Apply added element hiding filters.
718 var selectors = msg.selectors; 718 updateStylesheet();
719 if (selectors.length > 0)
720 hideElements(selectors);
721 } 719 }
722 clickHide_deactivate(); 720 clickHide_deactivate();
723 break; 721 break;
724 case "clickhide-show-dialog": 722 case "clickhide-show-dialog":
725 if (window.self == window.top) 723 if (window.self == window.top)
726 clickHide_showDialog(msg.screenX + window.pageXOffset, 724 clickHide_showDialog(msg.screenX + window.pageXOffset,
727 msg.screenY + window.pageYOffset, 725 msg.screenY + window.pageYOffset,
728 msg.clickHideFilters); 726 msg.clickHideFilters);
729 break; 727 break;
730 case "clickhide-clear-last-right-click-event": 728 case "clickhide-clear-last-right-click-event":
731 if (lastRightClickEventValid) 729 if (lastRightClickEventValid)
732 lastRightClickEventValid = false; 730 lastRightClickEventValid = false;
733 else 731 else
734 lastRightClickEvent = null; 732 lastRightClickEvent = null;
735 break; 733 break;
736 } 734 }
737 }); 735 });
738 736
739 if (window == window.top) 737 if (window == window.top)
740 ext.backgroundPage.sendMessage({type: "report-html-page"}); 738 ext.backgroundPage.sendMessage({type: "report-html-page"});
741 } 739 }
LEFTRIGHT
« no previous file | include.preload.js » ('j') | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld