Visual editor - styling header margin
[fnpeditor.git] / modules / skelton.js
1 rng.modules.skelton = function(sandbox) {\r
2     \r
3     var view = $(sandbox.getTemplate('main')());\r
4     \r
5     view.find('#rng-skelton-menu button').click(function(e) {\r
6         e.preventDefault();\r
7         sandbox.publish('cmd.' + $(e.target).attr('data-cmd'));\r
8     });\r
9     \r
10     return {\r
11         start: function() {\r
12             sandbox.getDOM().append(view);\r
13             sandbox.publish('ready');\r
14         },\r
15         setMainView: function(mainView) {\r
16             view.find('#rng-skelton-mainView').html(mainView);\r
17         },\r
18         showMessage: function(message) {\r
19             view.find('#rng-skelton-messages').html('<span>'+message+'</span>').show();\r
20         },\r
21         clearMessage: function() {\r
22             view.find('#rng-skelton-messages').empty().hide();\r
23         },\r
24         deactivateCommand: function(cmd) {\r
25             view.find('[data-cmd='+cmd+']').addClass('disabled');\r
26         },\r
27         activateCommand: function(cmd) {\r
28             view.find('[data-cmd='+cmd+']').removeClass('disabled');\r
29         }\r
30     }\r
31 };