visbility filter and slug resolution to id
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user