summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@controlyourself.ca>2009-05-01 00:16:25 +0000
committerSarven Capadisli <csarven@controlyourself.ca>2009-05-01 00:16:25 +0000
commitd30df0790818d77b81ee8b271b9bd8ebe3063ee7 (patch)
treed3a9b32815252caabcf16f593fbf4e2080cff93f /js
parentf798d1ea430d25c2f4a60179c65b39b1257a5340 (diff)
parentb79fef307481b36b4d04dbabb54e3f6d9edf6896 (diff)
Merge branch '0.7.x' into 0.8.x
Resolved Conflicts: lib/queuehandler.php lib/util.php theme/base/css/display.css
Diffstat (limited to 'js')
-rw-r--r--js/util.js30
1 files changed, 21 insertions, 9 deletions
diff --git a/js/util.js b/js/util.js
index 53e6eb792..f15c4f2bb 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;
@@ -178,11 +188,15 @@ $(document).ready(function(){
alert(result);
}
else {
- $("#notices_primary .notices").prepend(document._importNode($("li", xml).get(0), true));
- $("#notices_primary .notice:first").css({display:"none"});
- $("#notices_primary .notice:first").fadeIn(2500);
- NoticeHover();
- NoticeReply();
+ 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"});
+ $("#notices_primary .notice:first").fadeIn(2500);
+ NoticeHover();
+ NoticeReply();
+ }
}
$("#notice_data-text").val("");
counter();
@@ -192,10 +206,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();
});