wip: Experimenting with new approach - dividing visualEditor module
[fnpeditor.git] / modules / skelton.js
index 0e6749a..28780f2 100644 (file)
@@ -1,8 +1,10 @@
-rng.modules.skelton = function(sandbox) {\r
+define(function() {\r
+\r
+return function(sandbox) {\r
     \r
     var view = $(sandbox.getTemplate('main')());\r
     \r
-    view.find('#rng-skelton-menu a').click(function(e) {\r
+    view.find('#rng-skelton-menu button').click(function(e) {\r
         e.preventDefault();\r
         sandbox.publish('cmd.' + $(e.target).attr('data-cmd'));\r
     });\r
@@ -14,6 +16,20 @@ rng.modules.skelton = function(sandbox) {
         },\r
         setMainView: function(mainView) {\r
             view.find('#rng-skelton-mainView').html(mainView);\r
+        },\r
+        showMessage: function(message) {\r
+            view.find('#rng-skelton-messages').html('<span>'+message+'</span>').show();\r
+        },\r
+        clearMessage: function() {\r
+            view.find('#rng-skelton-messages').empty().hide();\r
+        },\r
+        deactivateCommand: function(cmd) {\r
+            view.find('[data-cmd='+cmd+']').addClass('disabled');\r
+        },\r
+        activateCommand: function(cmd) {\r
+            view.find('[data-cmd='+cmd+']').removeClass('disabled');\r
         }\r
     }\r
-};
\ No newline at end of file
+};\r
+\r
+});
\ No newline at end of file