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

Unified Diff: options.js

Issue 4515985834901504: Issue 2664 - Remove ignoreHeaders argument from parseFilter(s) and move the logic to the UI (Closed)
Patch Set: Exclude filter list header errors using .forEach() Created June 8, 2015, 6:36 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/filterValidation.js ('k') | qunit/tests/filterValidation.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: options.js
===================================================================
--- a/options.js
+++ b/options.js
@@ -537,11 +537,16 @@
function importRawFiltersText()
{
var text = document.getElementById("rawFiltersText").value;
- var result = parseFilters(text, true);
+ var result = parseFilters(text);
- if (result.error)
+ var errors = result.errors.filter(function(e)
{
- alert(result.error);
+ return e.type != "unexpected-filter-list-header";
+ });
+
+ if (errors.length > 0)
+ {
+ alert(errors.join("\n"));
return;
}
« no previous file with comments | « lib/filterValidation.js ('k') | qunit/tests/filterValidation.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld