summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-05-03 21:37:05 -0700
committerEvan Prodromou <evan@controlyourself.ca>2009-05-03 21:37:05 -0700
commit2f7820b15ba29ba950a6aed1f3e1f21adb82cd7b (patch)
tree09d8c03f15dddebc5676415bc364e4254e4a3ef7
parent6a12598695637e7ebdc613977c797413957cc464 (diff)
parentdeb07487bd0802fa6a89cfc8ddd56af93945eb4c (diff)
Merge branch '0.7.x' of git@gitorious.org:laconica/dev into 0.7.x
-rw-r--r--js/util.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/js/util.js b/js/util.js
index f15c4f2bb..3f14bc61c 100644
--- a/js/util.js
+++ b/js/util.js
@@ -166,14 +166,20 @@ $(document).ready(function(){
$("#notice_action-submit").addClass("disabled");
return true;
},
+ timeout: '60000',
error: function (xhr, textStatus, errorThrown) { $("#form_notice").removeClass("processing");
$("#notice_action-submit").removeAttr("disabled");
$("#notice_action-submit").removeClass("disabled");
- if ($(".error", xhr.responseXML).length > 0) {
- $('#form_notice').append(document._importNode($(".error", xhr.responseXML).get(0), true));
+ 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");
}
else {
- alert("Sorry! We had trouble sending your notice ("+xhr.status+" "+xhr.statusText+"). Please report the problem to the site administrator if this happens again.");
+ if ($(".error", xhr.responseXML).length > 0) {
+ $('#form_notice').append(document._importNode($(".error", xhr.responseXML).get(0), true));
+ }
+ else {
+ 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) {
@@ -189,7 +195,6 @@ $(document).ready(function(){
}
else {
li = $("li", xml).get(0);
- id = li.id;
if ($("#"+li.id).length == 0) {
$("#notices_primary .notices").prepend(document._importNode(li, true));
$("#notices_primary .notice:first").css({display:"none"});