diff --git a/Cargo.lock b/Cargo.lock index 8404de1b..26ffc2a2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1650,7 +1650,7 @@ dependencies = [ [[package]] name = "webapp" -version = "0.6.55" +version = "0.6.56" dependencies = [ "webui", "yew", @@ -1658,8 +1658,8 @@ dependencies = [ [[package]] name = "webui" -version = "0.6.55" -source = "git+https://github.com/StoicDreams/RustWebUI?branch=main#736449cd5a41576806588e0f1a7d8c1c937ae5f8" +version = "0.6.56" +source = "git+https://github.com/StoicDreams/RustWebUI?branch=main#d892b77bb38c1b44935ab920fdd4c305068339c4" dependencies = [ "async-std", "chrono", @@ -1685,8 +1685,8 @@ dependencies = [ [[package]] name = "webui_procs" -version = "0.6.55" -source = "git+https://github.com/StoicDreams/RustWebUI?branch=main#736449cd5a41576806588e0f1a7d8c1c937ae5f8" +version = "0.6.56" +source = "git+https://github.com/StoicDreams/RustWebUI?branch=main#d892b77bb38c1b44935ab920fdd4c305068339c4" [[package]] name = "winapi" diff --git a/Docs/README.md b/Docs/README.md index 8d8a65f8..7bff5340 100644 --- a/Docs/README.md +++ b/Docs/README.md @@ -1,6 +1,6 @@ # Task Story -[WebUI Version: 0.6.55](https://github.com/StoicDreams/RustWebUI) +[WebUI Version: 0.6.56](https://github.com/StoicDreams/RustWebUI) Simple task management tool focused around Continuous Agile Software Engineering practices and methodologies. diff --git a/webapp/Cargo.toml b/webapp/Cargo.toml index a0a620f7..bf16fc04 100644 --- a/webapp/Cargo.toml +++ b/webapp/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "webapp" -version = "0.6.55" #syncwebui +version = "0.6.56" #syncwebui edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/webapp/js/webui.js b/webapp/js/webui.js index 9ebb2e45..ed649394 100644 --- a/webapp/js/webui.js +++ b/webapp/js/webui.js @@ -1,10 +1,10 @@ -(function webuiSetup(){ +(function webuiSetup() { "use strict" function getEl(sel, mswait) { return new Promise((resolve, reject) => { let el = null; const start = Date.now(); - (function check(){ + (function check() { el = document.querySelector(sel); if (el) { resolve(el); @@ -15,58 +15,38 @@ reject(`Element ${sel} not found.`); return; } - setTimeout(check,10); + setTimeout(check, 10); })(); }); } function getMatchByKey(target, key) { let el = target; let i = 0; - while(el && i++ < 10) { + while (el && i++ < 10) { if (el[key]) { return el; } el = el.parentNode; } return undefined; } - function handleNav(target) { - if (!target.parentNode) { - // WebUI Already removed from DOM - return true; - } - let anchor = getMatchByKey(target, 'href'); - if (!anchor) {return false;} - // Disabling local navigation which will be handled by PWA webasembly processing - if (anchor.href[0] === '/' - || anchor.href.substr(0, location.origin.length).toLowerCase() === location.origin.toLowerCase()) { - history.pushState(null, null, anchor.href); - return true; - } - // Assuring external navigation opens a new window|tab - if (anchor.href.substr(0,4) === 'http') { - window.open(anchor.href, '_blank'); - return true; - } - return false; - } const styles = document.createElement('style'); function set_body_class(winWidth) { // Flag general width by class let w = winWidth > 3800 ? 'w-4k' : winWidth > 3400 ? 'w-wqhd' - : winWidth > 2500 ? 'w-qhd' - : winWidth > 1900 ? 'w-fhd' - : winWidth > 1500 ? 'w-hdp' - : winWidth > 1300 ? 'w-hd' - : winWidth > 500 ? 'w-tab' - : 'w-mob' + : winWidth > 2500 ? 'w-qhd' + : winWidth > 1900 ? 'w-fhd' + : winWidth > 1500 ? 'w-hdp' + : winWidth > 1300 ? 'w-hd' + : winWidth > 500 ? 'w-tab' + : 'w-mob' ; document.body.className = `${w}`; } async function applyDynamicStyleRules() { let w = window; - let h = await getEl('#app > header', 1) || {clientHeight: 0}; - let m = await getEl('#app > main', 1) || {clientHeight:0,clientWidth:0}; - let f = await getEl('#app > footer', 1) || {clientHeight:0}; + let h = await getEl('#app > header', 1) || { clientHeight: 0 }; + let m = await getEl('#app > main', 1) || { clientHeight: 0, clientWidth: 0 }; + let f = await getEl('#app > footer', 1) || { clientHeight: 0 }; styles.innerHTML = ` :root { --window-width: ${w.innerWidth}px; @@ -89,17 +69,8 @@ applyDynamicStyleRules(); } getEl('#app', 30000).then(el => { - el.addEventListener('click', ev => { - if (!ev.target) { return false; } - if (handleNav(ev.target)) { - ev.preventDefault(); - ev.stopPropagation(); - return false; - } - return true; - }); setupWatchers(); - setTimeout(()=> { + setTimeout(() => { el.className = 'page transition in'; setTimeout(() => { el.className = ''; diff --git a/webapp/root_files/service-worker.js b/webapp/root_files/service-worker.js index 98bb6423..d1ade361 100644 --- a/webapp/root_files/service-worker.js +++ b/webapp/root_files/service-worker.js @@ -11,7 +11,7 @@ function get_uuid() { }); } } -const currentVersion = location.host.substring(0, 9) === 'localhost' ? `${get_uuid()}` : 'webui_0.6.55'; +const currentVersion = location.host.substring(0, 9) === 'localhost' ? `${get_uuid()}` : 'webui_0.6.56'; const cacheNamePrefix = 'offline-cache-'; const cacheName = `${cacheNamePrefix}${currentVersion}`; const offlineAssetsInclude = [/\.wasm/, /\.html/, /\.js$/, /\.json$/, /\.css$/, /\.woff$/, /\.png$/, /\.jpe?g$/, /\.gif$/, /\.ico$/];