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

Side by Side Diff: chrome/content/ui/sidebar.js

Issue 29329884: Issue 3224 - Unbreak filter assistant (Closed)
Patch Set: Rebased Created Nov. 12, 2015, 3:10 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
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 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 492
493 function doBlock() { 493 function doBlock() {
494 var item = treeView.getSelectedItem(); 494 var item = treeView.getSelectedItem();
495 if (!item || item.type == "ELEMHIDE") 495 if (!item || item.type == "ELEMHIDE")
496 return; 496 return;
497 497
498 var filter = getFilter(item); 498 var filter = getFilter(item);
499 if (filter && !filter.disabled && filter instanceof WhitelistFilter) 499 if (filter && !filter.disabled && filter instanceof WhitelistFilter)
500 return; 500 return;
501 501
502 openDialog("chrome://adblockplus/content/ui/composer.xul", "_blank", "chrome,c enterscreen,resizable,dialog=no,dependent", item.nodes, item.orig); 502 if (requestNotifier)
503 {
504 requestNotifier.storeNodesForEntries(item.ids, (nodesID) =>
505 {
506 UI.blockItem(window, nodesID, item.orig);
507 });
508 }
503 } 509 }
504 510
505 function editFilter() 511 function editFilter()
506 { 512 {
507 var item = treeView.getSelectedItem(); 513 var item = treeView.getSelectedItem();
508 if (treeView.data && !treeView.data.length) 514 if (treeView.data && !treeView.data.length)
509 item = treeView.getDummyTooltip(); 515 item = treeView.getDummyTooltip();
510 516
511 let filter = getFilter(item); 517 let filter = getFilter(item);
512 if (!filter) 518 if (!filter)
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 if (item.filter) 1106 if (item.filter)
1101 existing.filter = item.filter; 1107 existing.filter = item.filter;
1102 existing.ids.push(item.id); 1108 existing.ids.push(item.id);
1103 1109
1104 this.invalidateItem(existing); 1110 this.invalidateItem(existing);
1105 return; 1111 return;
1106 } 1112 }
1107 1113
1108 // Add new item to the list 1114 // Add new item to the list
1109 // Store original item in orig property - reading out prototype is messed up in Gecko 1.9.2 1115 // Store original item in orig property - reading out prototype is messed up in Gecko 1.9.2
1110 item = {__proto__: item, orig: item, nodes: [], ids: [item.id]}; 1116 item = {__proto__: item, orig: item, ids: [item.id]};
1111 this.allData.push(item); 1117 this.allData.push(item);
1112 this.dataMap[key] = item; 1118 this.dataMap[key] = item;
1113 1119
1114 // Show disabled filters if no other filter applies 1120 // Show disabled filters if no other filter applies
1115 if (!item.filter) 1121 if (!item.filter)
1116 { 1122 {
1117 let disabledMatch = disabledMatcher.matchesAny(item.location, RegExpFilter .typeMap[item.type], item.docDomain, item.thirdParty); 1123 let disabledMatch = disabledMatcher.matchesAny(item.location, RegExpFilter .typeMap[item.type], item.docDomain, item.thirdParty);
1118 if (disabledMatch) 1124 if (disabledMatch)
1119 item.filter = disabledMatch.text; 1125 item.filter = disabledMatch.text;
1120 } 1126 }
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
1290 return {tooltip: this.itemsDummyTooltip}; 1296 return {tooltip: this.itemsDummyTooltip};
1291 }, 1297 },
1292 1298
1293 invalidateItem: function(item) 1299 invalidateItem: function(item)
1294 { 1300 {
1295 let row = this.data.indexOf(item); 1301 let row = this.data.indexOf(item);
1296 if (row >= 0) 1302 if (row >= 0)
1297 this.boxObject.invalidateRow(row); 1303 this.boxObject.invalidateRow(row);
1298 } 1304 }
1299 } 1305 }
OLDNEW

Powered by Google App Engine
This is Rietveld