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

Side by Side Diff: options.js

Issue 29339116: Issue 3877 - Fixed filter change listener regression in options page (Closed)
Patch Set: Created March 30, 2016, 12:09 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 | « no previous file | no next file » | 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-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 var element = findSubscriptionElement(subscription); 445 var element = findSubscriptionElement(subscription);
446 if (element) 446 if (element)
447 updateSubscriptionInfo(element); 447 updateSubscriptionInfo(element);
448 } 448 }
449 449
450 function onSubscriptionAdded(subscription) 450 function onSubscriptionAdded(subscription)
451 { 451 {
452 if (subscription instanceof SpecialSubscription) 452 if (subscription instanceof SpecialSubscription)
453 { 453 {
454 for (var i = 0; i < subscription.filters.length; i++) 454 for (var i = 0; i < subscription.filters.length; i++)
455 onFilterChange("filter.added", subscription.filters[i]); 455 onFilterAdded(subscription.filters[i]);
456 } 456 }
457 else if (subscription.url == Prefs.subscriptions_exceptionsurl) 457 else if (subscription.url == Prefs.subscriptions_exceptionsurl)
458 $("#acceptableAds").prop("checked", true); 458 $("#acceptableAds").prop("checked", true);
459 else if (!findSubscriptionElement(subscription)) 459 else if (!findSubscriptionElement(subscription))
460 addSubscriptionEntry(subscription); 460 addSubscriptionEntry(subscription);
461 } 461 }
462 462
463 function onSubscriptionRemoved(subscription) 463 function onSubscriptionRemoved(subscription)
464 { 464 {
465 if (subscription instanceof SpecialSubscription) 465 if (subscription instanceof SpecialSubscription)
466 { 466 {
467 for (var i = 0; i < subscription.filters.length; i++) 467 for (var i = 0; i < subscription.filters.length; i++)
468 onFilterChange("filter.removed", subscription.filters[i]); 468 onFilterRemoved(subscription.filters[i]);
469 } 469 }
470 else if (subscription.url == Prefs.subscriptions_exceptionsurl) 470 else if (subscription.url == Prefs.subscriptions_exceptionsurl)
471 $("#acceptableAds").prop("checked", false); 471 $("#acceptableAds").prop("checked", false);
472 else 472 else
473 { 473 {
474 var element = findSubscriptionElement(subscription); 474 var element = findSubscriptionElement(subscription);
475 if (element) 475 if (element)
476 element.parentNode.removeChild(element); 476 element.parentNode.removeChild(element);
477 } 477 }
478 } 478 }
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 links[i].href = arguments[i + 1]; 720 links[i].href = arguments[i + 1];
721 links[i].setAttribute("target", "_blank"); 721 links[i].setAttribute("target", "_blank");
722 } 722 }
723 else if (typeof arguments[i + 1] == "function") 723 else if (typeof arguments[i + 1] == "function")
724 { 724 {
725 links[i].href = "javascript:void(0);"; 725 links[i].href = "javascript:void(0);";
726 links[i].addEventListener("click", arguments[i + 1], false); 726 links[i].addEventListener("click", arguments[i + 1], false);
727 } 727 }
728 } 728 }
729 } 729 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld