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,9 +1236,11 @@
|
||||
<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}
|
||||
<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">
|
||||
<div class="sidebar-video-title" title="${escapeHtml(displayTitle)}">${escapeHtml(displayTitle)}</div>
|
||||
@@ -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...");
|
||||
|
||||
@@ -456,7 +456,7 @@
|
||||
},
|
||||
"report": {
|
||||
"title": "Submit Report",
|
||||
"placeholder": "Please provide details for this report (required)...",
|
||||
"placeholder": "",
|
||||
"submit": "Submit"
|
||||
},
|
||||
"account_warning": {
|
||||
|
||||
@@ -2533,7 +2533,8 @@ const f0cklib = {
|
||||
exclude,
|
||||
user_id,
|
||||
is_admin,
|
||||
mime
|
||||
mime,
|
||||
strict = false
|
||||
} = {}) => {
|
||||
if (!tag || !tag.trim()) return { items: [], total: 0 };
|
||||
|
||||
@@ -2561,7 +2562,19 @@ const f0cklib = {
|
||||
: db``;
|
||||
|
||||
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 (
|
||||
select ta.item_id
|
||||
from tags_assign ta
|
||||
@@ -2569,6 +2582,7 @@ const f0cklib = {
|
||||
where t.normalized like '%' || slugify(${term}) || '%'
|
||||
)`;
|
||||
});
|
||||
}
|
||||
|
||||
const isDesc = String(order).toLowerCase() === 'desc';
|
||||
const sortOrderItems = isDesc ? db`items.id desc` : db`items.id asc`;
|
||||
|
||||
@@ -845,6 +845,8 @@ export default router => {
|
||||
? (req.url.qs.mime || null)
|
||||
: (cookieMime || null);
|
||||
|
||||
const isStrict = req.url.qs?.strict === '1' || req.url.qs?.strict === 'true' || !!req.session?.strict_mode;
|
||||
|
||||
const result = await f0cklib.getTagFeedItems({
|
||||
tag,
|
||||
order,
|
||||
@@ -857,7 +859,8 @@ export default router => {
|
||||
exclude: req.session?.excluded_tags || [],
|
||||
user_id: req.session?.id,
|
||||
is_admin: req.session?.admin,
|
||||
mime
|
||||
mime,
|
||||
strict: isStrict
|
||||
});
|
||||
|
||||
const effectiveOffset = result.offset ?? offset;
|
||||
|
||||
@@ -70,6 +70,7 @@
|
||||
<div id="report-modal" class="modal-overlay" style="display:none;">
|
||||
<div class="modal-content" style="max-height: 90vh; overflow-y: auto;">
|
||||
<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-comment-id">
|
||||
<input type="hidden" id="report-user-id">
|
||||
@@ -79,8 +80,8 @@
|
||||
@endif
|
||||
<div id="report-error" class="error-msg"></div>
|
||||
<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-submit" class="">{{ t('report.submit') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user