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-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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 | 261 |
262 if (FilterStorage.knownSubscriptions.has(subscription.url)) | 262 if (FilterStorage.knownSubscriptions.has(subscription.url)) |
263 { | 263 { |
264 if (newValue == false) | 264 if (newValue == false) |
265 addFilters(subscription.filters); | 265 addFilters(subscription.filters); |
266 else | 266 else |
267 subscription.filters.forEach(removeFilter); | 267 subscription.filters.forEach(removeFilter); |
268 } | 268 } |
269 } | 269 } |
270 | 270 |
271 function onSubscriptionUpdated(subscription) | 271 function onSubscriptionUpdated(subscription, oldFilters) |
272 { | 272 { |
273 FilterListener.setDirty(1); | 273 FilterListener.setDirty(1); |
274 | 274 |
275 if (!subscription.disabled && | 275 if (!subscription.disabled && |
276 FilterStorage.knownSubscriptions.has(subscription.url)) | 276 FilterStorage.knownSubscriptions.has(subscription.url)) |
277 { | 277 { |
278 subscription.oldFilters.forEach(removeFilter); | 278 oldFilters.forEach(removeFilter); |
279 addFilters(subscription.filters); | 279 addFilters(subscription.filters); |
280 } | 280 } |
281 } | 281 } |
282 | 282 |
283 function onFilterHitCount(filter, newValue) | 283 function onFilterHitCount(filter, newValue) |
284 { | 284 { |
285 if (newValue == 0) | 285 if (newValue == 0) |
286 FilterListener.setDirty(0); | 286 FilterListener.setDirty(0); |
287 else | 287 else |
288 FilterListener.setDirty(0.002); | 288 FilterListener.setDirty(0.002); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 { | 336 { |
337 if (!subscription.disabled) | 337 if (!subscription.disabled) |
338 addFilters(subscription.filters); | 338 addFilters(subscription.filters); |
339 } | 339 } |
340 } | 340 } |
341 | 341 |
342 function onSave() | 342 function onSave() |
343 { | 343 { |
344 isDirty = 0; | 344 isDirty = 0; |
345 } | 345 } |
OLD | NEW |