]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
UI for server errors.
authorSarven Capadisli <csarven@controlyourself.ca>
Fri, 24 Apr 2009 17:22:43 +0000 (17:22 +0000)
committerSarven Capadisli <csarven@controlyourself.ca>
Fri, 24 Apr 2009 17:22:43 +0000 (17:22 +0000)
js/util.js
theme/base/css/display.css

index 16422df57937311092926ef27a119f171b9eac14..15a14625c7b5bb643fb4a2031a5e70230ac28b54 100644 (file)
@@ -166,23 +166,14 @@ $(document).ready(function(){
                                                                                                                                                   $("#notice_action-submit").addClass("disabled");
                                                                                                                                                   return true;
                                                                                                                                                 },
-                                          timeout: 7000,
                                           error: function (xhr, textStatus, errorThrown) {     $("#form_notice").removeClass("processing");
                                                                                                                                                $("#notice_action-submit").removeAttr("disabled");
                                                                                                                                                $("#notice_action-submit").removeClass("disabled");
-
-                                                                                                                                               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");
+                                                                                                                                               if ($(".error", xhr.responseXML).length > 0) {
+                                                                                                                                                       $('#form_notice').append(document._importNode($(".error", xhr.responseXML).get(0), true));
                                                                                                                                                }
                                                                                                                                                else {
-                                                                                                                                                       switch(xhr.status) {
-                                                                                                                                                               default: case 404:
-                                                                                                                                                                       alert("Sorry! We had trouble sending your notice.  Please report the problem to the site administrator if this happens again.");
-                                                                                                                                                                       break;
-                                                                                                                                                               case 502: case 503: case 504:
-                                                                                                                                                                       alert("Sorry! We had trouble sending your notice. The servers are overloaded. Please try again, and contact the site administrator if this problem persists.");
-                                                                                                                                                                       break;
-                                                                                                                                                       }
+                                                                                                                                                       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) {
index 2fb1c007fc46abe5217859f458aa3dc5070226e3..0bc2e68b65afcf7f8af00ae8b853c7586f93736f 100644 (file)
@@ -86,7 +86,7 @@ border:0;
 
 .error,
 .success {
-padding:4px 7px;
+padding:4px 1.55%;
 border-radius:4px;
 -moz-border-radius:4px;
 -webkit-border-radius:4px;
@@ -426,6 +426,7 @@ line-height:1;
 #form_notice fieldset {
 border:0;
 padding:0;
+position:relative;
 }
 #form_notice legend {
 display:none;
@@ -480,7 +481,13 @@ margin-bottom:7px;
 margin-left:18px;
 float:left;
 }
-
+#form_notice .error {
+float:left;
+clear:both;
+width:96.9%;
+margin-bottom:0;
+line-height:1.618;
+}
 
 /* entity_profile */
 .entity_profile {