mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-06-03 16:48:38 -04:00
Restructure file base.
This commit is contained in:
parent
057a5f05a5
commit
ee241e7e3f
151 changed files with 88 additions and 86 deletions
30
src/_h5ai/public/js/inc/boot.js
Normal file
30
src/_h5ai/public/js/inc/boot.js
Normal file
|
@ -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 href;
|
||||
|
||||
if (module === 'index') {
|
||||
href = '.';
|
||||
} else if (module === 'info') {
|
||||
data.refresh = true;
|
||||
href = '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); });
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue