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

Side by Side Diff: messageResponder.js

Issue 29337773: Issue 2377 - Implement user filter lists toggle (Closed)
Patch Set: Created Feb. 26, 2016, 11:27 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 | options.html » ('j') | options.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-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 case "app.listen": 175 case "app.listen":
176 if (message.filter) 176 if (message.filter)
177 listenerFilters.app = message.filter; 177 listenerFilters.app = message.filter;
178 else 178 else
179 delete listenerFilters.app; 179 delete listenerFilters.app;
180 break; 180 break;
181 case "app.open": 181 case "app.open":
182 if (message.what == "options") 182 if (message.what == "options")
183 ext.showOptions(); 183 ext.showOptions();
184 break; 184 break;
185 case "app.userSubscriptionsToggle":
Thomas Greiner 2016/03/01 12:11:22 Please reuse "subscriptions.toggle" for that becau
186 var subscriptions = FilterStorage.subscriptions;
187 for (var i = 0; i < subscriptions.length; i++)
188 {
189 if (subscriptions[i] instanceof SpecialSubscription)
190 subscriptions[i].disabled = message.state;
Thomas Greiner 2016/03/01 12:11:22 It's a "toggle" function so it should toggle the s
191 }
192 FilterNotifier.triggerListeners("app.userSubscriptionsToggle",
Thomas Greiner 2016/03/01 12:11:22 We already have a filter event for that: "subscrip
193 message.state);
194 break;
185 case "filters.add": 195 case "filters.add":
186 var filter = Filter.fromText(message.text); 196 var filter = Filter.fromText(message.text);
187 var result = require("filterValidation").parseFilter(message.text); 197 var result = require("filterValidation").parseFilter(message.text);
188 if (result.error) 198 if (result.error)
189 sendMessage("app", "error", [result.error.toString()], sender.page); 199 sendMessage("app", "error", [result.error.toString()], sender.page);
190 else if (result.filter) 200 else if (result.filter)
191 FilterStorage.addFilter(result.filter); 201 FilterStorage.addFilter(result.filter);
192 break; 202 break;
193 case "filters.blocked": 203 case "filters.blocked":
194 var filter = defaultMatcher.matchesAny(message.url, message.requestType, 204 var filter = defaultMatcher.matchesAny(message.url, message.requestType,
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 if (subscription instanceof DownloadableSubscription) 373 if (subscription instanceof DownloadableSubscription)
364 Synchronizer.execute(subscription, true); 374 Synchronizer.execute(subscription, true);
365 } 375 }
366 break; 376 break;
367 case "subscriptions.isDownloading": 377 case "subscriptions.isDownloading":
368 callback(Synchronizer.isExecuting(message.url)); 378 callback(Synchronizer.isExecuting(message.url));
369 break; 379 break;
370 } 380 }
371 }); 381 });
372 })(this); 382 })(this);
OLDNEW
« no previous file with comments | « no previous file | options.html » ('j') | options.js » ('J')

Powered by Google App Engine
This is Rietveld