2 * Dialog for marking document for publishing
7 class PubmarkDialog extends $.wiki.cls.GenericDialog {
8 constructor(element, options) {
9 if (!options.revision && options.revision != 0)
10 throw "PubmarkDialog needs a revision number.";
12 let ctx = $.wiki.exitContext();
17 /* fill out hidden fields */
18 this.$form = $('form', element);
20 $("input[name='pubmark-id']", this.$form).val(CurrentDocument.id);
21 $("input[name='pubmark-revision']", this.$form).val(options.revision);
22 if (options.approved) {
23 $("input[name='pubmark-publishable']", this.$form).prop('checked');
25 $("input[name='pubmark-publishable']", this.$form).removeProp('checked');
30 $.wiki.enterContext(this.ctx);
38 message: "Oznaczanie wersji",
42 CurrentDocument.pubmark({
44 success: function(doc, changed, info){
49 onUnblock: function(){
51 $.wiki.enterContext(self.ctx);
55 failure: function(doc, info){
56 console.log("Failure", info);
57 self.reportErrors(info);
65 $.wiki.cls.PubmarkDialog = PubmarkDialog;