diff options
author | Robin Millette <millette@controlyourself.ca> | 2009-04-24 20:01:25 +0000 |
---|---|---|
committer | Robin Millette <millette@controlyourself.ca> | 2009-04-24 20:01:25 +0000 |
commit | f2f4e8c5868ef7fee694590c17bacec4e01e3b9b (patch) | |
tree | 78df1002c3cfc902e5b16cbe858e3efa675a2f14 /js/util.js | |
parent | c008c0d4a56ec265ba6e10d208f9954510296f12 (diff) | |
parent | 5e7664e25f6c4b93d32bc1ef33463c09205ff679 (diff) |
Merge branch '0.7.x' of git@gitorious.org:laconica/dev into 0.7.x
Diffstat (limited to 'js/util.js')
-rw-r--r-- | js/util.js | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/js/util.js b/js/util.js index 53e6eb792..15a14625c 100644 --- a/js/util.js +++ b/js/util.js @@ -166,6 +166,16 @@ $(document).ready(function(){ $("#notice_action-submit").addClass("disabled"); return true; }, + 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)); + } + 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) { var result = document._importNode($("p", xml).get(0), true); result = result.textContent || result.innerHTML; @@ -192,10 +202,8 @@ $(document).ready(function(){ $("#notice_action-submit").removeClass("disabled"); } }; - if (document.body.id != 'inbox' && document.body.id != 'outbox') { - $("#form_notice").ajaxForm(PostNotice); - $("#form_notice").each(addAjaxHidden); - } + $("#form_notice").ajaxForm(PostNotice); + $("#form_notice").each(addAjaxHidden); NoticeHover(); NoticeReply(); }); |