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...",
37 CurrentDocument.save({
39 success: function(doc, changed, info){
44 onUnblock: function() {
46 $.wiki.enterContext(self.ctx);
50 failure: function(doc, info) {
51 console.log("Failure", info);
52 self.reportErrors(info);
57 console.log('Exception:', e)
60 }; /* end of save dialog */
63 $.wiki.cls.SaveDialog = SaveDialog;