X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/412e60ded1457ec0f408e2234c9dd60122929bac..efe36f4f1b5df351eeb4d40a54c3900cf9a7079b:/src/editor/entrypoint.js diff --git a/src/editor/entrypoint.js b/src/editor/entrypoint.js new file mode 100644 index 0000000..5e546ef --- /dev/null +++ b/src/editor/entrypoint.js @@ -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