2 * Dialog for saving document to the server
7 function SaveDialog(element) {
8 this.ctx = $.wiki.exitContext();
11 /* fill out hidden fields */
12 this.$form = $('form', element);
14 $("input[name='textsave-id']", this.$form).val(CurrentDocument.id);
15 $("input[name='textsave-parent_revision']", this.$form).val(CurrentDocument.revision);
17 $.wiki.cls.GenericDialog.call(this, element);
20 SaveDialog.prototype = new $.wiki.cls.GenericDialog();
22 SaveDialog.prototype.cancelAction = function() {
23 $.wiki.enterContext(this.ctx);
27 SaveDialog.prototype.saveAction = function() {
31 message: "Zapisywanie... <br/><button id='save-hide'>ukryj</button>",
34 $.wiki.blocking = self.$elem;
38 CurrentDocument.save({
40 success: function(doc, changed, info){
45 onUnblock: function() {
47 $.wiki.enterContext(self.ctx);
51 failure: function(doc, info) {
52 console.log("Failure", info);
53 self.reportErrors(info);
58 console.log('Exception:', e)
61 }; /* end of save dialog */
64 $.wiki.cls.SaveDialog = SaveDialog;