Adds optional custom headers/footers that are propageted to all subfolders.

This commit is contained in:
Lars Jung 2013-07-20 21:21:57 +02:00
parent 8a2451474a
commit 289ce2993c
4 changed files with 55 additions and 18 deletions

View file

@ -2,25 +2,30 @@
modulejs.define('ext/custom', ['_', '$', 'core/settings', 'core/server', 'core/event'], function (_, $, allsettings, server, event) {
var settings = _.extend({
enabled: false,
header: '_h5ai.header.html',
footer: '_h5ai.footer.html'
enabled: false
}, allsettings.custom),
onLocationChanged = function () {
$('#content-header, #content-footer').stop(true, true).slideUp(200);
server.request({action: 'get', custom: true}, function (response) {
var h, f;
if (response) {
if (response.custom.header) {
$('#content-header').html(response.custom.header).stop(true, true).slideDown(400);
$('#content-header').html(response.custom.header).stop().slideDown(200);
h = true;
}
if (response.custom.footer) {
$('#content-footer').html(response.custom.footer).stop(true, true).slideDown(400);
$('#content-footer').html(response.custom.footer).stop().slideDown(200);
f = true;
}
}
if (!h) {
$('#content-header').stop().slideUp(200);
}
if (!f) {
$('#content-footer').stop().slideUp(200);
}
});
},