* Readonly document view.
[redakcja.git] / platforma / static / js / wiki / view_history.js
index f7f2a28..b4a9dd8 100644 (file)
                                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({
                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;
         }