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

Side by Side Diff: messageResponder.js

Issue 29488575: Issue 5384 - Introduced dedicated mobile options page (Closed)
Patch Set: Addressed mobile-options.js comments Created July 18, 2017, 5:39 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
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-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 }); 190 });
191 191
192 port.on("app.listen", (message, sender) => 192 port.on("app.listen", (message, sender) =>
193 { 193 {
194 getListenerFilters(sender.page).app = message.filter; 194 getListenerFilters(sender.page).app = message.filter;
195 }); 195 });
196 196
197 port.on("app.open", (message, sender) => 197 port.on("app.open", (message, sender) =>
198 { 198 {
199 if (message.what == "options") 199 if (message.what == "options")
200 ext.showOptions(); 200 {
201 ext.showOptions(() =>
202 {
203 if (!message.action)
204 return;
205
206 sendMessage("app", message.action, ...message.args);
207 });
208 }
201 }); 209 });
202 210
203 port.on("filters.add", (message, sender) => 211 port.on("filters.add", (message, sender) =>
204 { 212 {
205 let result = require("filterValidation").parseFilter(message.text); 213 let result = require("filterValidation").parseFilter(message.text);
206 let errors = []; 214 let errors = [];
207 if (result.error) 215 if (result.error)
208 errors.push(result.error.toString()); 216 errors.push(result.error.toString());
209 else if (result.filter) 217 else if (result.filter)
210 FilterStorage.addFilter(result.filter); 218 FilterStorage.addFilter(result.filter);
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 if (message.url) 432 if (message.url)
425 subscriptions = [Subscription.fromURL(message.url)]; 433 subscriptions = [Subscription.fromURL(message.url)];
426 434
427 for (let subscription of subscriptions) 435 for (let subscription of subscriptions)
428 { 436 {
429 if (subscription instanceof DownloadableSubscription) 437 if (subscription instanceof DownloadableSubscription)
430 Synchronizer.execute(subscription, true); 438 Synchronizer.execute(subscription, true);
431 } 439 }
432 }); 440 });
433 })(this); 441 })(this);
OLDNEW
« no previous file with comments | « locale/en-US/mobile-options.json ('k') | mobile-options.html » ('j') | mobile-options.js » ('J')

Powered by Google App Engine
This is Rietveld