Clean code.

This commit is contained in:
Lars Jung 2015-03-14 15:51:39 +01:00
parent 788989c7e5
commit dea5092ae0

View file

@ -18,46 +18,11 @@ modulejs.define('view/ensure', ['$', 'config', 'core/event'], function ($, confi
'</a>';
var selb = '#bottombar';
var sela = selb + ' > a';
var sequence = 'powered by h5ai ' + config.setup.VERSION;
var url = 'http://larsjung.de/h5ai/';
var isVisible = ':visible';
var styleKey = 'style';
function ensure() {
if (
$(sela).text() !== sequence ||
$(sela).attr('href') !== url ||
$(sela).filter(isVisible).length !== 1 ||
$(selb).filter(isVisible).length !== 1
) {
$(selb).remove();
$('<div id="bottombar"/>')
.attr(styleKey, 'display: block !important')
.appendTo('body');
$('<a/>')
.attr(styleKey, 'display: inline !important')
.attr('href', url)
.attr('title', sequence)
.text(sequence)
.appendTo(selb);
}
}
function init() {
$(templateTopbar).appendTo('body');
$(templateMainRow).appendTo('body');
$(templateBacklink).appendTo('#topbar');
// event.sub('ready', function () {
// ensure();
// setInterval(ensure, 60000);
// });
}