From 3440f98bcd1b21daea496a209b5765474eb01423 Mon Sep 17 00:00:00 2001 From: Kibi Kelburton Date: Fri, 17 Jul 2026 23:25:14 +0200 Subject: [PATCH 1/4] fdsa --- src/inc/routes/apiv2/upload.mjs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/inc/routes/apiv2/upload.mjs b/src/inc/routes/apiv2/upload.mjs index ab89c8e..cd61d46 100644 --- a/src/inc/routes/apiv2/upload.mjs +++ b/src/inc/routes/apiv2/upload.mjs @@ -229,8 +229,6 @@ export default router => { domain = parts.slice(-2).join('.'); } - if (domain) tags.push(domain); - // YouTube-specific tag if (/(?:youtube\.com|youtu\.be)$/i.test(domain) || /(?:youtube\.com|youtu\.be)$/i.test(host)) { tags.push('youtube'); From a68c8c1618db710a90c56be6c73c61b690fe6be2 Mon Sep 17 00:00:00 2001 From: Kibi Kelburton Date: Fri, 17 Jul 2026 23:39:36 +0200 Subject: [PATCH 2/4] eridi --- public/s/js/f0ckm.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/s/js/f0ckm.js b/public/s/js/f0ckm.js index 755eab7..e56eb2e 100644 --- a/public/s/js/f0ckm.js +++ b/public/s/js/f0ckm.js @@ -8588,6 +8588,10 @@ class NotificationSystem { } handleNewItem(data) { + // Invalidate client-side caches so next/prev navigation knows about the new item + if (typeof itemCacheMap !== 'undefined') itemCacheMap.clear(); + if (typeof gridCacheMap !== 'undefined') gridCacheMap.clear(); + // Only prepend to the grid on the main/index page const grid = document.querySelector('.posts'); if (!grid) return; From d13693de01aa1681e50364655c10587e8b6a4396 Mon Sep 17 00:00:00 2001 From: Kibi Kelburton Date: Fri, 17 Jul 2026 23:42:50 +0200 Subject: [PATCH 3/4] luke... --- public/s/js/f0ckm.js | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/public/s/js/f0ckm.js b/public/s/js/f0ckm.js index e56eb2e..d65a4a3 100644 --- a/public/s/js/f0ckm.js +++ b/public/s/js/f0ckm.js @@ -8592,14 +8592,47 @@ class NotificationSystem { if (typeof itemCacheMap !== 'undefined') itemCacheMap.clear(); if (typeof gridCacheMap !== 'undefined') gridCacheMap.clear(); + const isFilteredView = window.location.pathname.includes('/tag/') || + window.location.pathname.includes('/h/') || + window.location.pathname.includes('/user/'); + + // UPDATE ITEM VIEW NAVIGATION DYNAMICALLY + const nextBtn = document.getElementById('next'); + const isItemView = !!document.getElementById('prev') || !!nextBtn; + + if (isItemView && !isFilteredView && nextBtn && (nextBtn.getAttribute('href') === '#' || nextBtn.getAttribute('href') === '')) { + let filtered = false; + if (typeof window.activeMode !== 'undefined' && window.activeMode !== 3) { + const nsflId = window.f0ckSession?.nsfl_tag_id || 3; + if (window.activeMode === 0 && data.tag_id !== 1) filtered = true; + else if (window.activeMode === 1 && data.tag_id !== 2) filtered = true; + else if (window.activeMode === 4 && data.tag_id != nsflId) filtered = true; + else if (window.activeMode === 2) filtered = true; + } + + if (!filtered) { + let nextUrl = `/${data.id}`; + nextBtn.setAttribute('href', nextUrl); + nextBtn.style.color = ''; // Remove #ccc + + document.querySelectorAll('.nav-next').forEach(btn => { + btn.setAttribute('href', nextUrl); + btn.style.visibility = 'visible'; + }); + + if (typeof prefetchNextPrevItems === 'function') { + if (typeof requestIdleCallback === 'function') requestIdleCallback(() => prefetchNextPrevItems()); + else setTimeout(prefetchNextPrevItems, 200); + } + } + } + // Only prepend to the grid on the main/index page const grid = document.querySelector('.posts'); if (!grid) return; // Don't live-update on filtered views (tags, halls, users) - if (window.location.pathname.includes('/tag/') || - window.location.pathname.includes('/h/') || - window.location.pathname.includes('/user/')) return; + if (isFilteredView) return; // Respect mode filter — but if this is the current user's own upload, // show a blurred "ghost" thumbnail so they know it was uploaded successfully From 5ef0d5c62e455697b96565f6c987e6322308d667 Mon Sep 17 00:00:00 2001 From: Kibi Kelburton Date: Fri, 17 Jul 2026 23:48:33 +0200 Subject: [PATCH 4/4] I am your father --- public/s/js/f0ckm.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/public/s/js/f0ckm.js b/public/s/js/f0ckm.js index d65a4a3..817938b 100644 --- a/public/s/js/f0ckm.js +++ b/public/s/js/f0ckm.js @@ -8597,10 +8597,12 @@ class NotificationSystem { window.location.pathname.includes('/user/'); // UPDATE ITEM VIEW NAVIGATION DYNAMICALLY + const prevBtn = document.getElementById('prev'); const nextBtn = document.getElementById('next'); - const isItemView = !!document.getElementById('prev') || !!nextBtn; + const isItemView = !!prevBtn || !!nextBtn; - if (isItemView && !isFilteredView && nextBtn && (nextBtn.getAttribute('href') === '#' || nextBtn.getAttribute('href') === '')) { + // #prev points to newer items (pagination.next). If it's disabled, we are at the newest item. + if (isItemView && !isFilteredView && prevBtn && (prevBtn.getAttribute('href') === '#' || prevBtn.getAttribute('href') === '')) { let filtered = false; if (typeof window.activeMode !== 'undefined' && window.activeMode !== 3) { const nsflId = window.f0ckSession?.nsfl_tag_id || 3; @@ -8612,10 +8614,18 @@ class NotificationSystem { if (!filtered) { let nextUrl = `/${data.id}`; - nextBtn.setAttribute('href', nextUrl); - nextBtn.style.color = ''; // Remove #ccc + const path = window.location.pathname; + const contextMatch = path.match(/^(.*\/)\d+\/?$/); + if (contextMatch && contextMatch[1] !== '/') { + nextUrl = `${contextMatch[1]}${data.id}`; + } - document.querySelectorAll('.nav-next').forEach(btn => { + // Update main #prev arrow + prevBtn.setAttribute('href', nextUrl); + prevBtn.style.color = ''; // Remove #ccc + + // Update .nav-prev text links and icons + document.querySelectorAll('.nav-prev').forEach(btn => { btn.setAttribute('href', nextUrl); btn.style.visibility = 'visible'; });