teh legendary `Publish' button, oh yeah!
[redakcja.git] / redakcja / static / js / wiki / view_history.js
index 4fe20e2..fe3af69 100644 (file)
                                self.showTagForm();
                        });
 
+                       $('#pubmark-changeset-button').click(function() {
+                               self.showPubmarkForm();
+                       });
+
                $('#doc-revert-button').click(function() {
                    self.revertDialog();
                });
                $.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);