Refactor view files. Add option to disable sidebar.

This commit is contained in:
Lars Jung 2016-06-04 16:09:35 +02:00
parent 2ee4a18e1c
commit 1d2c45dc68
12 changed files with 85 additions and 83 deletions

View file

@ -0,0 +1,36 @@
const {jq} = require('../globals');
const rootSelector = 'body';
const tplTopbar =
`<div id="topbar">
<div id="toolbar"/>
<div id="flowbar"/>
<a id="backlink" href="https://larsjung.de/h5ai/" title="powered by h5ai - https://larsjung.de/h5ai/">
<div>powered</div>
<div>by h5ai</div>
</a>
</div>`;
const tplMainrow =
`<div id="mainrow">
<div id="content"/>
</div>`;
const init = () => {
jq('#fallback, #fallback-hints').remove();
const $root = jq(rootSelector)
.attr('id', 'root')
.append(tplTopbar)
.append(tplMainrow);
return {
$root,
$topbar: $root.find('#topbar'),
$toolbar: $root.find('#toolbar'),
$flowbar: $root.find('#flowbar'),
$mainrow: $root.find('#mainrow'),
$content: $root.find('#content')
};
};
module.exports = init();