1
0
Fork 0
mirror of https://github.com/lrsjng/h5ai synced 2025-12-18 14:52:53 +01:00
h5ai/src/_h5ai/client/js/inc/boot.js
2015-04-25 17:29:15 +02:00

30 lines
726 B
JavaScript

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); });
});
});