This commit is contained in:
Dmitry Vasilev
2022-11-24 16:52:59 +08:00
parent c7f5cb231c
commit 77c1df54d4
2 changed files with 24 additions and 13 deletions

View File

@@ -376,14 +376,21 @@
</style> </style>
<script type='module'> <script type='module'>
// TODO remove // Shortcut for log(...) instead of console.log(...)
window.log = console.log window.log = console.log
import {init} from './src/index.js' if(new URLSearchParams(window.location.search).get('leporello') == null) {
const {init} = await import('./src/index.js');
window.addEventListener('load', () => { (
init(document.getElementById('app')) document.readyState == 'complete'
}) ? Promise.resolve()
: new Promise(resolve =>
window.addEventListener('load', resolve)
)
).then(() => {
init(document.getElementById('app'))
})
}
</script> </script>
</head> </head>

View File

@@ -195,14 +195,18 @@ export class UI {
click: e => e.stopPropagation(), click: e => e.stopPropagation(),
change: this.change_entrypoint, change: this.change_entrypoint,
}, },
Object.keys(state.files).sort().map(f => Object
el('option', .keys(state.files)
state.entrypoint == f .sort()
? { value: f, selected: true } .filter(f => f == '' || f.endsWith('.js') || f.endsWith('.mjs'))
: { value: f}, .map(f =>
f == '' ? "*scratch*" : f el('option',
state.entrypoint == f
? { value: f, selected: true }
: { value: f},
f == '' ? "*scratch*" : f
)
) )
)
) )
) )
} }