add file info button

This commit is contained in:
2026-05-23 12:19:51 +02:00
parent ca9ccab697
commit 0e04e9f49f
9 changed files with 249 additions and 10 deletions

View File

@@ -14508,4 +14508,56 @@ body.scroller-active #gchat-reopen-bubble {
to {
text-shadow: 0 0 6px #f1c40f, 0 0 10px #f1c40f;
}
}
/* =============================================
POST & FILE INFO MODAL STYLES
============================================= */
.info-table {
width: 100%;
border-collapse: collapse;
margin-top: 10px;
}
.info-table th {
text-align: left;
padding: 8px 10px 8px 0;
font-weight: bold;
color: #fff;
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
font-size: 0.9em;
width: 35%;
}
.info-table td {
text-align: left;
padding: 8px 0;
color: #ccc;
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
font-size: 0.9em;
}
.info-table td a {
color: var(--accent, #9f0);
text-decoration: none;
font-weight: 600;
}
.info-table td a:hover {
text-decoration: underline;
}
.info-table td code {
background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.1);
padding: 2px 6px;
border-radius: 4px;
font-family: monospace;
font-size: 0.85em;
color: #eee;
}
.info-table tr:last-child th,
.info-table tr:last-child td {
border-bottom: none;
}

View File

@@ -529,7 +529,7 @@ window.cancelAnimFrame = (function () {
'login-modal', 'register-modal', 'forgot-modal', 'reset-modal',
'report-modal', 'halls-modal', 'metadata-modal', 'warning-modal',
'shortcuts-modal', 'upload-drag-modal', 'excluded-tags-overlay',
'content-warning-modal', 'gchat-img-modal', 'image-modal'
'content-warning-modal', 'gchat-img-modal', 'image-modal', 'info-modal'
];
modalIds.forEach(id => {
const el = document.getElementById(id);
@@ -910,6 +910,8 @@ window.cancelAnimFrame = (function () {
closeModal(loginModal);
closeModal(registerModal);
closeModal(shortcutsModal);
const infoModal = document.getElementById('info-modal');
if (infoModal) closeModal(infoModal);
}
});
@@ -8695,6 +8697,39 @@ if (navigator.vibrate) {
}
}
});
// Post & File Info Modal Logic
document.addEventListener('click', (e) => {
const infoBtn = e.target.closest('#a_info');
if (infoBtn) {
e.preventDefault();
const modal = document.getElementById('info-modal');
if (modal) {
modal.style.display = 'flex';
document.body.classList.add('modal-open');
}
return;
}
const closeBtn = e.target.closest('#info-modal-close');
if (closeBtn) {
e.preventDefault();
const modal = document.getElementById('info-modal');
if (modal) {
modal.style.display = 'none';
document.body.classList.remove('modal-open');
}
return;
}
// Close when clicking outside modal content
const infoModal = document.getElementById('info-modal');
if (infoModal && e.target === infoModal) {
infoModal.style.display = 'none';
document.body.classList.remove('modal-open');
}
});
// Ensure any navigation event restores the scroll state
window.addEventListener('pjax:start', () => {
if (window.resetGlobalScrollState) window.resetGlobalScrollState();