| Left: | ||
| Right: |
| LEFT | RIGHT |
|---|---|
| 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-present eyeo GmbH | 3 * Copyright (C) 2006-present 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 105 let matchCount = 0; | 105 let matchCount = 0; |
| 106 for (let subscription of subscriptions) | 106 for (let subscription of subscriptions) |
| 107 { | 107 { |
| 108 let prefixes = subscription.getAttribute("prefixes"); | 108 let prefixes = subscription.getAttribute("prefixes"); |
| 109 let prefix = prefixes && prefixes.split(",").find( | 109 let prefix = prefixes && prefixes.split(",").find( |
| 110 lang => new RegExp("^" + lang + "\\b").test(Utils.appLocale) | 110 lang => new RegExp("^" + lang + "\\b").test(Utils.appLocale) |
| 111 ); | 111 ); |
| 112 | 112 |
| 113 let subscriptionType = subscription.getAttribute("type"); | 113 let subscriptionType = subscription.getAttribute("type"); |
| 114 | 114 |
| 115 if (subscriptionType in ["ads", "circumvention"] && | 115 if ((subscriptionType == "ads" || subscriptionType == "circumvention") && |
|
Manish Jethani
2018/06/19 09:23:30
We should probably just use == here instead of the
hub
2018/06/19 12:41:14
Done.
| |
| 116 !selectedItem[subscriptionType]) | 116 !selectedItem[subscriptionType]) |
| 117 selectedItem[subscriptionType] = subscription; | 117 selectedItem[subscriptionType] = subscription; |
| 118 | 118 |
| 119 if (prefix) | 119 if (prefix) |
| 120 { | 120 { |
| 121 // The "ads" subscription is the one driving the selection. | 121 // The "ads" subscription is the one driving the selection. |
| 122 if (subscriptionType == "ads") | 122 if (subscriptionType == "ads") |
| 123 { | 123 { |
| 124 if (!selectedPrefix || selectedPrefix.length < prefix.length) | 124 if (!selectedPrefix || selectedPrefix.length < prefix.length) |
| 125 { | 125 { |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 324 * | 324 * |
| 325 * @param {function} callback | 325 * @param {function} callback |
| 326 */ | 326 */ |
| 327 exports.setSubscriptionsCallback = callback => | 327 exports.setSubscriptionsCallback = callback => |
| 328 { | 328 { |
| 329 subscriptionsCallback = callback; | 329 subscriptionsCallback = callback; |
| 330 }; | 330 }; |
| 331 | 331 |
| 332 // Exports for tests only | 332 // Exports for tests only |
| 333 exports.chooseFilterSubscriptions = chooseFilterSubscriptions; | 333 exports.chooseFilterSubscriptions = chooseFilterSubscriptions; |
| LEFT | RIGHT |