2 * Dialog for saving document to the server
7 function AddTagDialog(element, options){
8 if (!options.revision && options.revision != 0)
9 throw "AddTagDialog needs a revision number.";
11 this.ctx = $.wiki.exitContext();
14 /* fill out hidden fields */
15 this.$form = $('form', element);
17 $("input[name='addtag-id']", this.$form).val(CurrentDocument.id);
18 $("input[name='addtag-revision']", this.$form).val(options.revision);
20 $.wiki.cls.GenericDialog.call(this, element);
23 AddTagDialog.prototype = $.extend(new $.wiki.cls.GenericDialog(), {
24 cancelAction: function(){
25 $.wiki.enterContext(this.ctx);
29 saveAction: function(){
33 message: "Dodawanie tagu",
37 CurrentDocument.setTag({
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);
60 $.wiki.cls.AddTagDialog = AddTagDialog;