summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-04-24 13:31:18 -0400
committerEvan Prodromou <evan@controlyourself.ca>2009-04-24 13:31:18 -0400
commit5e7664e25f6c4b93d32bc1ef33463c09205ff679 (patch)
tree07d119e4d77fc866c011bc1701ef7d54db481ee4 /js
parentecb09fb8646def7f6a7c5fc0fc2d4df6676edd06 (diff)
parent12867d114d8d40bf9a45b3e1eb9b0e50d736d333 (diff)
Merge branch '0.7.x' of git@gitorious.org:laconica/dev into 0.7.x
Diffstat (limited to 'js')
-rw-r--r--js/util.js15
1 files changed, 3 insertions, 12 deletions
diff --git a/js/util.js b/js/util.js
index 16422df57..15a14625c 100644
--- a/js/util.js
+++ b/js/util.js
@@ -166,23 +166,14 @@ $(document).ready(function(){
$("#notice_action-submit").addClass("disabled");
return true;
},
- timeout: 7000,
error: function (xhr, textStatus, errorThrown) { $("#form_notice").removeClass("processing");
$("#notice_action-submit").removeAttr("disabled");
$("#notice_action-submit").removeClass("disabled");
-
- if (textStatus == "timeout") {
- alert ("Sorry! We had trouble sending your notice. The servers are overloaded. Please try again, and contact the site administrator if this problem persists");
+ if ($(".error", xhr.responseXML).length > 0) {
+ $('#form_notice').append(document._importNode($(".error", xhr.responseXML).get(0), true));
}
else {
- switch(xhr.status) {
- default: case 404:
- alert("Sorry! We had trouble sending your notice. Please report the problem to the site administrator if this happens again.");
- break;
- case 502: case 503: case 504:
- alert("Sorry! We had trouble sending your notice. The servers are overloaded. Please try again, and contact the site administrator if this problem persists.");
- break;
- }
+ alert("Sorry! We had trouble sending your notice ("+xhr.status+" "+xhr.statusText+"). Please report the problem to the site administrator if this happens again.");
}
},
success: function(xml) { if ($("#error", xml).length > 0) {