mirror of
https://github.com/lrsjng/h5ai
synced 2025-12-18 14:52:53 +01:00
30 lines
726 B
JavaScript
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); });
|
|
});
|
|
});
|