mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-28 14:04:45 -04:00
Clean code.
This commit is contained in:
parent
788989c7e5
commit
dea5092ae0
1 changed files with 0 additions and 35 deletions
|
@ -18,46 +18,11 @@ modulejs.define('view/ensure', ['$', 'config', 'core/event'], function ($, confi
|
||||||
'</a>';
|
'</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() {
|
function init() {
|
||||||
|
|
||||||
$(templateTopbar).appendTo('body');
|
$(templateTopbar).appendTo('body');
|
||||||
$(templateMainRow).appendTo('body');
|
$(templateMainRow).appendTo('body');
|
||||||
$(templateBacklink).appendTo('#topbar');
|
$(templateBacklink).appendTo('#topbar');
|
||||||
|
|
||||||
// event.sub('ready', function () {
|
|
||||||
|
|
||||||
// ensure();
|
|
||||||
// setInterval(ensure, 60000);
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue