| OLD | NEW |
| 1 "use strict"; | 1 "use strict"; |
| 2 | 2 |
| 3 let listeners = []; | 3 let listeners = []; |
| 4 | 4 |
| 5 let Prefs = exports.Prefs = { | 5 let Prefs = exports.Prefs = { |
| 6 enabled: true, | 6 enabled: true, |
| 7 savestats: true, | 7 savestats: true, |
| 8 subscriptions_autoupdate: true, | 8 subscriptions_autoupdate: true, |
| 9 subscriptions_fallbackerrors: 5, | 9 subscriptions_fallbackerrors: 5, |
| 10 subscriptions_fallbackurl: "", | 10 subscriptions_fallbackurl: "", |
| 11 notificationurl: "http://example.com/notification.json", | 11 notificationurl: "http://example.com/notification.json", |
| 12 notificationdata: {}, | 12 notificationdata: {}, |
| 13 notifications_ignoredcategories: [] | 13 notifications_ignoredcategories: [], |
| 14 blocked_total: 10 |
| 14 }; | 15 }; |
| 15 | 16 |
| 16 for (let key of Object.keys(Prefs)) | 17 for (let key of Object.keys(Prefs)) |
| 17 { | 18 { |
| 18 let value = Prefs[key]; | 19 let value = Prefs[key]; |
| 19 Object.defineProperty(Prefs, key, { | 20 Object.defineProperty(Prefs, key, { |
| 20 get() | 21 get() |
| 21 { | 22 { |
| 22 return value; | 23 return value; |
| 23 }, | 24 }, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 38 if (listeners.indexOf(listener) < 0) | 39 if (listeners.indexOf(listener) < 0) |
| 39 listeners.push(listener); | 40 listeners.push(listener); |
| 40 }; | 41 }; |
| 41 | 42 |
| 42 Prefs.removeListener = function(listener) | 43 Prefs.removeListener = function(listener) |
| 43 { | 44 { |
| 44 let index = listeners.indexOf(listener); | 45 let index = listeners.indexOf(listener); |
| 45 if (index >= 0) | 46 if (index >= 0) |
| 46 listeners.splice(index, 1); | 47 listeners.splice(index, 1); |
| 47 }; | 48 }; |
| OLD | NEW |