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

Side by Side Diff: lib/notification.js

Issue 29329597: Issue 3253 - Adblock Warning List opt in message should not be triggered by frames (Firefox) (Closed)
Patch Set: Created Nov. 2, 2015, 11:41 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | lib/ui.js » ('j') | lib/ui.js » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 * @param {Boolean} approved indicator whether notification has been approved or not 361 * @param {Boolean} approved indicator whether notification has been approved or not
362 */ 362 */
363 triggerQuestionListeners: function(id, approved) 363 triggerQuestionListeners: function(id, approved)
364 { 364 {
365 if (!(id in questionListeners)) 365 if (!(id in questionListeners))
366 return; 366 return;
367 let listeners = questionListeners[id]; 367 let listeners = questionListeners[id];
368 for (let listener of listeners) 368 for (let listener of listeners)
369 listener(approved); 369 listener(approved);
370 }, 370 },
371 371
372 /** 372 /**
373 * Toggles whether notifications of a specific category should be ignored 373 * Toggles whether notifications of a specific category should be ignored
374 * @param {String} category notification category identifier 374 * @param {String} category notification category identifier
375 * @param {Boolean} [forceValue] force specified value 375 * @param {Boolean} [forceValue] force specified value
376 */ 376 */
377 toggleIgnoreCategory: function(category, forceValue) 377 toggleIgnoreCategory: function(category, forceValue)
378 { 378 {
379 let categories = Prefs.notifications_ignoredcategories; 379 let categories = Prefs.notifications_ignoredcategories;
380 let index = categories.indexOf(category); 380 let index = categories.indexOf(category);
381 if (index == -1 && forceValue !== false) 381 if (index == -1 && forceValue !== false)
382 { 382 {
383 categories.push(category); 383 categories.push(category);
384 Prefs.notifications_showui = true; 384 Prefs.notifications_showui = true;
385 } 385 }
386 else if (index != -1 && forceValue !== true) 386 else if (index != -1 && forceValue !== true)
387 categories.splice(index, 1); 387 categories.splice(index, 1);
388 388
389 // HACK: JSON values aren't saved unless they are assigned a different objec t. 389 // HACK: JSON values aren't saved unless they are assigned a different objec t.
390 Prefs.notifications_ignoredcategories = JSON.parse(JSON.stringify(categories )); 390 Prefs.notifications_ignoredcategories = JSON.parse(JSON.stringify(categories ));
391 } 391 }
392 }; 392 };
393 Notification.init(); 393 Notification.init();
OLDNEW
« no previous file with comments | « no previous file | lib/ui.js » ('j') | lib/ui.js » ('J')

Powered by Google App Engine
This is Rietveld