diff --git a/public/admin.css b/public/admin.css
index bddbf53..77ad5e7 100644
--- a/public/admin.css
+++ b/public/admin.css
@@ -936,7 +936,7 @@ body.report-card-open .report-fields{display:flex}
.chat-empty-title{font-size:.95rem;font-weight:600;color:var(--text)}
.chat-empty-sub{font-size:.82rem}
.chat-main{display:flex;flex-direction:column;min-height:520px}
-.chat-empty[hidden],.chat-main[hidden],.chat-attach-list[hidden],.chat-new-btn[hidden]{display:none}
+.chat-side[hidden],.chat-empty[hidden],.chat-main[hidden],.chat-attach-list[hidden],.chat-new-btn[hidden]{display:none}
.chat-head{display:flex;align-items:center;gap:11px;padding:12px 16px;border-bottom:1px solid var(--border)}
.chat-head .grow{flex:1}
.chat-avatar{width:36px;height:36px;border-radius:10px;background:rgba(37,99,235,.1);color:var(--accent);display:flex;align-items:center;justify-content:center;font-weight:700;flex-shrink:0}
diff --git a/public/chat.html b/public/chat.html
index 2add329..cb36f4b 100644
--- a/public/chat.html
+++ b/public/chat.html
@@ -76,6 +76,10 @@
+
+
![]()
+
+
diff --git a/public/js/chat.js b/public/js/chat.js
index d83a5f4..ea66618 100644
--- a/public/js/chat.js
+++ b/public/js/chat.js
@@ -93,7 +93,7 @@ function chatFilesHtml(files) {
if (!files || !files.length) return '';
return `${files.map(f => {
if (CHAT_IMAGE_EXT.test(f.name || '')) {
- return `
+ return `
${esc(f.name)}
`;
@@ -428,6 +428,7 @@ function initChatPage() {
const newCancel = document.getElementById('chatNewCancel');
const newOk = document.getElementById('chatNewOk');
const attachBox = document.getElementById('chatAttachList');
+ const imgModal = document.getElementById('imgModal');
if (list) {
list.addEventListener('click', e => {
@@ -491,9 +492,15 @@ function initChatPage() {
});
document.addEventListener('keydown', e => {
- if (e.key === 'Escape' && newModal && newModal.classList.contains('open')) newModal.classList.remove('open');
+ if (e.key !== 'Escape') return;
+ if (imgModal && imgModal.classList.contains('open')) { imgModal.classList.remove('open'); return; }
+ if (newModal && newModal.classList.contains('open')) newModal.classList.remove('open');
});
+ if (imgModal) {
+ imgModal.addEventListener('click', e => e.currentTarget.classList.remove('open'));
+ }
+
if (newBtn) newBtn.hidden = !isAdmin();
const side = document.getElementById('chatSide');
const layout = document.getElementById('chatLayout');
diff --git a/public/js/notifications.js b/public/js/notifications.js
index 2279418..f74e339 100644
--- a/public/js/notifications.js
+++ b/public/js/notifications.js
@@ -88,7 +88,7 @@ document.getElementById('nfMoreBtn').addEventListener('click', () => loadNotifyP
document.getElementById('nfReloadBtn').addEventListener('click', () => loadNotifyPage(true));
(async () => {
- if (!(await requireAdminPage())) return;
+ if (!(await checkAuth())) return;
buildSidebar(document.body.dataset.page);
const clearBtn = document.getElementById('nfClearBtn');
if (clearBtn) clearBtn.hidden = !isAdmin();