diff --git a/public/css/teach.css b/public/css/teach.css index 9abf3c0..f670833 100644 --- a/public/css/teach.css +++ b/public/css/teach.css @@ -1054,7 +1054,7 @@ body.hc .am-reset,body.hc .am-reset-row{border:1.5px solid #000; background:#fff #toolbar{padding:0 8px; gap:6px;} .logo{font-size:22px;} .logo .crayon{font-size:18px; margin-left:4px;} - #verTag{display:none;} + #verTag{font-size:9px; margin-left:2px;} .tbtn{padding:8px 10px; font-size:13px;} #boardsPanel{top:60px; max-height:min(66vh,480px);} diff --git a/public/js/core.js b/public/js/core.js index d024a64..3999d9a 100644 --- a/public/js/core.js +++ b/public/js/core.js @@ -1,18 +1,22 @@ /* teach - kern: versie, i18n, accounts, opslag, geluid */ "use strict"; -/* version — bump on every change (form 0.0.00) */ -const VERSION = "0.2.01"; +/* version — shown until /api/version resolves (or if the fetch fails, e.g. offline) */ +const VERSION = "0.2.08"; (function(){ const tag = document.getElementById("verTag"); tag.textContent = "v"+VERSION; - /* dev branch deploys report a dev-… build via /api/version → mark as beta; - main/release builds show only the version number */ + /* the real deployed version always wins once known: dev branch deploys report + a dev- build via /api/version → mark as beta; release builds report the + actual release tag (e.g. v1.2.0) → show that instead of the local fallback */ fetch("/api/version") .then(r=>r.ok ? r.json() : null) .then(v=>{ - if(v && typeof v.version==="string" && v.version.startsWith("dev")){ - tag.textContent = "v"+VERSION+" · beta"; + if(!v || typeof v.version!=="string") return; + if(v.version.startsWith("dev")){ + tag.textContent = v.version+" · beta"; tag.classList.add("beta"); + }else{ + tag.textContent = v.version; } }) .catch(()=>{});