From baa6a7dea838e202fce8b984b3928f42549774cb Mon Sep 17 00:00:00 2001 From: Sebastian Molenda Date: Tue, 5 May 2026 16:50:41 +0200 Subject: [PATCH] stopka z commitem --- .gitea/workflows/deploy.yml | 1 + app.js | 27 +++++++++++++++++++++++++++ index.html | 1 + styles.css | 2 ++ 4 files changed, 31 insertions(+) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index b7ee905..04eb72f 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -25,3 +25,4 @@ jobs: password: ${{ secrets.FTP_PASS }} local-dir: ./ server-dir: /public_html/ + diff --git a/app.js b/app.js index b5fed7a..2b45b81 100644 --- a/app.js +++ b/app.js @@ -478,3 +478,30 @@ window.addEventListener('keydown', (e)=>{ // small helper to set initial focus - mobile browsers will not open keyboard for divs document.addEventListener('touchstart', ()=>{}, {passive:true}) + +// load COMMIT_SHA from /version.js if present (no-cache fetch) +;(function loadCommitSha(){ + const el = document.getElementById('commit-sha') + if (!el) return + // prefer a no-cache fetch + fetch('/version.js', {cache: 'no-store'}) + .then(r => { + if (!r.ok) throw new Error('no version.js') + return r.text() + }) + .then(text => { + // naive parse: look for COMMIT_SHA = '...'; or window.COMMIT_SHA + let m = text.match(/COMMIT_SHA\s*=\s*['\"]([0-9a-fA-F]+)['\"]/) + if (m) return m[1] + m = text.match(/window\.COMMIT_SHA\s*=\s*['\"]([0-9a-fA-F]+)['\"]/) + if (m) return m[1] + return null + }) + .catch(()=>{ + // fallback to global + return (window && window.COMMIT_SHA) ? window.COMMIT_SHA : null + }) + .then(sha => { + el.textContent = sha ? sha.slice(0,8) : 'unknown' + }) +})() diff --git a/index.html b/index.html index 17acb2d..56a730b 100644 --- a/index.html +++ b/index.html @@ -157,6 +157,7 @@ + diff --git a/styles.css b/styles.css index 4c9648e..af8d085 100644 --- a/styles.css +++ b/styles.css @@ -62,6 +62,8 @@ body{ .summary h2{margin:6px 0} .summary p{font-size:18px} +.app-footer{font-size:12px;color:var(--muted);text-align:center;padding:10px 0} + @media (orientation:portrait){ .screen{max-height:94vh} }