mesh app work. improve script setup

This commit is contained in:
Stewart Allen 2021-12-26 19:43:48 -05:00
commit 16fa536605
8 changed files with 286 additions and 86 deletions

View file

@ -1,10 +1,14 @@
// required for license and other grid app dependencies
self.gapp = {};
self.gapp = self.gapp || {};
function $(id) {
return document.getElementById(id);
}
function $d(id, v) {
$(id).style.display = v;
}
function init() {
let container = $('container'),
moto = self.moto,
@ -28,10 +32,13 @@ function init() {
Space.useDefaultKeys(true);
// hide loading curtain
$('curtain').style.display = 'none';
$d('curtain','none');
// remove version cache bust from url
window.history.replaceState({},'','/mesh/');
// start worker
moto.client.start(`/code/mesh_work?${gapp.version}`);
}
document.onreadystatechange = function() {