OLD | NEW |
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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 disabledText.textContent = filterField.getAttribute("disabledText"); | 323 disabledText.textContent = filterField.getAttribute("disabledText"); |
324 filterField.appendChild(disabledText); | 324 filterField.appendChild(disabledText); |
325 } | 325 } |
326 | 326 |
327 if (subscriptions.length) | 327 if (subscriptions.length) |
328 { | 328 { |
329 let sourceElement = E("tooltipFilterSource"); | 329 let sourceElement = E("tooltipFilterSource"); |
330 while (sourceElement.firstChild) | 330 while (sourceElement.firstChild) |
331 sourceElement.removeChild(sourceElement.firstChild); | 331 sourceElement.removeChild(sourceElement.firstChild); |
332 for (let i = 0; i < subscriptions.length; i++) | 332 for (let i = 0; i < subscriptions.length; i++) |
333 setMultilineContent(sourceElement, subscriptions[i].title, true); | 333 setMultilineContent(sourceElement, getSubscriptionTitle(subscriptions[i]
), true); |
334 } | 334 } |
335 } | 335 } |
336 | 336 |
337 E("tooltipSizeRow").hidden = true; | 337 E("tooltipSizeRow").hidden = true; |
338 if (!("tooltip" in item)) | 338 if (!("tooltip" in item)) |
339 { | 339 { |
340 getItemSize(item, (size) => | 340 getItemSize(item, (size) => |
341 { | 341 { |
342 if (size) | 342 if (size) |
343 { | 343 { |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 else if (!item1.thirdParty && item2.thirdParty) | 778 else if (!item1.thirdParty && item2.thirdParty) |
779 return 1; | 779 return 1; |
780 else | 780 else |
781 return 0; | 781 return 0; |
782 } | 782 } |
783 | 783 |
784 function compareFilterSource(item1, item2) | 784 function compareFilterSource(item1, item2) |
785 { | 785 { |
786 let filter1 = getFilter(item1); | 786 let filter1 = getFilter(item1); |
787 let filter2 = getFilter(item2); | 787 let filter2 = getFilter(item2); |
788 let subs1 = filter1 ? filter1.subscriptions.map(s => s.title).join(", ") : ""; | 788 let subs1 = filter1 ? filter1.subscriptions.map(s => getSubscriptionTitle(s)).
join(", ") : ""; |
789 let subs2 = filter2 ? filter2.subscriptions.map(s => s.title).join(", ") : ""; | 789 let subs2 = filter2 ? filter2.subscriptions.map(s => getSubscriptionTitle(s)).
join(", ") : ""; |
790 if (subs1 < subs2) | 790 if (subs1 < subs2) |
791 return -1; | 791 return -1; |
792 else if (subs1 > subs2) | 792 else if (subs1 > subs2) |
793 return 1; | 793 return 1; |
794 else | 794 else |
795 return 0; | 795 return 0; |
796 } | 796 } |
797 | 797 |
798 function createSortWithFallback(cmpFunc, fallbackFunc, desc) { | 798 function createSortWithFallback(cmpFunc, fallbackFunc, desc) { |
799 var factor = (desc ? -1 : 1); | 799 var factor = (desc ? -1 : 1); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
918 return (size ? size.join(" x ") : ""); | 918 return (size ? size.join(" x ") : ""); |
919 } | 919 } |
920 else if (col == "docDomain") | 920 else if (col == "docDomain") |
921 return this.data[row].docDomain + " " + (this.data[row].thirdParty ? doc
DomainThirdParty : docDomainFirstParty); | 921 return this.data[row].docDomain + " " + (this.data[row].thirdParty ? doc
DomainThirdParty : docDomainFirstParty); |
922 else if (col == "filterSource") | 922 else if (col == "filterSource") |
923 { | 923 { |
924 let filter = getFilter(this.data[row]) | 924 let filter = getFilter(this.data[row]) |
925 if (!filter) | 925 if (!filter) |
926 return ""; | 926 return ""; |
927 | 927 |
928 return filter.subscriptions.filter(s => !s.disabled).map(s => s.title).j
oin(", "); | 928 return filter.subscriptions.filter(s => !s.disabled).map(s => getSubscri
ptionTitle(s)).join(", "); |
929 } | 929 } |
930 else | 930 else |
931 return this.data[row].location; | 931 return this.data[row].location; |
932 } | 932 } |
933 else { | 933 else { |
934 // Empty list, show dummy | 934 // Empty list, show dummy |
935 if (row > 0 || (col != "address" && col != "filter")) | 935 if (row > 0 || (col != "address" && col != "filter")) |
936 return ""; | 936 return ""; |
937 if (col == "filter") { | 937 if (col == "filter") { |
938 var filter = Policy.isWhitelisted(contentLocation); | 938 var filter = Policy.isWhitelisted(contentLocation); |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1316 return {tooltip: this.itemsDummyTooltip}; | 1316 return {tooltip: this.itemsDummyTooltip}; |
1317 }, | 1317 }, |
1318 | 1318 |
1319 invalidateItem: function(item) | 1319 invalidateItem: function(item) |
1320 { | 1320 { |
1321 let row = this.data.indexOf(item); | 1321 let row = this.data.indexOf(item); |
1322 if (row >= 0) | 1322 if (row >= 0) |
1323 this.boxObject.invalidateRow(row); | 1323 this.boxObject.invalidateRow(row); |
1324 } | 1324 } |
1325 } | 1325 } |
OLD | NEW |