Atlas: Versions-Tag rechts unten auf allen Hauptseiten
- App/version.json mit Commit-SHA + Build-Datum - App/assets/js/version-tag.js — rendert kleines Tag rechts unten - Eingebunden in schueler, teacher, index, login, admin, profil - Ermoeglicht Vergleich lokal vs. geograsim.at auf einen Blick Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -104,5 +104,6 @@ api({action:'status'}).then(function(r) {
|
||||
document.getElementById('a-pass').addEventListener('keydown', function(e) { if(e.key==='Enter') doLogin(); });
|
||||
document.getElementById('a-pin').addEventListener('keydown', function(e) { if(e.key==='Enter') doVerify(); });
|
||||
</script>
|
||||
<script src="assets/js/version-tag.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* GeoGraSim — Versions-Tag
|
||||
* Rendert kleinen Hinweis rechts unten auf jeder Seite, damit lokal vs.
|
||||
* produktiv schnell abzugleichen ist.
|
||||
*
|
||||
* Einbinden: <script src="assets/js/version-tag.js" defer></script>
|
||||
* (Pfad relativ zur Datei, die es einbindet. Im PHP-Wrapper aus BASE_PATH.)
|
||||
*
|
||||
* Liest version.json, zeigt Commit-SHA + Datum. Bei Fetch-Fehler (z.B.
|
||||
* CORS, offline) zeigt es nichts — stumm, statt kaputt.
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
if (window.__GGS_VERSION_TAG_DONE__) return;
|
||||
window.__GGS_VERSION_TAG_DONE__ = true;
|
||||
|
||||
// Pfad zur version.json ermitteln
|
||||
var script = document.currentScript;
|
||||
var versionUrl = 'version.json';
|
||||
if (script && script.src) {
|
||||
// Script-Src: .../assets/js/version-tag.js -> version.json auf gleicher Ebene wie assets/
|
||||
var base = script.src.replace(/\/assets\/js\/version-tag\.js.*$/, '/');
|
||||
versionUrl = base + 'version.json';
|
||||
}
|
||||
|
||||
fetch(versionUrl, { cache: 'no-store' })
|
||||
.then(function (r) { return r.ok ? r.json() : null; })
|
||||
.then(function (v) {
|
||||
if (!v) return;
|
||||
var el = document.createElement('div');
|
||||
el.className = 'ggs-version-tag';
|
||||
el.title = 'Commit ' + v.commit + ' · ' + v.date;
|
||||
el.innerHTML = '<span class="ggs-version-sha">' + v.commit + '</span>' +
|
||||
'<span class="ggs-version-date">' + v.date + '</span>';
|
||||
Object.assign(el.style, {
|
||||
position: 'fixed',
|
||||
right: '6px',
|
||||
bottom: '6px',
|
||||
zIndex: '99998',
|
||||
background: 'rgba(20,40,50,0.7)',
|
||||
color: 'rgba(255,255,255,0.75)',
|
||||
fontFamily: 'ui-monospace, Menlo, Consolas, monospace',
|
||||
fontSize: '10px',
|
||||
lineHeight: '1.2',
|
||||
padding: '3px 7px',
|
||||
borderRadius: '4px',
|
||||
pointerEvents: 'auto',
|
||||
userSelect: 'all',
|
||||
cursor: 'help',
|
||||
display: 'flex',
|
||||
gap: '6px',
|
||||
alignItems: 'center'
|
||||
});
|
||||
el.querySelector('.ggs-version-sha').style.fontWeight = '700';
|
||||
el.querySelector('.ggs-version-date').style.opacity = '0.7';
|
||||
document.body.appendChild(el);
|
||||
})
|
||||
.catch(function () { /* stumm */ });
|
||||
})();
|
||||
@@ -727,5 +727,6 @@ function frame() {
|
||||
}
|
||||
frame();
|
||||
</script>
|
||||
<script src="assets/js/version-tag.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -280,5 +280,6 @@ if (!resetToken) {
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script src="assets/js/version-tag.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -229,5 +229,6 @@ async function deleteAccount() {
|
||||
|
||||
loadProfile();
|
||||
</script>
|
||||
<script src="assets/js/version-tag.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -297,5 +297,6 @@ async function renderProfile() {
|
||||
|
||||
init();
|
||||
</script>
|
||||
<script src="assets/js/version-tag.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+3
-1
@@ -557,7 +557,8 @@ function printBatchTickets() {
|
||||
html += '<div class="ticket-row"><span class="ticket-label">Passwort:</span><span class="ticket-val">'+s.password+'</span></div>';
|
||||
html += '<div class="ticket-url">geograsim.at</div></div>';
|
||||
});
|
||||
html += '</div></body></html>';
|
||||
html += '</div><script src="assets/js/version-tag.js" defer></script>
|
||||
</body></html>';
|
||||
w.document.write(html); w.document.close();
|
||||
}
|
||||
|
||||
@@ -762,5 +763,6 @@ async function redeemLicenses() {
|
||||
loadLicenses();
|
||||
}
|
||||
</script>
|
||||
<script src="assets/js/version-tag.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{"commit":"b356c79","date":"2026-04-23 16:05 UTC"}
|
||||
Reference in New Issue
Block a user