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-2017 eyeo GmbH | 3 * Copyright (C) 2006-2017 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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 checkTarget(target, "platform", platform, platformVersion)) | 297 checkTarget(target, "platform", platform, platformVersion)) |
298 { | 298 { |
299 match = true; | 299 match = true; |
300 break; | 300 break; |
301 } | 301 } |
302 } | 302 } |
303 if (!match) | 303 if (!match) |
304 continue; | 304 continue; |
305 } | 305 } |
306 | 306 |
| 307 if (typeof notification.blocked_total_min == 'number' && |
| 308 (typeof Prefs.blocked_total != 'number' || |
| 309 notification.blocked_total_min > Prefs.blocked_total)) |
| 310 continue |
| 311 |
| 312 if (typeof notification.blocked_total_max == 'number' && |
| 313 (typeof Prefs.blocked_total != 'number' || |
| 314 notification.blocked_total_max < Prefs.blocked_total)) |
| 315 continue |
| 316 |
307 if (!notificationToShow || | 317 if (!notificationToShow || |
308 getNumericalSeverity(notification) > | 318 getNumericalSeverity(notification) > |
309 getNumericalSeverity(notificationToShow)) | 319 getNumericalSeverity(notificationToShow)) |
310 notificationToShow = notification; | 320 notificationToShow = notification; |
311 } | 321 } |
312 | 322 |
313 return notificationToShow; | 323 return notificationToShow; |
314 }, | 324 }, |
315 | 325 |
316 /** | 326 /** |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 else if (index != -1 && forceValue !== true) | 476 else if (index != -1 && forceValue !== true) |
467 categories.splice(index, 1); | 477 categories.splice(index, 1); |
468 | 478 |
469 // HACK: JSON values aren't saved unless they are assigned a | 479 // HACK: JSON values aren't saved unless they are assigned a |
470 // different object. | 480 // different object. |
471 Prefs.notifications_ignoredcategories = | 481 Prefs.notifications_ignoredcategories = |
472 JSON.parse(JSON.stringify(categories)); | 482 JSON.parse(JSON.stringify(categories)); |
473 } | 483 } |
474 }; | 484 }; |
475 Notification.init(); | 485 Notification.init(); |
OLD | NEW |