This commit is contained in:
2026-09-12 07:28:24 +02:00
parent b319a5aec2
commit 217f1be72d
7 changed files with 93 additions and 22 deletions
+24 -8
View File
@@ -3023,7 +3023,6 @@ body.sidebar-right-hidden #sidebar-drag-zone {
/* Recommendation Video Cards (YouTube-style) */ /* Recommendation Video Cards (YouTube-style) */
.sidebar-video-card { .sidebar-video-card {
margin-bottom: 5px; margin-bottom: 5px;
border-radius: 8px;
padding: 2px 2px 2px 2px; padding: 2px 2px 2px 2px;
overflow: hidden; overflow: hidden;
background: rgba(255, 255, 255, 0.02); background: rgba(255, 255, 255, 0.02);
@@ -3053,7 +3052,6 @@ body.sidebar-right-hidden #sidebar-drag-zone {
position: relative; position: relative;
width: 100%; width: 100%;
aspect-ratio: 16 / 9; aspect-ratio: 16 / 9;
border-radius: 6px;
overflow: hidden; overflow: hidden;
background: #000; background: #000;
} }
@@ -3073,6 +3071,22 @@ body.sidebar-right-hidden #sidebar-drag-zone {
transform: scale(1.04); transform: scale(1.04);
} }
.sidebar-video-badges {
position: absolute;
bottom: 6px;
right: 6px;
display: flex;
align-items: center;
gap: 4px;
z-index: 10;
pointer-events: none;
}
.sidebar-video-badges .sidebar-media-format-badge,
.sidebar-video-badges .sidebar-video-badge {
position: static;
}
.sidebar-video-badge { .sidebar-video-badge {
position: absolute; position: absolute;
bottom: 6px; bottom: 6px;
@@ -3114,7 +3128,7 @@ body.sidebar-right-hidden #sidebar-drag-zone {
position: absolute; position: absolute;
top: 6px; top: 6px;
left: 6px; left: 6px;
font-size: 0.6em; font-size: 0.65em;
font-weight: 700; font-weight: 700;
padding: 2px 5px; padding: 2px 5px;
border-radius: 3px; border-radius: 3px;
@@ -3124,6 +3138,8 @@ body.sidebar-right-hidden #sidebar-drag-zone {
backdrop-filter: blur(4px); backdrop-filter: blur(4px);
border: 1px solid rgba(255, 255, 255, 0.15); border: 1px solid rgba(255, 255, 255, 0.15);
line-height: 1; line-height: 1;
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
z-index: 10; z-index: 10;
} }
@@ -3133,14 +3149,15 @@ body.sidebar-right-hidden #sidebar-drag-zone {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
background: linear-gradient(135deg, #1e1b4b, #312e81); background: linear-gradient(135deg, rgba(var(--accent-rgb, 153, 255, 0), 0.12), rgba(0, 0, 0, 0.45)), var(--nav-bg, #1e1e1e);
color: var(--accent); color: var(--accent);
font-size: 2em; font-size: 2em;
} }
.sidebar-media-placeholder.audio { .sidebar-media-placeholder.audio {
background: linear-gradient(135deg, #0f172a, #1e293b); background: radial-gradient(circle at center, rgba(var(--accent-rgb, 153, 255, 0), 0.22) 0%, rgba(var(--accent-rgb, 153, 255, 0), 0.05) 70%), var(--nav-bg, #1e1e1e);
color: #38bdf8; color: var(--accent);
text-shadow: 0 0 16px rgba(var(--accent-rgb, 153, 255, 0), 0.35);
} }
.sidebar-media-placeholder.hidden { .sidebar-media-placeholder.hidden {
@@ -3332,7 +3349,7 @@ html[theme='95'] .sidebar-video-title {
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 8px 12px; padding: 8px 12px;
background: rgba(18, 18, 24, 0.95); background: var(--nav-bg);
backdrop-filter: blur(8px); backdrop-filter: blur(8px);
border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08)); border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
margin-bottom: 6px; margin-bottom: 6px;
@@ -11496,7 +11513,6 @@ video.sidebar-comment-img.emoji {
font-size: 0.8em; font-size: 0.8em;
color: var(--accent); color: var(--accent);
text-decoration: none; text-decoration: none;
margin: 4px 0;
} }
.sidebar-video-link .yt-title { .sidebar-video-link .yt-title {
+1
View File
@@ -6486,6 +6486,7 @@ window.cancelAnimFrame = (function () {
if (window.f0ckSession) window.f0ckSession.strict_mode = strict.checked; if (window.f0ckSession) window.f0ckSession.strict_mode = strict.checked;
window.updateStrictLinks(strict.checked); window.updateStrictLinks(strict.checked);
document.dispatchEvent(new CustomEvent('f0ck:strictChanged', { detail: { strict: strict.checked } }));
// Sync with server // Sync with server
fetch('/strict/' + (strict.checked ? 1 : 0)); fetch('/strict/' + (strict.checked ? 1 : 0));
+39 -3
View File
@@ -1044,6 +1044,12 @@
let lastBoundMime = getCurrentMimeFilter(); let lastBoundMime = getCurrentMimeFilter();
const isStrictMode = () => {
return !!(window.f0ckSession?.strict_mode || (localStorage.getItem('search_strict') === 'true') || window.location.search.includes('strict=1'));
};
let lastBoundStrict = isStrictMode();
// Handle AJAX item loads // Handle AJAX item loads
document.addEventListener('f0ck:contentLoaded', () => { document.addEventListener('f0ck:contentLoaded', () => {
const currentMode = typeof window.activeMode !== 'undefined' ? window.activeMode : null; const currentMode = typeof window.activeMode !== 'undefined' ? window.activeMode : null;
@@ -1054,9 +1060,13 @@
const mimeChanged = lastBoundMime !== null && lastBoundMime !== currentMime; const mimeChanged = lastBoundMime !== null && lastBoundMime !== currentMime;
lastBoundMime = currentMime; lastBoundMime = currentMime;
window.f0ckDebug("Sidebar Activity: Page transition detected", modeChanged ? "(Mode changed)" : "", mimeChanged ? "(Mime changed)" : ""); const currentStrict = isStrictMode();
const strictChanged = lastBoundStrict !== null && lastBoundStrict !== currentStrict;
lastBoundStrict = currentStrict;
if (modeChanged || mimeChanged) { window.f0ckDebug("Sidebar Activity: Page transition detected", modeChanged ? "(Mode changed)" : "", mimeChanged ? "(Mime changed)" : "", strictChanged ? "(Strict changed)" : "");
if (modeChanged || mimeChanged || strictChanged) {
if (modeChanged) { if (modeChanged) {
window._sidebarActivityCache = []; window._sidebarActivityCache = [];
lastRenderedIds = ''; lastRenderedIds = '';
@@ -1214,8 +1224,10 @@
const isTagFeed = options.isTagFeed || false; const isTagFeed = options.isTagFeed || false;
const tagContext = options.tag || null; const tagContext = options.tag || null;
const isStrict = isStrictMode();
const strictSuffix = (isTagFeed && isStrict) ? '?strict=1' : '';
const targetHref = (isTagFeed && tagContext) const targetHref = (isTagFeed && tagContext)
? `/tag/${encodeURIComponent(tagContext).replace(/%2C/g, ',').replace(/%20/g, ' ')}/${videoKey}` ? `/tag/${encodeURIComponent(tagContext).replace(/%2C/g, ',').replace(/%20/g, ' ')}/${videoKey}${strictSuffix}`
: `/${videoKey}`; : `/${videoKey}`;
const activeClass = options.isActive ? ' active-tag-item' : ''; const activeClass = options.isActive ? ' active-tag-item' : '';
@@ -1224,9 +1236,11 @@
<a href="${targetHref}" class="sidebar-video-link" data-mode="${rClass}" data-inherit-context="false"> <a href="${targetHref}" class="sidebar-video-link" data-mode="${rClass}" data-inherit-context="false">
<div class="sidebar-video-thumb-wrap" data-file="${escapeHtml(video.dest || '')}" data-mime="${escapeHtml(video.mime || '')}" data-ext="${escapeHtml(ext ? ext.toLowerCase() : '')}" data-mode="${rClass}"> <div class="sidebar-video-thumb-wrap" data-file="${escapeHtml(video.dest || '')}" data-mime="${escapeHtml(video.mime || '')}" data-ext="${escapeHtml(ext ? ext.toLowerCase() : '')}" data-mode="${rClass}">
${thumbContentHtml} ${thumbContentHtml}
<div class="sidebar-video-badges">
${formatBadge} ${formatBadge}
<span class="sidebar-video-badge rating-${rClass}">${rClass.toUpperCase()}</span> <span class="sidebar-video-badge rating-${rClass}">${rClass.toUpperCase()}</span>
</div> </div>
</div>
<div class="sidebar-video-details"> <div class="sidebar-video-details">
<div class="sidebar-video-info"> <div class="sidebar-video-info">
<div class="sidebar-video-title" title="${escapeHtml(displayTitle)}">${escapeHtml(displayTitle)}</div> <div class="sidebar-video-title" title="${escapeHtml(displayTitle)}">${escapeHtml(displayTitle)}</div>
@@ -1594,7 +1608,11 @@
try { try {
const mode = typeof window.activeMode !== 'undefined' ? window.activeMode : ''; const mode = typeof window.activeMode !== 'undefined' ? window.activeMode : '';
const mime = getCurrentMimeFilter(); const mime = getCurrentMimeFilter();
const isStrict = isStrictMode();
let url = `/api/v2/tag-feed?tag=${encodeURIComponent(currentTag)}&order=${tagOrder}&offset=${tagOffset}&limit=20&mode=${mode}`; let url = `/api/v2/tag-feed?tag=${encodeURIComponent(currentTag)}&order=${tagOrder}&offset=${tagOffset}&limit=20&mode=${mode}`;
if (isStrict) {
url += `&strict=1`;
}
if (mime) { if (mime) {
url += `&mime=${encodeURIComponent(mime)}`; url += `&mime=${encodeURIComponent(mime)}`;
} }
@@ -1958,6 +1976,24 @@
} }
}); });
// Handle strict mode toggle
document.addEventListener('f0ck:strictChanged', (e) => {
const currentStrict = (e.detail && typeof e.detail.strict !== 'undefined') ? !!e.detail.strict : isStrictMode();
window.f0ckDebug("Sidebar Activity: Strict mode change detected", currentStrict);
lastBoundStrict = currentStrict;
tagFeedLoaded = false;
tagFeedNeedsReload = true;
const activeTabEl = document.querySelector('.sidebar-tab.active')?.dataset.tab;
let savedTab = 'comments';
try { savedTab = localStorage.getItem('sidebar_active_tab'); } catch (_) {}
const currentTabName = activeTabEl || savedTab;
if (currentTabName === 'tag' && currentTag) {
loadTagFeed(true);
}
});
// When the current user posts a comment, silently refresh sidebar to show it // When the current user posts a comment, silently refresh sidebar to show it
document.addEventListener('f0ck:commentPosted', () => { document.addEventListener('f0ck:commentPosted', () => {
window.f0ckDebug("Sidebar Activity: Own comment posted, refreshing..."); window.f0ckDebug("Sidebar Activity: Own comment posted, refreshing...");
+1 -1
View File
@@ -456,7 +456,7 @@
}, },
"report": { "report": {
"title": "Submit Report", "title": "Submit Report",
"placeholder": "Please provide details for this report (required)...", "placeholder": "",
"submit": "Submit" "submit": "Submit"
}, },
"account_warning": { "account_warning": {
+16 -2
View File
@@ -2533,7 +2533,8 @@ const f0cklib = {
exclude, exclude,
user_id, user_id,
is_admin, is_admin,
mime mime,
strict = false
} = {}) => { } = {}) => {
if (!tag || !tag.trim()) return { items: [], total: 0 }; if (!tag || !tag.trim()) return { items: [], total: 0 };
@@ -2561,7 +2562,19 @@ const f0cklib = {
: db``; : db``;
const terms = tag.split(',').map(t => t.trim()).filter(Boolean); const terms = tag.split(',').map(t => t.trim()).filter(Boolean);
const tagConditions = terms.map(term => { const isStrict = !!strict || (tag && tag.includes(','));
let tagConditions;
if (isStrict) {
tagConditions = terms.length > 0 ? [db`and items.id in (
select ta.item_id
from tags_assign ta
join tags t on t.id = ta.tag_id
where t.normalized = ANY(ARRAY(SELECT slugify(x) FROM unnest(${terms}::text[]) AS x))
group by ta.item_id
having count(distinct t.normalized) = ${terms.length}
)`] : [];
} else {
tagConditions = terms.map(term => {
return db`and items.id in ( return db`and items.id in (
select ta.item_id select ta.item_id
from tags_assign ta from tags_assign ta
@@ -2569,6 +2582,7 @@ const f0cklib = {
where t.normalized like '%' || slugify(${term}) || '%' where t.normalized like '%' || slugify(${term}) || '%'
)`; )`;
}); });
}
const isDesc = String(order).toLowerCase() === 'desc'; const isDesc = String(order).toLowerCase() === 'desc';
const sortOrderItems = isDesc ? db`items.id desc` : db`items.id asc`; const sortOrderItems = isDesc ? db`items.id desc` : db`items.id asc`;
+4 -1
View File
@@ -845,6 +845,8 @@ export default router => {
? (req.url.qs.mime || null) ? (req.url.qs.mime || null)
: (cookieMime || null); : (cookieMime || null);
const isStrict = req.url.qs?.strict === '1' || req.url.qs?.strict === 'true' || !!req.session?.strict_mode;
const result = await f0cklib.getTagFeedItems({ const result = await f0cklib.getTagFeedItems({
tag, tag,
order, order,
@@ -857,7 +859,8 @@ export default router => {
exclude: req.session?.excluded_tags || [], exclude: req.session?.excluded_tags || [],
user_id: req.session?.id, user_id: req.session?.id,
is_admin: req.session?.admin, is_admin: req.session?.admin,
mime mime,
strict: isStrict
}); });
const effectiveOffset = result.offset ?? offset; const effectiveOffset = result.offset ?? offset;
+2 -1
View File
@@ -70,6 +70,7 @@
<div id="report-modal" class="modal-overlay" style="display:none;"> <div id="report-modal" class="modal-overlay" style="display:none;">
<div class="modal-content" style="max-height: 90vh; overflow-y: auto;"> <div class="modal-content" style="max-height: 90vh; overflow-y: auto;">
<h3>{{ t('report.title') }}</h3> <h3>{{ t('report.title') }}</h3>
<p>Please describe why you want to report this f0ck.</p>
<input type="hidden" id="report-item-id"> <input type="hidden" id="report-item-id">
<input type="hidden" id="report-comment-id"> <input type="hidden" id="report-comment-id">
<input type="hidden" id="report-user-id"> <input type="hidden" id="report-user-id">
@@ -79,8 +80,8 @@
@endif @endif
<div id="report-error" class="error-msg"></div> <div id="report-error" class="error-msg"></div>
<div class="modal-actions"> <div class="modal-actions">
<button id="report-submit" class="btn-danger">{{ t('report.submit') }}</button>
<button id="report-cancel" class="btn-secondary">{{ t('common.cancel') }}</button> <button id="report-cancel" class="btn-secondary">{{ t('common.cancel') }}</button>
<button id="report-submit" class="">{{ t('report.submit') }}</button>
</div> </div>
</div> </div>
</div> </div>