diff --git a/src/_h5ai/client/js/inc/boot.js b/src/_h5ai/client/js/inc/boot.js new file mode 100644 index 00000000..af403a43 --- /dev/null +++ b/src/_h5ai/client/js/inc/boot.js @@ -0,0 +1,30 @@ +modulejs.define('boot', ['$'], function ($) { + + if ($('html').hasClass('no-browser')) { + return; + } + + var module = $('script[data-module]').data('module'); + var data = {action: 'get', setup: true, options: true, types: true, theme: true, langs: true}; + var url; + + if (module === 'index') { + url = '.'; + } else if (module === 'info') { + data.updatecmds = true; + url = 'server/php/index.php'; + } else { + return; + } + + $.ajax({ + url: url, + data: data, + type: 'POST', + dataType: 'json' + }).done(function (config) { + + modulejs.define('config', config); + $(function () { modulejs.require('main/' + module); }); + }); +}); diff --git a/src/_h5ai/client/js/inc/main.js b/src/_h5ai/client/js/inc/main/index.js similarity index 81% rename from src/_h5ai/client/js/inc/main.js rename to src/_h5ai/client/js/inc/main/index.js index b439956e..95570dd2 100644 --- a/src/_h5ai/client/js/inc/main.js +++ b/src/_h5ai/client/js/inc/main/index.js @@ -1,4 +1,4 @@ -modulejs.define('main', ['_', 'core/event'], function (_, event) { +modulejs.define('main/index', ['_', 'core/event'], function (_, event) { modulejs.require('view/ensure'); modulejs.require('view/items'); diff --git a/src/_h5ai/client/js/inc/info.js b/src/_h5ai/client/js/inc/main/info.js similarity index 98% rename from src/_h5ai/client/js/inc/info.js rename to src/_h5ai/client/js/inc/main/info.js index a32c7146..9b299e0f 100644 --- a/src/_h5ai/client/js/inc/info.js +++ b/src/_h5ai/client/js/inc/main/info.js @@ -1,4 +1,4 @@ -modulejs.define('info', ['$', 'config'], function ($, config) { +modulejs.define('main/info', ['$', 'config'], function ($, config) { var testsTemp = '