| Left: | ||
| Right: |
| LEFT | RIGHT |
|---|---|
| 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-2013 Eyeo GmbH | 3 * Copyright (C) 2006-2013 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 |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
| 13 * | 13 * |
| 14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
| 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
| 16 */ | 16 */ |
| 17 | 17 |
| 18 let {FilterNotifier} = require("filterNotifier"); | 18 let {FilterNotifier} = require("filterNotifier"); |
| 19 let {Synchronizer} = require("synchronizer"); | |
| 20 | 19 |
| 21 FilterNotifier.addListener(function(action, subscription) | 20 FilterNotifier.addListener(function(action, item) |
| 22 { | 21 { |
| 23 switch (action) | 22 _triggerEvent("filterChange", action, item); |
|
Andrey Novikov
2013/06/18 11:48:28
I didn't change the logic of the current Android a
Wladimir Palant
2013/06/18 15:02:15
Yes, this definitely needs to be more generic - th
Andrey Novikov
2013/06/25 08:08:02
So, I see no reason to complicate things with some
Felix Dahlke
2013/06/25 08:21:58
IMO yes. It's simpler, and I doubt there'll be any
Wladimir Palant
2013/06/25 08:44:40
JS to C++ calls always mean overhead and we will b
| |
| 24 { | |
| 25 case "subscription.lastDownload": | |
| 26 case "subscription.downloadStatus": | |
| 27 let status = "synchronize_never"; | |
| 28 let time = 0; | |
| 29 if (Synchronizer.isExecuting(subscription.url)) | |
| 30 { | |
| 31 status = "synchronize_in_progress"; | |
| 32 } | |
| 33 else if (subscription.downloadStatus && subscription.downloadStatus != "sy nchronize_ok") | |
| 34 { | |
| 35 status = subscription.downloadStatus; | |
| 36 } | |
| 37 else if (subscription.lastDownload > 0) | |
| 38 { | |
| 39 time = subscription.lastDownload; | |
| 40 status = "synchronize_last_at"; | |
| 41 } | |
|
Wladimir Palant
2013/06/18 15:02:15
This processing should be done in the C++ code, th
| |
| 42 _triggerEvent("filterChange", subscription.url, status, time); | |
| 43 break; | |
| 44 } | |
| 45 }); | 23 }); |
| LEFT | RIGHT |