| Left: | ||
| Right: |
| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <http://adblockplus.org/>, | 2 * This file is part of Adblock Plus <http://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2014 Eyeo GmbH | 3 * Copyright (C) 2006-2014 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 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 726 this.data.parentNode.removeChild(this.data); | 726 this.data.parentNode.removeChild(this.data); |
| 727 } | 727 } |
| 728 }; | 728 }; |
| 729 | 729 |
| 730 let subscriptionUpdateDataSource = | 730 let subscriptionUpdateDataSource = |
| 731 { | 731 { |
| 732 contentWnd: null, | 732 contentWnd: null, |
| 733 type: null, | 733 type: null, |
| 734 outdated: null, | 734 outdated: null, |
| 735 needUpdate: null, | 735 needUpdate: null, |
| 736 | |
| 737 subscriptionFilter: function(s) | |
| 738 { | |
| 739 if (s instanceof DownloadableSubscription) | |
| 740 return subscriptionsDataSource.subscriptionFilter(s); | |
| 741 else | |
| 742 return false; | |
| 743 }, | |
| 736 | 744 |
| 737 collectData: function(wnd, windowURI, callback) | 745 collectData: function(wnd, windowURI, callback) |
| 738 { | 746 { |
| 739 this.contentWnd = wnd; | 747 this.contentWnd = wnd; |
| 740 let now = Date.now() / MILLISECONDS_IN_SECOND; | 748 let now = Date.now() / MILLISECONDS_IN_SECOND; |
| 741 let outdatedThreshold = now - 14 * SECONDS_IN_DAY; | 749 let outdatedThreshold = now - 14 * SECONDS_IN_DAY; |
| 742 let needUpdateThreshold = now - 1 * SECONDS_IN_HOUR; | 750 let needUpdateThreshold = now - 1 * SECONDS_IN_HOUR; |
| 743 | 751 |
| 744 this.outdated = []; | 752 this.outdated = []; |
| 745 this.needUpdate = []; | 753 this.needUpdate = []; |
| 746 | 754 |
| 747 let subscriptions = FilterStorage.subscriptions.filter(issuesDataSource.subs criptionFilter); | 755 let subscriptions = FilterStorage.subscriptions.filter(subscriptionUpdateDat aSource.subscriptionFilter); |
|
Wladimir Palant
2014/07/30 05:44:35
this.subscriptionFilter please.
saroyanm
2014/07/30 06:11:58
Oops.
| |
| 748 for (let i = 0; i < subscriptions.length; i++) | 756 for (let i = 0; i < subscriptions.length; i++) |
| 749 { | 757 { |
| 750 let lastSuccess = subscriptions[i].lastSuccess; | 758 let lastSuccess = subscriptions[i].lastSuccess; |
| 751 if (lastSuccess < outdatedThreshold) | 759 if (lastSuccess < outdatedThreshold) |
| 752 this.outdated.push(subscriptions[i]); | 760 this.outdated.push(subscriptions[i]); |
| 753 if (lastSuccess < needUpdateThreshold) | 761 if (lastSuccess < needUpdateThreshold) |
| 754 this.needUpdate.push(subscriptions[i]); | 762 this.needUpdate.push(subscriptions[i]); |
| 755 } | 763 } |
| 756 | 764 |
| 757 callback(); | 765 callback(); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 877 isEnabled: Prefs.enabled, | 885 isEnabled: Prefs.enabled, |
| 878 whitelistFilter: null, | 886 whitelistFilter: null, |
| 879 disabledFilters: [], | 887 disabledFilters: [], |
| 880 disabledSubscriptions: [], | 888 disabledSubscriptions: [], |
| 881 ownFilters: [], | 889 ownFilters: [], |
| 882 numSubscriptions: 0, | 890 numSubscriptions: 0, |
| 883 numAppliedFilters: Infinity, | 891 numAppliedFilters: Infinity, |
| 884 | 892 |
| 885 subscriptionFilter: function(s) | 893 subscriptionFilter: function(s) |
| 886 { | 894 { |
| 887 if (s instanceof DownloadableSubscription) | 895 if (s instanceof DownloadableSubscription && s.url != Prefs.subscriptions_ex ceptionsurl |
| 896 && s.url != Prefs.subscriptions_antiadblockurl) | |
|
Wladimir Palant
2014/07/30 05:44:35
Please try to keep the lines shorter than 80 chara
saroyanm
2014/07/30 06:11:58
Thanks, done.
| |
| 888 return subscriptionsDataSource.subscriptionFilter(s); | 897 return subscriptionsDataSource.subscriptionFilter(s); |
| 889 else | 898 else |
| 890 return false; | 899 return false; |
| 891 }, | 900 }, |
| 892 | 901 |
| 893 collectData: function(wnd, windowURI, callback) | 902 collectData: function(wnd, windowURI, callback) |
| 894 { | 903 { |
| 895 this.contentWnd = wnd; | 904 this.contentWnd = wnd; |
| 896 this.whitelistFilter = Policy.isWindowWhitelisted(wnd); | 905 this.whitelistFilter = Policy.isWindowWhitelisted(wnd); |
| 897 | 906 |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1562 | 1571 |
| 1563 function censorURL(url) | 1572 function censorURL(url) |
| 1564 { | 1573 { |
| 1565 return url.replace(/([?;&\/#][^?;&\/#]+?=)[^?;&\/#]+/g, "$1*"); | 1574 return url.replace(/([?;&\/#][^?;&\/#]+?=)[^?;&\/#]+/g, "$1*"); |
| 1566 } | 1575 } |
| 1567 | 1576 |
| 1568 function encodeHTML(str) | 1577 function encodeHTML(str) |
| 1569 { | 1578 { |
| 1570 return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"). replace(/"/g, """); | 1579 return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"). replace(/"/g, """); |
| 1571 } | 1580 } |
| OLD | NEW |