Fehlerbehebung beim Timelock, Neues Feature Keyholder finden
This commit is contained in:
@@ -66,7 +66,7 @@ const CARD_DEFS = [
|
||||
id: 'CUM',
|
||||
img: '/img/card_cum.png',
|
||||
name: 'Cum',
|
||||
desc: 'Spezielle Karte.',
|
||||
desc: 'Du wirst entsperrt, nutze diese Entsperrung um zu kommen. Je länger du brauchst, desto schlimmer.',
|
||||
defMin: 0,
|
||||
defMax: 0,
|
||||
},
|
||||
@@ -74,7 +74,7 @@ const CARD_DEFS = [
|
||||
id: 'CUM_IN_CAGE',
|
||||
img: '/img/card_cum_caged.png',
|
||||
name: 'Cum in Cage',
|
||||
desc: 'Spezielle Karte.',
|
||||
desc: 'Komme in deinem Keuschheitsgürtel, wie du es anstellst ist deine Sache.',
|
||||
defMin: 0,
|
||||
defMax: 0,
|
||||
},
|
||||
|
||||
@@ -29,7 +29,9 @@
|
||||
{ href: '/neulock.html', icon: I('NEW_LOCK'), label: 'Neues Lock', id: 'navChastityNeu' },
|
||||
{ href: '#', icon: I('ACTIVE_LOCK'), label: 'Aktives Lock', id: 'navChastityAktiv' },
|
||||
{ href: '/communityvotes.html', icon: I('VOTES'), label: 'Community Votes' },
|
||||
{ href: '/meine-locks.html', icon: I('LOCK'), label: 'Meine Locks' },
|
||||
{ href: '/meine-locks.html', icon: I('LOCK'), label: 'Meine Vorlagen' },
|
||||
{ href: '/entdecken-vorlagen.html', icon: I('DISCOVER'), label: 'Entdecken' },
|
||||
{ href: '/keyholder-finden.html', icon: I('FRIENDS'), label: 'Keyholder finden' },
|
||||
{ href: '/keyholder.html', icon: I('KEY'), label: 'Keyholder' },
|
||||
{ href: '/unlock-history.html', icon: I('HISTORY'), label: 'Code-Historie' },
|
||||
]
|
||||
|
||||
@@ -277,24 +277,25 @@
|
||||
if (!res.ok) { body.innerHTML = '<div class="topbar-panel-hint">Keine Benachrichtigungen.</div>'; return; }
|
||||
const notifs = await res.json();
|
||||
if (!notifs.length) { body.innerHTML = '<div class="topbar-panel-hint">Keine neuen Benachrichtigungen.</div>'; return; }
|
||||
body.innerHTML = `<div style="padding:0.3rem 1rem;text-align:right;">
|
||||
<button onclick="window.__topbarMarkAllRead()" class="topbar-mark-all-btn">Alle gelesen</button>
|
||||
</div>`;
|
||||
body.innerHTML = '';
|
||||
notifs.forEach(n => {
|
||||
const el = document.createElement('div');
|
||||
const tag = n.targetUrl ? 'a' : 'div';
|
||||
const href = n.targetUrl ? `href="${esc(n.targetUrl)}"` : '';
|
||||
const unread = !n.read;
|
||||
el.innerHTML = `<${tag} ${href} class="topbar-panel-item topbar-notif-item${unread ? ' topbar-notif-item--unread' : ''}"
|
||||
onclick="window.__topbarMarkNotifRead('${esc(n.id)}')">
|
||||
${unread ? '<span class="topbar-notif-dot"></span>' : '<span style="width:7px;flex-shrink:0;"></span>'}
|
||||
const tag = n.targetUrl ? 'a' : 'div';
|
||||
const href = n.targetUrl ? `href="${esc(n.targetUrl)}"` : '';
|
||||
const av = n.senderAvatar
|
||||
? `<img src="data:image/png;base64,${esc(n.senderAvatar)}" class="topbar-item-avatar" alt="">`
|
||||
: `<span class="topbar-item-avatar topbar-item-avatar--placeholder">${IC('PROFILE')}</span>`;
|
||||
el.innerHTML = `<${tag} ${href} class="topbar-panel-item topbar-notif-item">
|
||||
${av}
|
||||
<div class="topbar-panel-item-body">
|
||||
<div style="font-size:0.85rem;line-height:1.4;${unread ? 'font-weight:600;' : ''}">${esc(n.text)}</div>
|
||||
<div style="font-size:0.85rem;line-height:1.4;">${esc(n.text)}</div>
|
||||
<div class="topbar-panel-item-sub">${n.sentAt ? new Date(n.sentAt).toLocaleString('de-DE',{dateStyle:'short',timeStyle:'short'}) : ''}</div>
|
||||
</div>
|
||||
</${tag}>`;
|
||||
body.appendChild(el.firstElementChild);
|
||||
});
|
||||
// Alle als gelesen markieren
|
||||
fetch('/notifications/read-all', { method: 'POST' }).then(() => setTopbarBadge('notif', 0)).catch(() => {});
|
||||
} catch (e) { body.innerHTML = '<div class="topbar-panel-hint">Fehler beim Laden.</div>'; }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user