parse output of add.php, decide whether to show error or success.

This commit is contained in:
Promofaux
2016-06-10 22:16:10 +01:00
committed by Jacob Salmela
parent c75f167392
commit 0cab80cf91
+10 -2
View File
@@ -85,8 +85,15 @@ function add() {
method: "post",
data: {"domain":domain.val(), "list":list_type, "token":token},
success: function(response) {
if(response.length !== 0)
return;
if (response.indexOf("not a valid argument")>=0) {
alFailure.show();
alFailure.delay(1000).fadeOut(2000, function() {
alFailure.hide();
});
alInfo.delay(1000).fadeOut(2000, function() {
alInfo.hide();
});
} else {
alSuccess.show();
alSuccess.delay(1000).fadeOut(2000, function() {
alSuccess.hide();
@@ -96,6 +103,7 @@ function add() {
});
domain.val("");
refresh(true);
}
},
error: function(jqXHR, exception) {
alFailure.show();