mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-25 04:24:45 -04:00
Refactor view files. Add option to disable sidebar.
This commit is contained in:
parent
2ee4a18e1c
commit
1d2c45dc68
12 changed files with 85 additions and 83 deletions
36
src/_h5ai/public/js/lib/view/base.js
Normal file
36
src/_h5ai/public/js/lib/view/base.js
Normal 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();
|
Loading…
Add table
Add a link
Reference in a new issue