Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: test/stub-modules/prefs.js

Issue 29501607: Issue 5459 - Add support to show a notification based on the number of ads blocked (Closed)
Left Patch Set: Made blockedTotal and locales part of targets Created Aug. 21, 2017, 3:10 p.m.
Right Patch Set: Show notification for blockedTotal* only if Prefs.show_statsinpopup Created Aug. 24, 2017, 4:35 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « test/notification.js ('k') | test/stub-modules/utils.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 blocked_total: 10,
15 show_statsinpopup: true
15 }; 16 };
16 17
17 for (let key of Object.keys(Prefs)) 18 for (let key of Object.keys(Prefs))
18 { 19 {
19 let value = Prefs[key]; 20 let value = Prefs[key];
20 Object.defineProperty(Prefs, key, { 21 Object.defineProperty(Prefs, key, {
21 get() 22 get()
22 { 23 {
23 return value; 24 return value;
24 }, 25 },
(...skipping 14 matching lines...) Expand all
39 if (listeners.indexOf(listener) < 0) 40 if (listeners.indexOf(listener) < 0)
40 listeners.push(listener); 41 listeners.push(listener);
41 }; 42 };
42 43
43 Prefs.removeListener = function(listener) 44 Prefs.removeListener = function(listener)
44 { 45 {
45 let index = listeners.indexOf(listener); 46 let index = listeners.indexOf(listener);
46 if (index >= 0) 47 if (index >= 0)
47 listeners.splice(index, 1); 48 listeners.splice(index, 1);
48 }; 49 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld