Implement photo-related enhancements and chat updates

This commit is contained in:
dev
2026-10-28 09:01:49 +03:00
parent 12034812ec
commit 617ed60e65
10 changed files with 567 additions and 102 deletions
+15 -8
View File
@@ -102,6 +102,10 @@ function buildSidebar(active) {
<div class="user-name" title="${esc(userName)}">${esc(userName)}</div>
<div class="user-role">${roleLabel}</div>
</div>
<a href="#" class="notify-bell" id="notifyBell" title="Быстрые уведомления" style="margin-left:auto">
<i data-lucide="bell"></i>
<span class="notify-badge" id="notifyBadge" ${notifyUnread > 0 ? '' : 'hidden'}>${notifyUnread > 99 ? '99+' : notifyUnread}</span>
</a>
</div>
<div class="nav-scroll-wrap">
<nav>
@@ -122,11 +126,6 @@ function buildSidebar(active) {
</div>
<div class="bottom">
<div class="bottom-actions">
<a href="#" class="notify-bell" id="notifyBell" title="Быстрые уведомления">
<i data-lucide="bell"></i>
<span>Уведомления</span>
<span class="notify-badge" id="notifyBadge" ${notifyUnread > 0 ? '' : 'hidden'}>${notifyUnread > 99 ? '99+' : notifyUnread}</span>
</a>
<a href="/" data-nav="home" title="Перейти на главную страницу">
<i data-lucide="home"></i>
<span>На главную</span>
@@ -202,6 +201,7 @@ const NOTIFY_ICONS = {
'face.scan.done': 'scan-face',
'face.recognized': 'user-round-check',
'face.scan.error': 'scan-search',
'chat.message': 'bell',
};
const NOTIFY_LEVELS = { warning: 'Предупреждение', critical: 'Важно', info: '' };
@@ -363,7 +363,14 @@ function toggleNotifyPanel(force) {
if (!panel) return;
const open = force === undefined ? panel.hidden : !!force;
panel.hidden = !open;
if (open) { renderNotifyPanel(); loadNotifications(); }
if (open) {
const bell = document.getElementById('notifyBell');
const rect = bell ? bell.getBoundingClientRect() : null;
panel.style.left = rect ? (rect.right + 8) + 'px' : '240px';
panel.style.top = rect ? rect.top + 'px' : '80px';
renderNotifyPanel();
loadNotifications();
}
}
async function markNotifyRead(id) {
const item = notifyList.find(n => n.id === id);
@@ -457,7 +464,6 @@ function initNotifications() {
const bell = document.getElementById('notifyBell');
const panel = notifyPanelEl();
if (!bell || !panel) return;
bell.addEventListener('click', e => { e.preventDefault(); toggleNotifyPanel(); });
panel.addEventListener('click', e => {
if (e.target.closest('#notifyReadAll')) { markAllNotifyRead(); return; }
if (e.target.closest('#notifyDesktopToggle')) { toggleDesktopNotifications(); return; }
@@ -471,8 +477,9 @@ function initNotifications() {
if (link) location.href = link;
});
document.addEventListener('click', e => {
if (e.target.closest('#notifyBell')) { e.preventDefault(); toggleNotifyPanel(); return; }
if (panel.hidden) return;
if (e.target.closest('#notifyPanel') || e.target.closest('#notifyBell')) return;
if (e.target.closest('#notifyPanel')) return;
toggleNotifyPanel(false);
});
document.addEventListener('keydown', e => { if (e.key === 'Escape' && !panel.hidden) toggleNotifyPanel(false); });