mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 13:04:30 -08:00
WIP
This commit is contained in:
19
index.html
19
index.html
@@ -376,14 +376,21 @@
|
||||
</style>
|
||||
|
||||
<script type='module'>
|
||||
// TODO remove
|
||||
// Shortcut for log(...) instead of console.log(...)
|
||||
window.log = console.log
|
||||
|
||||
import {init} from './src/index.js'
|
||||
|
||||
window.addEventListener('load', () => {
|
||||
init(document.getElementById('app'))
|
||||
})
|
||||
if(new URLSearchParams(window.location.search).get('leporello') == null) {
|
||||
const {init} = await import('./src/index.js');
|
||||
(
|
||||
document.readyState == 'complete'
|
||||
? Promise.resolve()
|
||||
: new Promise(resolve =>
|
||||
window.addEventListener('load', resolve)
|
||||
)
|
||||
).then(() => {
|
||||
init(document.getElementById('app'))
|
||||
})
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
|
||||
@@ -195,14 +195,18 @@ export class UI {
|
||||
click: e => e.stopPropagation(),
|
||||
change: this.change_entrypoint,
|
||||
},
|
||||
Object.keys(state.files).sort().map(f =>
|
||||
el('option',
|
||||
state.entrypoint == f
|
||||
? { value: f, selected: true }
|
||||
: { value: f},
|
||||
f == '' ? "*scratch*" : f
|
||||
Object
|
||||
.keys(state.files)
|
||||
.sort()
|
||||
.filter(f => f == '' || f.endsWith('.js') || f.endsWith('.mjs'))
|
||||
.map(f =>
|
||||
el('option',
|
||||
state.entrypoint == f
|
||||
? { value: f, selected: true }
|
||||
: { value: f},
|
||||
f == '' ? "*scratch*" : f
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user