Cleanup - moving rng module file to its own directory
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Wed, 5 Jun 2013 14:28:49 +0000 (16:28 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Wed, 5 Jun 2013 14:28:49 +0000 (16:28 +0200)
modules.js
modules/rng.js [deleted file]
modules/rng/rng.js [new file with mode: 0644]

index fb30410..0e073f1 100644 (file)
@@ -5,7 +5,7 @@ define(function(require) {
     */\r
     return {\r
         data: require('modules/data'),\r
     */\r
     return {\r
         data: require('modules/data'),\r
-        rng: require('modules/rng'),\r
+        rng: require('modules/rng/rng'),\r
         mainBar: require('modules/mainBar/mainBar'),\r
         indicator: require('modules/indicator/indicator'),\r
         \r
         mainBar: require('modules/mainBar/mainBar'),\r
         indicator: require('modules/indicator/indicator'),\r
         \r
diff --git a/modules/rng.js b/modules/rng.js
deleted file mode 100644 (file)
index f87aa17..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-define([\r
-'fnpjs/layout',\r
-'views/tabs/tabs',\r
-'libs/text!./rng/mainLayout.html'\r
-], function(layout, tabs, mainLayoutTemplate) {\r
-\r
-return function(sandbox) {\r
-    'use strict';\r
-    \r
-    var mainTabs = (new tabs.View()).render();\r
-    var mainLayout = new layout.Layout(mainLayoutTemplate);\r
-    sandbox.getDOM().append(mainLayout.getAsView());\r
-    \r
-    function addTab(title, slug, view) {\r
-        mainTabs.addTab(title, slug, view);\r
-    }\r
-    \r
-    /* Events handling */\r
-    \r
-    var eventHandlers = {};\r
-     \r
-    eventHandlers.sourceEditor = {\r
-        ready: function() {\r
-            addTab(gettext('Source'), 'source',  sandbox.getModule('sourceEditor').getView());\r
-            sandbox.getModule('sourceEditor').setDocument(sandbox.getModule('data').getDocument());\r
-        }\r
-    };\r
-    \r
-    eventHandlers.visualEditor = {\r
-        ready: function() {\r
-            sandbox.getModule('visualEditor').setDocument(sandbox.getModule('data').getDocument());\r
-            addTab(gettext('Visual'), 'visual', sandbox.getModule('visualEditor').getView());\r
-            \r
-        }\r
-    };\r
-    \r
-    eventHandlers.data = {\r
-        ready: function() {\r
-            mainLayout.setView('mainView', mainTabs.getAsView());\r
-            \r
-            _.each(['visualEditor', 'sourceEditor', 'rng2', 'mainBar', 'indicator'], function(moduleName) {\r
-                sandbox.getModule(moduleName).start();\r
-            });\r
-        },\r
-        documentChanged: function(document, reason) {\r
-            var slug = (reason === 'visual_edit' ? 'source' : 'visual');\r
-            sandbox.getModule(slug+'Editor').setDocument(document);\r
-        },\r
-        savingStarted: function() {\r
-            sandbox.getModule('mainBar').setCommandEnabled('save', false);\r
-            sandbox.getModule('indicator').showMessage(gettext('Saving...'));\r
-        },\r
-        savingEnded: function(status) {\r
-            sandbox.getModule('mainBar').setCommandEnabled('save', true);\r
-            sandbox.getModule('indicator').clearMessage();\r
-        }\r
-    }\r
-    \r
-    eventHandlers.rng2 = {\r
-        ready: function() {\r
-           addTab('rng2 test', 'rng2test', sandbox.getModule('rng2').getView());\r
-           \r
-        }\r
-    }\r
-    \r
-    eventHandlers.mainBar = {\r
-        ready: function() {\r
-            mainLayout.setView('topPanel', sandbox.getModule('mainBar').getView());\r
-        },\r
-        'cmd.save': function() {\r
-            sandbox.getModule('data').fakeSave();\r
-        }\r
-    }\r
-    \r
-    eventHandlers.indicator = {\r
-        ready: function() {\r
-            mainLayout.setView('messages', sandbox.getModule('indicator').getView());\r
-        }\r
-    }\r
-    \r
-    /* api */\r
-    \r
-    return {\r
-        start: function() {\r
-            sandbox.getModule('data').start();\r
-        },\r
-        handleEvent: function(moduleName, eventName, args) {\r
-            if('')\r
-                wysiwigHandler.handleEvent(moduleName, eventName, args);\r
-            else if(eventHandlers[moduleName] && eventHandlers[moduleName][eventName]) {\r
-                eventHandlers[moduleName][eventName].apply(eventHandlers, args);\r
-            }\r
-        }\r
-    }\r
-};\r
-\r
-});
\ No newline at end of file
diff --git a/modules/rng/rng.js b/modules/rng/rng.js
new file mode 100644 (file)
index 0000000..4b9aecf
--- /dev/null
@@ -0,0 +1,97 @@
+define([\r
+'fnpjs/layout',\r
+'views/tabs/tabs',\r
+'libs/text!./mainLayout.html'\r
+], function(layout, tabs, mainLayoutTemplate) {\r
+\r
+return function(sandbox) {\r
+    'use strict';\r
+    \r
+    var mainTabs = (new tabs.View()).render();\r
+    var mainLayout = new layout.Layout(mainLayoutTemplate);\r
+    sandbox.getDOM().append(mainLayout.getAsView());\r
+    \r
+    function addTab(title, slug, view) {\r
+        mainTabs.addTab(title, slug, view);\r
+    }\r
+    \r
+    /* Events handling */\r
+    \r
+    var eventHandlers = {};\r
+     \r
+    eventHandlers.sourceEditor = {\r
+        ready: function() {\r
+            addTab(gettext('Source'), 'source',  sandbox.getModule('sourceEditor').getView());\r
+            sandbox.getModule('sourceEditor').setDocument(sandbox.getModule('data').getDocument());\r
+        }\r
+    };\r
+    \r
+    eventHandlers.visualEditor = {\r
+        ready: function() {\r
+            sandbox.getModule('visualEditor').setDocument(sandbox.getModule('data').getDocument());\r
+            addTab(gettext('Visual'), 'visual', sandbox.getModule('visualEditor').getView());\r
+            \r
+        }\r
+    };\r
+    \r
+    eventHandlers.data = {\r
+        ready: function() {\r
+            mainLayout.setView('mainView', mainTabs.getAsView());\r
+            \r
+            _.each(['visualEditor', 'sourceEditor', 'rng2', 'mainBar', 'indicator'], function(moduleName) {\r
+                sandbox.getModule(moduleName).start();\r
+            });\r
+        },\r
+        documentChanged: function(document, reason) {\r
+            var slug = (reason === 'visual_edit' ? 'source' : 'visual');\r
+            sandbox.getModule(slug+'Editor').setDocument(document);\r
+        },\r
+        savingStarted: function() {\r
+            sandbox.getModule('mainBar').setCommandEnabled('save', false);\r
+            sandbox.getModule('indicator').showMessage(gettext('Saving...'));\r
+        },\r
+        savingEnded: function(status) {\r
+            sandbox.getModule('mainBar').setCommandEnabled('save', true);\r
+            sandbox.getModule('indicator').clearMessage();\r
+        }\r
+    }\r
+    \r
+    eventHandlers.rng2 = {\r
+        ready: function() {\r
+           addTab('rng2 test', 'rng2test', sandbox.getModule('rng2').getView());\r
+           \r
+        }\r
+    }\r
+    \r
+    eventHandlers.mainBar = {\r
+        ready: function() {\r
+            mainLayout.setView('topPanel', sandbox.getModule('mainBar').getView());\r
+        },\r
+        'cmd.save': function() {\r
+            sandbox.getModule('data').fakeSave();\r
+        }\r
+    }\r
+    \r
+    eventHandlers.indicator = {\r
+        ready: function() {\r
+            mainLayout.setView('messages', sandbox.getModule('indicator').getView());\r
+        }\r
+    }\r
+    \r
+    /* api */\r
+    \r
+    return {\r
+        start: function() {\r
+            sandbox.getModule('data').start();\r
+        },\r
+        handleEvent: function(moduleName, eventName, args) {\r
+            if('')\r
+                wysiwigHandler.handleEvent(moduleName, eventName, args);\r
+            else if(eventHandlers[moduleName] && eventHandlers[moduleName][eventName]) {\r
+                eventHandlers[moduleName][eventName].apply(eventHandlers, args);\r
+            }\r
+        }\r
+    }\r
+};\r
+\r
+});
\ No newline at end of file