Refactoring: cleaning directories structure
[fnpeditor.git] / src / editor / entrypoint.js
diff --git a/src/editor/entrypoint.js b/src/editor/entrypoint.js
new file mode 100644 (file)
index 0000000..5e546ef
--- /dev/null
@@ -0,0 +1,56 @@
+(function() {
+    'use strict';
+    
+    requirejs.config({
+        baseUrl: '/static/editor/src/editor',
+        
+        paths: {
+            'fnpjs': '../fnpjs',
+            'libs': '../../libs'
+        },
+
+        map: {
+            '*':
+                {
+                    'libs/jquery': '../../libs/jquery-1.9.1.min',
+                    'libs/underscore': '../../libs/underscore-min',
+                    'libs/bootstrap': '../../libs/bootstrap/js/bootstrap.min',
+                    'libs/backbone': '../../libs/backbone-min',
+
+                }
+        },
+
+        shim: {
+            '../../libs/jquery-1.9.1.min': {
+                exports: '$',
+            },
+            '../../libs/underscore-min': {
+                exports: '_'
+            },
+            '../../libs/bootstrap/js/bootstrap.min': {
+                deps: ['libs/jquery']
+            },
+            '../../libs/backbone-min': {
+                exports: 'Backbone',
+                deps: ['libs/jquery', 'libs/underscore']
+            }
+        }
+
+    });
+    
+    requirejs([
+        'libs/jquery',
+        '../fnpjs/runner',
+        'rng',
+        './modules',
+        'libs/bootstrap'
+    ], function($, runner, rng, modules) {
+        $(function() {
+            var app = new runner.Runner(rng, modules);
+            app.setBootstrappedData('data', RNG_BOOTSTRAP_DATA);
+            app.start({rootSelector:'#editor_root'});
+        });
+    });
+
+
+})();
\ No newline at end of file