some other minor changes from milpeer
[fnpeditor.git] / src / editor / entrypoint.js
1 (function() {
2     'use strict';
3     
4     /* globals requirejs, editor_init */
5
6     requirejs.config({
7         paths: {
8             'fnpjs': '../fnpjs',
9             'libs': '../../libs',
10             'smartxml': '../smartxml',
11             'wlxml': '../wlxml'
12
13         },
14
15         map: {
16             '*':
17                 {
18                     'libs/jquery': '../../libs/jquery-1.9.1.min',
19                     'libs/underscore': '../../libs/underscore-min',
20                     'libs/bootstrap': '../../libs/bootstrap/js/bootstrap.min',
21                     'libs/backbone': '../../libs/backbone-min',
22                     'libs/ace/ace': '../../libs/ace/ace'
23                 }
24         },
25
26         shim: {
27             '../../libs/jquery-1.9.1.min': {
28                 exports: '$'
29             },
30             '../../libs/underscore-min': {
31                 exports: '_'
32             },
33             '../../libs/bootstrap/js/bootstrap.min': {
34                 deps: ['libs/jquery']
35             },
36             '../../libs/backbone-min': {
37                 exports: 'Backbone',
38                 deps: ['libs/jquery', 'libs/underscore']
39             },
40             '../../libs/ace/ace': {
41                 exports: 'ace'
42             }
43         }
44         // DEBUGGING ONLY
45         // , urlArgs: "bust=" + (new Date()).getTime()
46     });
47     
48     requirejs([
49         'libs/jquery',
50         '../fnpjs/runner',
51         'rng',
52         './modules',
53         'plugins/core/core',
54         'libs/bootstrap'
55     ], function($, runner, rng, modules, corePlugin) {
56         $(function() {
57             var app = new runner.Runner(rng, modules);
58             app.registerPlugin(corePlugin);
59
60             if(typeof editor_init !== 'undefined') {
61                 editor_init(app);
62             }
63         });
64     });
65
66
67 })();