X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/c52436a7e25876ee3509df2467c2a9ef33303436..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 f7f2a287..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')) @@ -71,7 +85,7 @@ var $stub = $('#history-view .row-stub'); changes_list.html(''); - var tags = $('select#id_tag option'); + var tags = $('select#id_addtag-tag option'); $.each(data, function(){ $.wiki.renderStub({ @@ -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; }