X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/1fbf854ce423d2d56723ff10608267403f4916b0..a7a2b1c6daaa2266645abc5ee4fac91ce10a4c39:/redakcja/static/js/wiki/view_history.js?ds=sidebyside diff --git a/redakcja/static/js/wiki/view_history.js b/redakcja/static/js/wiki/view_history.js index d35a8da0..fe3af69a 100644 --- a/redakcja/static/js/wiki/view_history.js +++ b/redakcja/static/js/wiki/view_history.js @@ -15,8 +15,12 @@ self.showTagForm(); }); + $('#pubmark-changeset-button').click(function() { + self.showPubmarkForm(); + }); + $('#doc-revert-button').click(function() { - self.revertDocumentToVersion(); + self.revertDialog(); }); $('#open-preview-button').click(function(event) { @@ -109,9 +113,9 @@ stub: $stub, data: this, filters: { - tag: function(value) { - return tags.filter("*[value='"+value+"']").text(); - } +// tag: function(value) { +// return tags.filter("*[value='"+value+"']").text(); +// } // description: function(value) { // return value.replace('\n', '); // } @@ -140,6 +144,18 @@ $.wiki.showDialog('#add_tag_dialog', {'revision': version}); }; + HistoryPerspective.prototype.showPubmarkForm = function(){ + var selected = $('#changes-list .entry.selected'); + + if (selected.length != 1) { + window.alert("Musisz zaznaczyć dokładnie jedną wersję."); + return; + } + + var version = parseInt($("*[data-stub-value='version']", selected[0]).text()); + $.wiki.showDialog('#pubmark_dialog', {'revision': version}); + }; + HistoryPerspective.prototype.makeDiff = function() { var changelist = $('#changes-list'); var selected = $('.entry.selected', changelist); @@ -172,7 +188,8 @@ }); }; - HistoryPerspective.prototype.revertDocumentToVersion = function(){ + HistoryPerspective.prototype.revertDialog = function(){ + var self = this; var selected = $('#changes-list .entry.selected'); if (selected.length != 1) { @@ -181,7 +198,7 @@ } var version = parseInt($("*[data-stub-value='version']", selected[0]).text()); - this.doc.revertToVersion({'revision': version}); + $.wiki.showDialog('#revert_dialog', {revision: version}); }; $.wiki.HistoryPerspective = HistoryPerspective;