revert all the timeout stuff
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Tue, 3 Aug 2010 11:02:51 +0000 (13:02 +0200)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Tue, 3 Aug 2010 11:02:51 +0000 (13:02 +0200)
redakcja/static/js/wiki/base.js
redakcja/static/js/wiki/wikiapi.js

index 3fa47cc..61a3949 100644 (file)
                reportErrors: function(errors) {
                        var global = $("*[data-ui-error-for='__all__']", this.$elem);
                        var unassigned = [];
-                       var unassigned_text = '';
 
                        for (var field_name in errors)
                        {
 
                                if(!span.length) {
                                        unassigned.push(field_name);
-                                       unassigned_text += errors[field_name];
                                        continue;
                                }
 
                        }
 
                        if(unassigned.length > 0)
-                               global.text( global.text() + unassigned_text);
+                               global.text( global.text() + 'W formularzu wystąpiły błędy');
                }
        };
 
index 87fbdac..27ab97e 100644 (file)
                        type: "POST",
                        dataType: "json",
                        data: data,
-                       timeout: 15000,
                        success: function(data) {
                                var changed = false;
 
 
                                params['success'](self, changed, ((changed && "Udało się zapisać :)") || "Twoja wersja i serwera jest identyczna"));
                        },
-                       error: function(xhr, msg) {
-                               if (msg == 'timeout') {
-                                       params['failure'](self, {
-                        "__message": "Przekroczony czas połączenia. Zmiany nie zostały zapisane."
-                    });
-                               }
-                               else {
-                    try {
-                        params['failure'](self, $.parseJSON(xhr.responseText));
-                    }
-                    catch (e) {
-                        params['failure'](self, {
-                            "__message": "Nie udało się zapisać - błąd serwera."
-                        });
-                    };
+                       error: function(xhr) {
+                               try {
+                                       params['failure'](self, $.parseJSON(xhr.responseText));
                                }
+                               catch (e) {
+                                       params['failure'](self, {
+                                               "__message": "<p>Nie udało się zapisać - błąd serwera.</p>"
+                                       });
+                               };
+
                        }
                });
        }; /* end of save() */