diff --git a/public/s/js/f0ckm.js b/public/s/js/f0ckm.js index 779d2d7..d8d8439 100644 --- a/public/s/js/f0ckm.js +++ b/public/s/js/f0ckm.js @@ -1920,29 +1920,16 @@ window.cancelAnimFrame = (function () { if (!options.skipHistory) { const returnUrl = window._onaraReturnUrl || getOnaraBaseUrl(); const returnTitle = window._onaraReturnTitle || window.f0ckDomain || ''; - // Always jump directly to the return URL — never step back through stacked item history. - // history.back() would re-open the previous item via popstate; replaceState exits cleanly. - const depth = window._onaraOpenHistoryLength != null - ? history.length - window._onaraOpenHistoryLength - : 0; - if (depth > 0) { - // Suppress popstate re-navigation while we jump out - window._onaraSuppressPopstate = true; - history.go(-depth); - // history.go is async — replace the landing state after it fires - setTimeout(() => { - history.replaceState({}, '', returnUrl); - document.title = returnTitle; - window._onaraSuppressPopstate = false; - }, 50); - } else { - history.replaceState({}, '', returnUrl); + const resolvedReturn = new URL(returnUrl, window.location.origin).href; + if (window.location.href !== resolvedReturn) { + history.pushState({ onaraGrid: true }, '', returnUrl); + } + if (returnTitle) { document.title = returnTitle; } } window._onaraReturnUrl = null; window._onaraReturnTitle = null; - window._onaraOpenHistoryLength = null; // Maintain focus on active item so user TAB navigation seamlessly resumes from current progress const activeThumb = document.querySelector('.posts > a.thumb.onara-active'); @@ -3610,9 +3597,7 @@ window.cancelAnimFrame = (function () { const loadPageAjax = async (url, replace = true, options = {}) => { if (isNavigating) return; - const fromOnaraModal = document.body.classList.contains('onara-modal-open') || - (document.getElementById('onara-modal') && document.getElementById('onara-modal').style.display !== 'none'); - const shouldReplaceHistory = options.replaceHistory ?? (fromOnaraModal && !options.skipPush); + const shouldReplaceHistory = options.replaceHistory ?? false; // Immediately restore scrollability and hide modals if (window.resetGlobalScrollState) window.resetGlobalScrollState(); @@ -4648,8 +4633,6 @@ window.cancelAnimFrame = (function () { window._onaraReturnUrl = window.location.href; } window._onaraReturnTitle = document.title; - // Record history depth so we can jump past all stacked item entries on close - window._onaraOpenHistoryLength = history.length; } // ── Scroller-active cleanup (same as loadPageAjax) ─────────────────── @@ -5681,8 +5664,7 @@ window.cancelAnimFrame = (function () { loadItemAjax(targetUrl, !_skipInherit); } else { const isBrand = anyLink.classList.contains('navbar-brand'); - const fromModal = document.body.classList.contains('onara-modal-open') || !!anyLink.closest('#onara-modal'); - loadPageAjax(targetUrl, true, { bypassCache: isBrand, replaceHistory: fromModal }); + loadPageAjax(targetUrl, true, { bypassCache: isBrand }); } return false; } @@ -6142,9 +6124,6 @@ window.cancelAnimFrame = (function () { }; window.addEventListener('popstate', (e) => { - // Swallow popstate events fired during Onara close (history.go(-N) unwinding) - if (window._onaraSuppressPopstate) return; - const url = window.location.href; const p = window.location.pathname; @@ -6187,6 +6166,8 @@ window.cancelAnimFrame = (function () { if (currentPath !== targetPath) { window._onaraCurrentGridUrl = url; loadPageAjax(url, true, { skipPush: true }); + } else { + document.title = window._onaraReturnTitle || window.f0ckDomain || 'f0ck'; } } return; diff --git a/src/inc/locales/de.json b/src/inc/locales/de.json index 457027d..2551e18 100644 --- a/src/inc/locales/de.json +++ b/src/inc/locales/de.json @@ -400,7 +400,11 @@ "name": "Name", "description": "Beschreibung", "private": "Privat", - "view": "Ansehen" + "view": "Ansehen", + "save": "Speichern", + "delete": "Löschen", + "edit": "Bearbeiten", + "dismiss": "Schließen" }, "mod": { "confirm_action": "Aktion bestätigen", diff --git a/src/inc/locales/en.json b/src/inc/locales/en.json index 30460fa..7ef2f4c 100644 --- a/src/inc/locales/en.json +++ b/src/inc/locales/en.json @@ -403,7 +403,8 @@ "view": "View", "save": "Save", "delete": "Delete", - "edit": "Edit" + "edit": "Edit", + "dismiss": "Dismiss" }, "mod": { "confirm_action": "Confirm Action", diff --git a/src/inc/locales/nl.json b/src/inc/locales/nl.json index 6e2a195..9cc1418 100644 --- a/src/inc/locales/nl.json +++ b/src/inc/locales/nl.json @@ -398,7 +398,11 @@ "name": "Naam", "description": "Beschrijving", "private": "Privé", - "view": "Bekijken" + "view": "Bekijken", + "save": "Opslaan", + "delete": "Verwijderen", + "edit": "Bewerken", + "dismiss": "Sluiten" }, "mod": { "confirm_action": "Actie Bevestigen", diff --git a/src/inc/locales/zange.json b/src/inc/locales/zange.json index af22747..171e8a7 100644 --- a/src/inc/locales/zange.json +++ b/src/inc/locales/zange.json @@ -398,7 +398,8 @@ "view": "Ansehen", "save": "Speichern", "delete": "Löschen", - "edit": "Editieren" + "edit": "Editieren", + "dismiss": "Weg damit" }, "mod": { "confirm_action": "Aktion bestätigen",