]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - js/util.js
Merge branch '0.7.x' into 0.8.x
[quix0rs-gnu-social.git] / js / util.js
index b712ba8e2be9bd24a8962d8b2dce2f933d52d5ea..786b763eeecb599c2df1fa8f327396b951cad090 100644 (file)
@@ -178,7 +178,14 @@ $(document).ready(function(){
                                                                                                                                                                $('#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.");
+                                                                                                                                                               var HTTP20x30x = [200, 201, 202, 203, 204, 205, 206, 300, 301, 302, 303, 304, 305, 306, 307];
+                                                                                                                                                               if(jQuery.inArray(parseInt(xhr.status), HTTP20x30x) < 0) {
+                                                                                                                                                                       alert("Sorry! We had trouble sending your notice ("+xhr.status+" "+xhr.statusText+"). Please report the problem to the site administrator if this happens again.");
+                                                                                                                                                               }
+                                                                                                                                                               else {
+                                                                                                                                                                       $("#notice_data-text").val("");
+                                                                                                                                                                       counter();
+                                                                                                                                                               }
                                                                                                                                                        }
                                                                                                                                                }
                                                                                                                                          },