mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-25 12:34:47 -04:00
Cosmetics.
This commit is contained in:
parent
7494491637
commit
c71f891af2
311 changed files with 55 additions and 46 deletions
36
src/_h5ai/client/js/inc/ext/custom.js
Normal file
36
src/_h5ai/client/js/inc/ext/custom.js
Normal file
|
@ -0,0 +1,36 @@
|
|||
|
||||
modulejs.define('ext/custom', ['_', '$', 'core/settings', 'core/ajax'], function (_, $, allsettings, ajax) {
|
||||
|
||||
var settings = _.extend({
|
||||
enabled: false,
|
||||
header: '_h5ai.header.html',
|
||||
footer: '_h5ai.footer.html'
|
||||
}, allsettings.custom),
|
||||
|
||||
init = function () {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (_.isString(settings.header)) {
|
||||
ajax.getHtml(settings.header, function (html) {
|
||||
|
||||
if (html) {
|
||||
$('<div id="content-header">' + html + '</div>').prependTo('#content');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (_.isString(settings.footer)) {
|
||||
ajax.getHtml(settings.footer, function (html) {
|
||||
|
||||
if (html) {
|
||||
$('<div id="content-footer">' + html + '</div>').appendTo('#content');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
init();
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue