1 rng.modules.rng = function(sandbox) {
\r
3 function addTab(title, slug, view) {
\r
4 sandbox.getModule('tabsManager').addTab(title, slug, view);
\r
7 /* Events handling */
\r
11 eventHandlers.skelton = {
\r
13 sandbox.getModule('tabsManager').start();
\r
17 eventHandlers.tabsManager = {
\r
19 sandbox.getModule('skelton').setMainView(sandbox.getModule('tabsManager').getView());
\r
20 _.each(['sourceEditor', 'visualEditor'], function(moduleName) {
\r
21 sandbox.getModule(moduleName).start();
\r
26 eventHandlers.sourceEditor = {
\r
28 addTab('Source', 'source', sandbox.getModule('sourceEditor').getView());
\r
32 eventHandlers.visualEditor = {
\r
34 addTab('Visual', 'visual', sandbox.getModule('visualEditor').getView());
\r
43 sandbox.getModule('skelton').start();
\r
45 handleEvent: function(moduleName, eventName, args) {
\r
46 if(eventHandlers[moduleName] && eventHandlers[moduleName][eventName]) {
\r
47 eventHandlers[moduleName][eventName].apply(eventHandlers, args);
\r