X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/71b7ba4d1d17adc39165914016fa892671cc4316..30c11b8f1c25ec09d841d52e118a9f8ff5808f1b:/src/editor/entrypoint.js diff --git a/src/editor/entrypoint.js b/src/editor/entrypoint.js index 851ced3..13ca1ab 100644 --- a/src/editor/entrypoint.js +++ b/src/editor/entrypoint.js @@ -1,9 +1,11 @@ (function() { 'use strict'; + /* globals requirejs, editor_init */ + requirejs.config({ - baseUrl: '/static/editor/src/editor', - + urlArgs: "bust=" + (new Date()).getTime(), + paths: { 'fnpjs': '../fnpjs', 'libs': '../../libs', @@ -19,7 +21,7 @@ 'libs/underscore': '../../libs/underscore-min', 'libs/bootstrap': '../../libs/bootstrap/js/bootstrap.min', 'libs/backbone': '../../libs/backbone-min', - + 'libs/ace/ace': '../../libs/ace/ace' } }, @@ -36,7 +38,10 @@ '../../libs/backbone-min': { exports: 'Backbone', deps: ['libs/jquery', 'libs/underscore'] - } + }, + '../../libs/ace/ace': { + exports: 'ace' + }, } }); @@ -46,12 +51,16 @@ '../fnpjs/runner', 'rng', './modules', + 'plugins/core/core', 'libs/bootstrap' - ], function($, runner, rng, modules) { + ], function($, runner, rng, modules, corePlugin) { $(function() { var app = new runner.Runner(rng, modules); - app.setBootstrappedData('data', RNG_BOOTSTRAP_DATA); - app.start({rootSelector:'#editor_root'}); + app.registerPlugin(corePlugin); + + if(typeof editor_init !== 'undefined') { + editor_init(app); + } }); });