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: Created Nov. 18, 2014, 3:57 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
@@ -68,8 +68,21 @@
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",
+ filters: filters
+ },
+
+ function(response)
+ {
+ if (response.status == "ok")
+ closeDialog(true);
+ else
+ alert(response.error);
Wladimir Palant 2014/11/18 16:35:03 I don't think this message is helpful without indi
Sebastian Noack 2014/11/18 17:42:55 I decided to keep things as simple as possible for
+ }
+ );
}
function closeDialog(success)

Powered by Google App Engine
This is Rietveld