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: Created June 8, 2015, 4:46 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
Index: options.js
===================================================================
--- a/options.js
+++ b/options.js
@@ -537,11 +537,19 @@
function importRawFiltersText()
{
var text = document.getElementById("rawFiltersText").value;
- var result = parseFilters(text, true);
+ var result = parseFilters(text);
- if (result.error)
+ var errors = [];
+ for (var i = 0; i < result.errors.length; i++)
{
- alert(result.error);
+ var error = result.errors[i];
+ if (error.type != "unexpected-filter-list-header")
+ errors.push(error);
+ }
Wladimir Palant 2015/06/08 18:15:47 Why not: var errors = result.errors.filter(fun
Sebastian Noack 2015/06/08 18:36:46 Done.
+
+ if (errors.length > 0)
+ {
+ alert(errors.join("\n"));
return;
}

Powered by Google App Engine
This is Rietveld