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

Delta Between Two Patch Sets: messageResponder.js

Issue 29321198: Issue 2376 - Implement custom filters in new options page (Closed)
Left Patch Set: Sebastian requested fixes Created July 14, 2015, 1:51 p.m.
Right Patch Set: Nit fixes Created July 15, 2015, 2: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 | « locale/en-US/options.json ('k') | options.html » ('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 /* 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 break; 179 break;
180 case "app.open": 180 case "app.open":
181 if (message.what == "options") 181 if (message.what == "options")
182 ext.showOptions(); 182 ext.showOptions();
183 break; 183 break;
184 case "filters.add": 184 case "filters.add":
185 var filter = Filter.fromText(message.text); 185 var filter = Filter.fromText(message.text);
186 var result = filterValidation.parseFilter(message.text); 186 var result = filterValidation.parseFilter(message.text);
187 if (result.error) 187 if (result.error)
188 sendMessage("app", "error", [result.error.toString()], sender.page); 188 sendMessage("app", "error", [result.error.toString()], sender.page);
189 else 189 else if (result.filter)
190 FilterStorage.addFilter(result.filter); 190 FilterStorage.addFilter(result.filter);
191 break; 191 break;
192 case "filters.blocked": 192 case "filters.blocked":
193 var filter = defaultMatcher.matchesAny(message.url, message.requestType, 193 var filter = defaultMatcher.matchesAny(message.url, message.requestType,
194 message.docDomain, message.thirdParty); 194 message.docDomain, message.thirdParty);
195 callback(filter instanceof BlockingFilter); 195 callback(filter instanceof BlockingFilter);
196 break; 196 break;
197 case "filters.get": 197 case "filters.get":
198 var subscription = Subscription.fromURL(message.subscriptionUrl); 198 var subscription = Subscription.fromURL(message.subscriptionUrl);
199 if (!subscription) 199 if (!subscription)
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 subscription.title = message.title; 317 subscription.title = message.title;
318 subscription.homepage = message.homepage; 318 subscription.homepage = message.homepage;
319 FilterStorage.addSubscription(subscription); 319 FilterStorage.addSubscription(subscription);
320 if (!subscription.lastDownload) 320 if (!subscription.lastDownload)
321 Synchronizer.execute(subscription); 321 Synchronizer.execute(subscription);
322 } 322 }
323 break; 323 break;
324 } 324 }
325 }); 325 });
326 })(this); 326 })(this);
LEFTRIGHT

Powered by Google App Engine
This is Rietveld