Wydzielanie utworów. Closes #79 Closes #98
[redakcja.git] / project / static / js / editor.ui.js
index b27daac..41025fa 100755 (executable)
@@ -104,9 +104,9 @@ Editor.prototype.setupUI = function() {
 \r
     panel_root.bind('hpanel:panel-resize-start', resize_start);\r
     self.rootDiv.bind('stopResize', function() {\r
-        self.savePanelOptions()\r
+        self.savePanelOptions();      \r
     });\r
-\r
+    \r
     /*\r
      * Connect panel actions\r
      */\r
@@ -127,11 +127,17 @@ Editor.prototype.setupUI = function() {
             function() {\r
                 panel.refresh();\r
             } );\r
+\r
+        self.rootDiv.bind('stopResize', function() {\r
+            panel.callHook('toolbarResized');\r
+        });\r
     });\r
 \r
     $(document).bind('panel:contentChanged', function() {\r
         self.onContentChanged.apply(self, arguments)\r
     });\r
+    \r
+    \r
 \r
     /*\r
      * Connect various buttons\r
@@ -206,8 +212,8 @@ Editor.prototype.loadSplitDialog = function(hash)
         // put the form into the window\r
         $('div.container-box', hash.w).html(data);\r
         $("div.loading-box", hash.w).hide();\r
-        $('form input[name=splittext]', hash.w).val(hash.t.selection);\r
-        $('form input[name=fulltext]', hash.w).val(hash.t.fulltext);\r
+        $('form input[name=splitform-splittext]', hash.w).val(hash.t.selection);\r
+        $('form input[name=splitform-fulltext]', hash.w).val(hash.t.fulltext);\r
         $('div.container-box', hash.w).show();\r
 \r
         // connect buttons\r
@@ -225,6 +231,19 @@ Editor.prototype.loadSplitDialog = function(hash)
         $('#split-dialog-button-dismiss').click(function() {\r
             hash.w.jqmHide();\r
             $('div.container-box', hash.w).html('');\r
+            hash.t.success();\r
+        });\r
+\r
+        if($('#id_splitform-autoxml').is(':checked'))\r
+            $('#split-form-dc-subform').show();\r
+        else\r
+            $('#split-form-dc-subform').hide();\r
+\r
+        $('#id_splitform-autoxml').change(function() {            \r
+            if( $(this).is(':checked') )\r
+                $('#split-form-dc-subform').show();\r
+            else\r
+                $('#split-form-dc-subform').hide();\r
         });\r
     };   \r
 \r
@@ -250,8 +269,11 @@ Editor.prototype.refreshPanels = function() {
         else\r
             panel.refresh();\r
     });\r
-};\r
 \r
+    $('#toolbar-button-save').attr('disabled', 'disabled');\r
+    $('#toolbar-button-commit').removeAttr('disabled');\r
+    $('#toolbar-button-update').removeAttr('disabled');\r
+};\r
 \r
 /*\r
  * Pop-up messages\r