X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/d64a8451dafc98e8f71455a55d123d22f3368ef9..36f6233fd79390ad5af8a1532eac60a0ae57c825:/platforma/static/js/wiki/view_history.js diff --git a/platforma/static/js/wiki/view_history.js b/platforma/static/js/wiki/view_history.js index 5a3e8131..b4a9dd8a 100644 --- a/platforma/static/js/wiki/view_history.js +++ b/platforma/static/js/wiki/view_history.js @@ -15,6 +15,20 @@ self.showTagForm(); }); + $('#open-preview-button').click(function(event) { + var selected = $('#changes-list .entry.selected'); + + if (selected.length != 1) { + window.alert("Wybierz dokładnie *jedną* wersję."); + return; + } + + var version = parseInt($("*[data-stub-value='version']", selected[0]).text()); + window.open($(this).attr('data-basehref') + "?revision=" + version); + + event.preventDefault(); + }); + $('#changes-list .entry').live('click', function(){ var $this = $(this); if ($this.hasClass('selected')) @@ -99,7 +113,7 @@ var selected = $('#changes-list .entry.selected'); if (selected.length != 1) { - window.alert("Musisz dokładnie jedną wersję do oznaczenia."); + window.alert("Musisz zaznaczyć dokładnie jedną wersję."); return; }