visbility filter and slug resolution to id

This commit is contained in:
2026-08-12 17:25:51 +02:00
parent c92306867f
commit b710f606ec
4 changed files with 32 additions and 15 deletions

View File

@@ -1441,9 +1441,9 @@ window.cancelAnimFrame = (function () {
if (!btn || !btn.href || btn.href.endsWith('#')) return;
const pathSegments = new URL(btn.href, window.location.origin).pathname.split('/');
const numericSegments = pathSegments.filter(s => /^\d+$/.test(s));
if (numericSegments.length === 0) return;
const itemId = numericSegments.pop();
const keySegments = pathSegments.filter(s => /^\d+$/.test(s) || /^[a-zA-Z0-9_-]{11}$/.test(s));
if (keySegments.length === 0) return;
const itemId = keySegments.pop();
let ajaxUrl = `/ajax/item/${itemId}`;
const params = new URLSearchParams();
@@ -3246,9 +3246,9 @@ window.cancelAnimFrame = (function () {
*/
const updateNavForMode = async (mode) => {
const pathSegments = window.location.pathname.split('/');
const numericSegments = pathSegments.filter(s => /^\d+$/.test(s));
if (numericSegments.length === 0) return;
const itemid = numericSegments[numericSegments.length - 1];
const keySegments = pathSegments.filter(s => /^\d+$/.test(s) || /^[a-zA-Z0-9_-]{11}$/.test(s));
if (keySegments.length === 0) return;
const itemid = keySegments[keySegments.length - 1];
const params = new URLSearchParams();
params.set('mode', mode);