fdsa
This commit is contained in:
+24
-8
@@ -3023,7 +3023,6 @@ body.sidebar-right-hidden #sidebar-drag-zone {
|
||||
/* Recommendation Video Cards (YouTube-style) */
|
||||
.sidebar-video-card {
|
||||
margin-bottom: 5px;
|
||||
border-radius: 8px;
|
||||
padding: 2px 2px 2px 2px;
|
||||
overflow: hidden;
|
||||
background: rgba(255, 255, 255, 0.02);
|
||||
@@ -3053,7 +3052,6 @@ body.sidebar-right-hidden #sidebar-drag-zone {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
aspect-ratio: 16 / 9;
|
||||
border-radius: 6px;
|
||||
overflow: hidden;
|
||||
background: #000;
|
||||
}
|
||||
@@ -3073,6 +3071,22 @@ body.sidebar-right-hidden #sidebar-drag-zone {
|
||||
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 {
|
||||
position: absolute;
|
||||
bottom: 6px;
|
||||
@@ -3114,7 +3128,7 @@ body.sidebar-right-hidden #sidebar-drag-zone {
|
||||
position: absolute;
|
||||
top: 6px;
|
||||
left: 6px;
|
||||
font-size: 0.6em;
|
||||
font-size: 0.65em;
|
||||
font-weight: 700;
|
||||
padding: 2px 5px;
|
||||
border-radius: 3px;
|
||||
@@ -3124,6 +3138,8 @@ body.sidebar-right-hidden #sidebar-drag-zone {
|
||||
backdrop-filter: blur(4px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.15);
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -3133,14 +3149,15 @@ body.sidebar-right-hidden #sidebar-drag-zone {
|
||||
display: flex;
|
||||
align-items: 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);
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
.sidebar-media-placeholder.audio {
|
||||
background: linear-gradient(135deg, #0f172a, #1e293b);
|
||||
color: #38bdf8;
|
||||
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: var(--accent);
|
||||
text-shadow: 0 0 16px rgba(var(--accent-rgb, 153, 255, 0), 0.35);
|
||||
}
|
||||
|
||||
.sidebar-media-placeholder.hidden {
|
||||
@@ -3332,7 +3349,7 @@ html[theme='95'] .sidebar-video-title {
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 8px 12px;
|
||||
background: rgba(18, 18, 24, 0.95);
|
||||
background: var(--nav-bg);
|
||||
backdrop-filter: blur(8px);
|
||||
border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
|
||||
margin-bottom: 6px;
|
||||
@@ -11496,7 +11513,6 @@ video.sidebar-comment-img.emoji {
|
||||
font-size: 0.8em;
|
||||
color: var(--accent);
|
||||
text-decoration: none;
|
||||
margin: 4px 0;
|
||||
}
|
||||
|
||||
.sidebar-video-link .yt-title {
|
||||
|
||||
@@ -6486,6 +6486,7 @@ window.cancelAnimFrame = (function () {
|
||||
if (window.f0ckSession) window.f0ckSession.strict_mode = strict.checked;
|
||||
|
||||
window.updateStrictLinks(strict.checked);
|
||||
document.dispatchEvent(new CustomEvent('f0ck:strictChanged', { detail: { strict: strict.checked } }));
|
||||
|
||||
// Sync with server
|
||||
fetch('/strict/' + (strict.checked ? 1 : 0));
|
||||
|
||||
@@ -1044,6 +1044,12 @@
|
||||
|
||||
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
|
||||
document.addEventListener('f0ck:contentLoaded', () => {
|
||||
const currentMode = typeof window.activeMode !== 'undefined' ? window.activeMode : null;
|
||||
@@ -1054,9 +1060,13 @@
|
||||
const mimeChanged = lastBoundMime !== null && 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) {
|
||||
window._sidebarActivityCache = [];
|
||||
lastRenderedIds = '';
|
||||
@@ -1214,8 +1224,10 @@
|
||||
|
||||
const isTagFeed = options.isTagFeed || false;
|
||||
const tagContext = options.tag || null;
|
||||
const isStrict = isStrictMode();
|
||||
const strictSuffix = (isTagFeed && isStrict) ? '?strict=1' : '';
|
||||
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}`;
|
||||
const activeClass = options.isActive ? ' active-tag-item' : '';
|
||||
|
||||
@@ -1224,8 +1236,10 @@
|
||||
<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}">
|
||||
${thumbContentHtml}
|
||||
${formatBadge}
|
||||
<span class="sidebar-video-badge rating-${rClass}">${rClass.toUpperCase()}</span>
|
||||
<div class="sidebar-video-badges">
|
||||
${formatBadge}
|
||||
<span class="sidebar-video-badge rating-${rClass}">${rClass.toUpperCase()}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sidebar-video-details">
|
||||
<div class="sidebar-video-info">
|
||||
@@ -1594,7 +1608,11 @@
|
||||
try {
|
||||
const mode = typeof window.activeMode !== 'undefined' ? window.activeMode : '';
|
||||
const mime = getCurrentMimeFilter();
|
||||
const isStrict = isStrictMode();
|
||||
let url = `/api/v2/tag-feed?tag=${encodeURIComponent(currentTag)}&order=${tagOrder}&offset=${tagOffset}&limit=20&mode=${mode}`;
|
||||
if (isStrict) {
|
||||
url += `&strict=1`;
|
||||
}
|
||||
if (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
|
||||
document.addEventListener('f0ck:commentPosted', () => {
|
||||
window.f0ckDebug("Sidebar Activity: Own comment posted, refreshing...");
|
||||
|
||||
Reference in New Issue
Block a user