mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-25 20:44:53 -04:00
Refactored and lots of modification. See README.md.
This commit is contained in:
parent
859a680e19
commit
71ed41fa69
85 changed files with 3191 additions and 2969 deletions
42
src/_h5ai/js/inc/ext/custom.js
Normal file
42
src/_h5ai/js/inc/ext/custom.js
Normal file
|
@ -0,0 +1,42 @@
|
|||
|
||||
module.define('ext/custom', [jQuery, 'core/settings'], function ($, allsettings) {
|
||||
|
||||
var defaults = {
|
||||
enabled: false,
|
||||
header: '_h5ai.header.html',
|
||||
footer: '_h5ai.footer.html'
|
||||
},
|
||||
|
||||
settings = _.extend({}, defaults, allsettings.custom),
|
||||
|
||||
init = function () {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (_.isString(settings.header)) {
|
||||
$.ajax({
|
||||
url: settings.header,
|
||||
dataType: 'html',
|
||||
success: function (data) {
|
||||
|
||||
$('<div id="content-header">' + data + '</div>').prependTo('#content');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (_.isString(settings.footer)) {
|
||||
$.ajax({
|
||||
url: settings.footer,
|
||||
dataType: 'html',
|
||||
success: function (data) {
|
||||
|
||||
$('<div id="content-footer">' + data + '</div>').appendTo('#content');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
init();
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue