* Better "motto" display.
[redakcja.git] / platforma / static / js / wiki / view_summary.js
index f86d975..811096d 100644 (file)
@@ -2,7 +2,25 @@
 
        function SummaryPerspective(options) {
                var old_callback = options.callback;
+               var self = this;
+
         options.callback = function(){
+                       $('#publish_button').click(function() {
+                               $.blockUI({message: "Oczekiwanie na odpowiedź serwera..."});
+                               self.doc.publish({
+                                       success: function(doc, data) {
+                                               $.blockUI({message: "Udało się.", timeout: 2000});
+                                       },
+                                       failure: function(doc, message) {
+                                               $.blockUI({
+                                                       message: message,
+                                                       timeout: 5000
+                                               });
+                                       }
+
+                               });
+                       });
+
                        old_callback.call(this);
                };