| OLD | NEW |
| 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 169 |
| 170 if (params.filterError) | 170 if (params.filterError) |
| 171 return {error: "Invalid filter"}; | 171 return {error: "Invalid filter"}; |
| 172 return {filter: modules.filterClasses.Filter.fromText(text)}; | 172 return {filter: modules.filterClasses.Filter.fromText(text)}; |
| 173 }, | 173 }, |
| 174 parseFilters: function(text) | 174 parseFilters: function(text) |
| 175 { | 175 { |
| 176 if (params.filterError) | 176 if (params.filterError) |
| 177 return {errors: ["Invalid filter"]}; | 177 return {errors: ["Invalid filter"]}; |
| 178 return { | 178 return { |
| 179 filters: text.split("\n").map(modules.filterClasses.Filter.fromText), | 179 filters: text.split("\n") |
| 180 .filter(function(filter) {return !!filter;}) |
| 181 .map(modules.filterClasses.Filter.fromText), |
| 180 errors: [] | 182 errors: [] |
| 181 }; | 183 }; |
| 182 } | 184 } |
| 183 }; | 185 }; |
| 184 | 186 |
| 185 modules.synchronizer = { | 187 modules.synchronizer = { |
| 186 Synchronizer: {} | 188 Synchronizer: {} |
| 187 }; | 189 }; |
| 188 | 190 |
| 189 modules.matcher = { | 191 modules.matcher = { |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 type: "message", | 294 type: "message", |
| 293 payload: { | 295 payload: { |
| 294 title: "Custom subscription", | 296 title: "Custom subscription", |
| 295 url: "http://example.com/custom.txt", | 297 url: "http://example.com/custom.txt", |
| 296 type: "add-subscription" | 298 type: "add-subscription" |
| 297 } | 299 } |
| 298 }, "*"); | 300 }, "*"); |
| 299 }, 1000); | 301 }, 1000); |
| 300 } | 302 } |
| 301 })(this); | 303 })(this); |
| OLD | NEW |