From 3dda406954658bd3e2b17b503e33a3841c6a31b4 Mon Sep 17 00:00:00 2001 From: Kibi Kelburton Date: Fri, 11 Sep 2026 23:26:20 +0200 Subject: [PATCH] fdas --- public/s/js/f0ckm.js | 14 ++++++++------ public/s/js/flash_yank.js | 17 ++++++++++++++--- public/s/js/scroller.js | 30 +----------------------------- views/index-partial.html | 2 +- views/scroller.html | 9 --------- views/snippets/items-grid.html | 2 +- 6 files changed, 25 insertions(+), 49 deletions(-) diff --git a/public/s/js/f0ckm.js b/public/s/js/f0ckm.js index 2bc703a..00f1e7b 100644 --- a/public/s/js/f0ckm.js +++ b/public/s/js/f0ckm.js @@ -8633,12 +8633,14 @@ class NotificationSystem { aUsername.textContent = display_name || userName; } // Grid thumbnails: update data-user attribute (shown as CSS content on hover) - document.querySelectorAll('.thumb[data-user]').forEach(el => { - const cur = el.getAttribute('data-user'); - if (cur === userName || (oldDisplayName && cur === oldDisplayName)) { - el.setAttribute('data-user', display_name || userName); - } - }); + if (!window.f0ckSession?.guest_anonymize) { + document.querySelectorAll('.thumb[data-user]').forEach(el => { + const cur = el.getAttribute('data-user'); + if (cur === userName || (oldDisplayName && cur === oldDisplayName)) { + el.setAttribute('data-user', display_name || userName); + } + }); + } } }; diff --git a/public/s/js/flash_yank.js b/public/s/js/flash_yank.js index 7875be1..dada866 100644 --- a/public/s/js/flash_yank.js +++ b/public/s/js/flash_yank.js @@ -25,13 +25,19 @@ const isMobile = /Mobi/i.test(navigator.userAgent); function isItemPage() { + if (document.body?.classList.contains('scroller-active') || + document.getElementById('scroller-feed') || + /^\/scroller(\/|$)/.test(window.location.pathname)) { + return false; + } + // Fast DOM check: item view or primary media element present if (document.getElementById('my-video') || document.querySelector('#main.item-view, .item-view, .item-layout-container, .item-main-content')) { return true; } const path = window.location.pathname; - const isForbidden = /^\/(s|b|t|ca|a|login|register|settings|about|terms|rules|api|logout|auth|admin|mod|comments|notifications|feed|upload|tags|halls|ranking|abyss|random)(\/|$)/.test(path); + const isForbidden = /^\/(s|b|t|ca|a|login|register|settings|about|terms|rules|api|logout|auth|admin|mod|comments|notifications|feed|upload|tags|halls|ranking|abyss|random|scroller)(\/|$)/.test(path); if (isForbidden) return false; const segments = path.split('/').filter(Boolean); @@ -356,8 +362,8 @@ function setupVideo(video) { if (!video) return; - // Ignore sidebar sticker / emoji preview / modal videos - if (video.closest && video.closest('.sidebar-activity, .global-sidebar-right, .emoji-preview, .modal')) { + // Ignore sidebar sticker / emoji preview / modal videos or scroller feed + if (video.closest && video.closest('.sidebar-activity, .global-sidebar-right, .emoji-preview, .modal, #scroller-feed, .scroll-slide')) { return; } @@ -712,6 +718,11 @@ hotkeyAttached = true; document.addEventListener('keydown', (e) => { + if (document.body?.classList.contains('scroller-active') || + document.getElementById('scroller-feed') || + /^\/scroller(\/|$)/.test(window.location.pathname)) { + return; + } if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey || !isItemPage()) return; if (e.key.toLowerCase() !== 's') return; diff --git a/public/s/js/scroller.js b/public/s/js/scroller.js index a89e8d6..8020e8f 100644 --- a/public/s/js/scroller.js +++ b/public/s/js/scroller.js @@ -81,7 +81,6 @@ const VOL_KEY = 'scroller_volume'; const PREFS_KEY = 'scroller_prefs'; const PRESETS_KEY = 'scroller_presets'; - const THUMB_SIZE_KEY = 'scroller_thumb_size'; // ── User Preferences ────────────────────────────────────────────────────── function loadPrefs() { @@ -98,33 +97,6 @@ let autoNextLoops = Math.max(0, parseInt(prefs.autoNextLoops ?? 1, 10)); let leftHandEnabled = prefs.leftHand === true; - // ── Grid / Thumbnail size ───────────────────────────────────────────────── - const THUMB_SIZES = ['s', 'm', 'l', 'xl']; - let thumbSize = localStorage.getItem(THUMB_SIZE_KEY) || window.f0ckDefaultThumbSize || 'm'; - if (!THUMB_SIZES.includes(thumbSize)) thumbSize = window.f0ckDefaultThumbSize || 'm'; - - function applyThumbSize(size, persist = true) { - thumbSize = size; - document.documentElement.dataset.thumbSize = size; - if (persist) localStorage.setItem(THUMB_SIZE_KEY, size); - // Sync pill active state whenever called outside the click handler - document.querySelectorAll('#thumb-size-pills .filter-pill').forEach(p => - p.classList.toggle('active', p.dataset.thumbSize === size) - ); - } - // Apply on init — do NOT persist so config default stays effective until user chooses - applyThumbSize(thumbSize, false); - - // Wire pill click events - const thumbSizePillsEl = document.getElementById('thumb-size-pills'); - if (thumbSizePillsEl) { - thumbSizePillsEl.querySelectorAll('.filter-pill').forEach(pill => { - pill.addEventListener('click', () => { - applyThumbSize(pill.dataset.thumbSize, true); - }); - }); - } - let applied = { mode: defaultMode, mime: '', order: 'random', tags: [], externalUrl: null }; let pending = { ...applied, tags: [] }; @@ -3027,7 +2999,6 @@ document.querySelectorAll('#mode-pills .filter-pill').forEach(p => p.classList.toggle('active', +p.dataset.mode === pending.mode)); document.querySelectorAll('#mime-pills .filter-pill').forEach(p => p.classList.toggle('active', p.dataset.mime === pending.mime)); document.querySelectorAll('#order-pills .filter-pill').forEach(p => p.classList.toggle('active', p.dataset.order === pending.order)); - document.querySelectorAll('#thumb-size-pills .filter-pill').forEach(p => p.classList.toggle('active', p.dataset.thumbSize === thumbSize)); if (externalUrlInput) externalUrlInput.value = pending.externalUrl || ''; renderActiveTags(); } @@ -3277,6 +3248,7 @@ else if (e.key === 'l' || e.key === 'L') { e.preventDefault(); if (currentSlide) toggleFav(currentSlide); } else if (e.key === 'i' || e.key === 'I') { e.preventDefault(); if (currentSlide) openTagBar(currentSlide.dataset.id); } else if (e.key === 'e' || e.key === 'E') { e.preventDefault(); e.stopImmediatePropagation(); } // suppress upload modal shortcut in abyss + else if (e.key === 's' || e.key === 'S') { e.preventDefault(); e.stopImmediatePropagation(); } // suppress flash yank shortcut in scroller else if (e.key === 'Escape') { window.location.href = '/'; } }, true); // capture phase — fires before f0ckm.js bubble listeners diff --git a/views/index-partial.html b/views/index-partial.html index 49f386a..e23333d 100644 --- a/views/index-partial.html +++ b/views/index-partial.html @@ -3,7 +3,7 @@ @include(snippets/page-title)
@each(items as item) - +
@if(item.is_pinned) diff --git a/views/scroller.html b/views/scroller.html index 5fc3f07..15d5220 100644 --- a/views/scroller.html +++ b/views/scroller.html @@ -1152,15 +1152,6 @@
-
- -
- - - - -
-
diff --git a/views/snippets/items-grid.html b/views/snippets/items-grid.html index 6616356..164083e 100644 --- a/views/snippets/items-grid.html +++ b/views/snippets/items-grid.html @@ -1,5 +1,5 @@ @each(items as item) - +
@if(item.is_pinned)