X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/a15440ff7162c8cc0731e260cf4cacab5b998c62..0ca7242564aa1a2bdc1ab6891d46cae7d44dd889:/entrypoint.js?ds=sidebyside diff --git a/entrypoint.js b/entrypoint.js index 30052c2..6f81c94 100644 --- a/entrypoint.js +++ b/entrypoint.js @@ -1,63 +1,40 @@ (function() { - + 'use strict'; + requirejs.config({ - baseUrl: '/static', + baseUrl: '/static/editor', shim: { - 'jquery-1.9.1.min': { + 'libs/jquery-1.9.1.min': { exports: '$', }, - 'underscore-min': { + 'libs/underscore-min': { exports: '_' }, - 'bootstrap/js/bootstrap.min': { - deps: ['jquery-1.9.1.min'] - } - }, - - paths: { - modules: '/static/editor/modules' - } - }); - - - var dependenciesList = [ - 'jquery-1.9.1.min', - 'editor/runner', - 'editor/rng', - - 'modules/data', - 'modules/rng', - 'modules/skelton', - 'modules/sourceEditor', - 'modules/tabsManager', - 'modules/visualEditor', - 'modules/sourceEditor', - - 'bootstrap/js/bootstrap.min' - ]; - - requirejs(dependenciesList, function ($, runner, rng) { - var args = arguments; - - var getModulesFromArguments = function() { - var toret = {}; - var isModule = function(idx) {return dependenciesList[idx].substr(0, 'modules/'.length) === 'modules/';}; - var moduleName = function(idx) {return dependenciesList[idx].split('/')[1]}; - - for(var i = 0; i < args.length; i++) { - if(isModule(i)) - toret[moduleName(i)] = args[i]; + 'libs/bootstrap/js/bootstrap.min': { + deps: ['libs/jquery-1.9.1.min'] + }, + 'libs/backbone-min': { + exports: 'Backbone', + deps: ['libs/jquery-1.9.1.min', 'libs/underscore-min'] } - return toret; } - + + }); + + requirejs([ + 'libs/jquery-1.9.1.min', + 'fnpjs/runner', + 'rng', + './modules', + 'libs/bootstrap/js/bootstrap.min' + ], function($, runner, rng, modules) { $(function() { - var app = new runner.Runner(rng, getModulesFromArguments()); + var app = new runner.Runner(rng, modules); app.setBootstrappedData('data', RNG_BOOTSTRAP_DATA); app.start({rootSelector:'#editor_root'}); }); - }); + })(); \ No newline at end of file