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:
42
index.html
42
index.html
@@ -1713,7 +1713,7 @@
|
|||||||
// ============================================================
|
// ============================================================
|
||||||
// CONSTANTS & CHAPTER CONFIG
|
// 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_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';
|
const GITEA_API = 'http://72.60.134.73:3000/api/v1/repos/cheubaum/BNI-Vorstellungsrunde';
|
||||||
function giteaUrl(path) { return `${GITEA_RAW}/${path}?ref=main`; }
|
function giteaUrl(path) { return `${GITEA_RAW}/${path}?ref=main`; }
|
||||||
@@ -4345,16 +4345,40 @@ async function downloadUpdate(version) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} catch(e) { alert('Keine Serververbindung möglich.'); return; }
|
} catch(e) { alert('Keine Serververbindung möglich.'); return; }
|
||||||
|
|
||||||
|
let html;
|
||||||
try {
|
try {
|
||||||
const res = await fetch(giteaUrl('index.html'), { cache: 'no-store' });
|
const res = await fetch(giteaUrl('index.html'), { cache: 'no-store' });
|
||||||
const html = await res.text();
|
html = await res.text();
|
||||||
const blob = new Blob([html], { type: 'text/html' });
|
} catch(e) { alert('Download fehlgeschlagen: ' + e.message); return; }
|
||||||
const a = document.createElement('a');
|
|
||||||
a.href = URL.createObjectURL(blob);
|
if ('showOpenFilePicker' in window) {
|
||||||
a.download = 'index.html';
|
try {
|
||||||
a.click();
|
const [fileHandle] = await window.showOpenFilePicker({
|
||||||
URL.revokeObjectURL(a.href);
|
types: [{ description: 'HTML-Datei', accept: { 'text/html': ['.html'] } }],
|
||||||
} catch(e) { alert('Download fehlgeschlagen: ' + e.message); }
|
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() {
|
async function fetchChapterMembersFromGitea() {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"version": "1.1.2",
|
"version": "1.2.0",
|
||||||
"notes": "Timer-Schalter im Admin-Menü, DigiSeed-Logo Fix"
|
"notes": "Timer-Schalter im Admin-Menü"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user