]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
form_notice textarea is cleared on successful direct message post.
authorSarven Capadisli <csarven@controlyourself.ca>
Thu, 16 Apr 2009 21:57:42 +0000 (21:57 +0000)
committerSarven Capadisli <csarven@controlyourself.ca>
Thu, 16 Apr 2009 21:57:42 +0000 (21:57 +0000)
Disabled notice posting with XHR on Inbox and Outbox pages. This will
be revisited in 0.8.x.

js/util.js

index 81139744ff9cdab7eb928df3f2e83a5df5611562..38d2a9a424febe7a067aba0199131f705d8b13d6 100644 (file)
@@ -166,28 +166,36 @@ $(document).ready(function(){
                                                                                                                                                   $("#notice_action-submit").addClass("disabled");
                                                                                                                                                   return true;
                                                                                                                                                 },
-                                          success: function(xml) {     if ($("#error", xml).length > 0 || $("#command_result", xml).length > 0) {
+                                          success: function(xml) {     if ($("#error", xml).length > 0) {
                                                                                                        var result = document._importNode($("p", xml).get(0), true);
                                                                                                        result = result.textContent || result.innerHTML;
                                                                                                        alert(result);
                                                                                                }
                                                                                                else {
-                                                                                                       $("#notices_primary .notices").prepend(document._importNode($("li", xml).get(0), true));
+                                                                                                   if ($("#command_result", xml).length > 0) {
+                                                                                                           var result = document._importNode($("p", xml).get(0), true);
+                                                                                                           result = result.textContent || result.innerHTML;
+                                                                                                           alert(result);
+                                                    }
+                                                    else {
+                                                                                                           $("#notices_primary .notices").prepend(document._importNode($("li", xml).get(0), true));
+                                                                                                           counter();
+                                                                                                           $("#notices_primary .notice:first").css({display:"none"});
+                                                                                                           $("#notices_primary .notice:first").fadeIn(2500);
+                                                                                                           NoticeHover();
+                                                                                                           NoticeReply();
+                                                                                                       }
                                                                                                        $("#notice_data-text").val("");
-                                                                                                       counter();
-                                                                                                       $("#notices_primary .notice:first").css({display:"none"});
-                                                                                                       $("#notices_primary .notice:first").fadeIn(2500);
-                                                                                                       NoticeHover();
-                                                                                                       NoticeReply();
                                                                                                }
                                                                                                $("#form_notice").removeClass("processing");
                                                                                                $("#notice_action-submit").removeAttr("disabled");
                                                                                                $("#notice_action-submit").removeClass("disabled");
                                                                                         }
                                           };
-       $("#form_notice").ajaxForm(PostNotice);
-       $("#form_notice").each(addAjaxHidden);
-
+    if (document.body.id  != 'inbox' && document.body.id != 'outbox') {
+           $("#form_notice").ajaxForm(PostNotice);
+           $("#form_notice").each(addAjaxHidden);
+    }
     NoticeHover();
     NoticeReply();
 });