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

Unified Diff: block.js

Issue 5279235799252992: Issue 491 - Validate custom filters (Closed)
Patch Set: Addressed comments Created Nov. 20, 2014, 3:35 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: block.js
===================================================================
--- a/block.js
+++ b/block.js
@@ -64,12 +64,20 @@
function addFilters()
{
- // Tell the background page to add the filters
- var filters = document.getElementById("filters").value.split(/[\r\n]+/)
- .map(function(f) {return f.replace(/^\s+/, "").replace(/\s+$/, "");})
- .filter(function(f) {return f != "";});
- ext.backgroundPage.sendMessage({type: "add-filters", filters: filters});
- closeDialog(true);
+ ext.backgroundPage.sendMessage(
+ {
+ type: "add-filters",
+ text: document.getElementById("filters").value
+ },
+
+ function(response)
+ {
+ if (response.status == "ok")
+ closeDialog(true);
+ else
+ alert(response.error);
+ }
+ );
}
function closeDialog(success)
« no previous file with comments | « background.js ('k') | lib/filterValidation.js » ('j') | qunit/tests/filterValidation.js » ('J')

Powered by Google App Engine
This is Rietveld