Release v1.2.0: Timer-Schalter im Admin-Menü

Chapter können die Zeitanzeige deaktivieren. Update-Funktion ersetzt Datei direkt im richtigen Ordner.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Christian Heubaum
2026-04-21 20:39:15 +02:00
parent 69824b610c
commit f97ab2d69f
2 changed files with 35 additions and 11 deletions

View File

@@ -1713,7 +1713,7 @@
// ============================================================
// CONSTANTS & CHAPTER CONFIG
// ============================================================
const APP_VERSION = '1.1.2';
const APP_VERSION = '1.2.0';
const GITEA_RAW = 'http://72.60.134.73:3000/api/v1/repos/cheubaum/BNI-Vorstellungsrunde/raw';
const GITEA_API = 'http://72.60.134.73:3000/api/v1/repos/cheubaum/BNI-Vorstellungsrunde';
function giteaUrl(path) { return `${GITEA_RAW}/${path}?ref=main`; }
@@ -4345,16 +4345,40 @@ async function downloadUpdate(version) {
return;
}
} catch(e) { alert('Keine Serververbindung möglich.'); return; }
let html;
try {
const res = await fetch(giteaUrl('index.html'), { cache: 'no-store' });
const html = await res.text();
const blob = new Blob([html], { type: 'text/html' });
const a = document.createElement('a');
a.href = URL.createObjectURL(blob);
a.download = 'index.html';
a.click();
URL.revokeObjectURL(a.href);
} catch(e) { alert('Download fehlgeschlagen: ' + e.message); }
html = await res.text();
} catch(e) { alert('Download fehlgeschlagen: ' + e.message); return; }
if ('showOpenFilePicker' in window) {
try {
const [fileHandle] = await window.showOpenFilePicker({
types: [{ description: 'HTML-Datei', accept: { 'text/html': ['.html'] } }],
multiple: false,
id: 'bni-update',
startIn: 'documents',
});
const writable = await fileHandle.createWritable();
await writable.write(html);
await writable.close();
if (confirm('Update erfolgreich eingespielt!\n\nSeite jetzt neu laden?')) location.reload();
return;
} catch(e) {
if (e.name === 'AbortError') return;
// Fall through to classic download
}
}
// Fallback für Browser ohne File System Access API
const blob = new Blob([html], { type: 'text/html' });
const a = document.createElement('a');
a.href = URL.createObjectURL(blob);
a.download = 'index.html';
a.click();
URL.revokeObjectURL(a.href);
alert('Datei wurde heruntergeladen.\nBitte die alte index.html damit ersetzen und die Seite neu laden.');
}
async function fetchChapterMembersFromGitea() {

View File

@@ -1,4 +1,4 @@
{
"version": "1.1.2",
"notes": "Timer-Schalter im Admin-Menü, DigiSeed-Logo Fix"
"version": "1.2.0",
"notes": "Timer-Schalter im Admin-Menü"
}