mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-06-05 09:23:40 -04:00
30 lines
727 B
JavaScript
30 lines
727 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 href;
|
|
|
|
if (module === 'index') {
|
|
href = '.';
|
|
} else if (module === 'info') {
|
|
data.refresh = true;
|
|
href = 'server/php/index.php';
|
|
} else {
|
|
return;
|
|
}
|
|
|
|
$.ajax({
|
|
url: href,
|
|
data: data,
|
|
type: 'post',
|
|
dataType: 'json'
|
|
}).done(function (config) {
|
|
|
|
modulejs.define('config', config);
|
|
$(function () { modulejs.require('main/' + module); });
|
|
});
|
|
});
|