X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/5913c54d19b8f6775633176032161d49f9b2f1aa..e6c778f6e92e584815a14d3e6a31a03a5e2ab7e1:/src/redakcja/static/js/wiki/dialog_pubmark.js diff --git a/src/redakcja/static/js/wiki/dialog_pubmark.js b/src/redakcja/static/js/wiki/dialog_pubmark.js old mode 100755 new mode 100644 index 902a737c..6d20493c --- a/src/redakcja/static/js/wiki/dialog_pubmark.js +++ b/src/redakcja/static/js/wiki/dialog_pubmark.js @@ -4,29 +4,30 @@ */ (function($){ - function PubmarkDialog(element, options){ - if (!options.revision && options.revision != 0) - throw "PubmarkDialog needs a revision number."; + class PubmarkDialog extends $.wiki.cls.GenericDialog { + constructor(element, options) { + if (!options.revision && options.revision != 0) + throw "PubmarkDialog needs a revision number."; - this.ctx = $.wiki.exitContext(); - this.clearForm(); + let ctx = $.wiki.exitContext(); + super(element); + this.ctx = ctx; + this.clearForm(); - /* fill out hidden fields */ - this.$form = $('form', element); + /* fill out hidden fields */ + this.$form = $('form', element); - $("input[name='pubmark-id']", this.$form).val(CurrentDocument.id); - $("input[name='pubmark-revision']", this.$form).val(options.revision); + $("input[name='pubmark-id']", this.$form).val(CurrentDocument.id); + $("input[name='pubmark-revision']", this.$form).val(options.revision); - $.wiki.cls.GenericDialog.call(this, element); - }; + } - PubmarkDialog.prototype = $.extend(new $.wiki.cls.GenericDialog(), { - cancelAction: function(){ + cancelAction() { $.wiki.enterContext(this.ctx); this.hide(); - }, + } - saveAction: function(){ + saveAction() { var self = this; self.$elem.block({ @@ -54,7 +55,7 @@ } }); } - }); + } /* make it global */ $.wiki.cls.PubmarkDialog = PubmarkDialog;