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