document stages on import,
[redakcja.git] / redakcja / static / js / wiki / view_history.js
index d35a8da..fe3af69 100644 (file)
                                self.showTagForm();
                        });
 
                                self.showTagForm();
                        });
 
+                       $('#pubmark-changeset-button').click(function() {
+                               self.showPubmarkForm();
+                       });
+
                $('#doc-revert-button').click(function() {
                $('#doc-revert-button').click(function() {
-                   self.revertDocumentToVersion();
+                   self.revertDialog();
                });
 
                        $('#open-preview-button').click(function(event) {
                });
 
                        $('#open-preview-button').click(function(event) {
                                        stub: $stub,
                                        data: this,
                                        filters: {
                                        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', ');
 //                                             }
 //                        description: function(value) {
 //                                                 return value.replace('\n', ');
 //                                             }
                $.wiki.showDialog('#add_tag_dialog', {'revision': version});
        };
 
                $.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);
        HistoryPerspective.prototype.makeDiff = function() {
         var changelist = $('#changes-list');
         var selected = $('.entry.selected', changelist);
         });
     };
 
         });
     };
 
-    HistoryPerspective.prototype.revertDocumentToVersion = function(){
+    HistoryPerspective.prototype.revertDialog = function(){
+        var self = this;
         var selected = $('#changes-list .entry.selected');
 
         if (selected.length != 1) {
         var selected = $('#changes-list .entry.selected');
 
         if (selected.length != 1) {
         }
 
         var version = parseInt($("*[data-stub-value='version']", selected[0]).text());
         }
 
         var version = parseInt($("*[data-stub-value='version']", selected[0]).text());
-        this.doc.revertToVersion({'revision': version});
+        $.wiki.showDialog('#revert_dialog', {revision: version});
     };
 
     $.wiki.HistoryPerspective = HistoryPerspective;
     };
 
     $.wiki.HistoryPerspective = HistoryPerspective;