From 7023e4c7c8f158df78b5e71ddc2640290409eca1 Mon Sep 17 00:00:00 2001 From: chers Date: Fri, 31 Jul 2026 09:18:39 +0000 Subject: Update cl-bbs --- static/userscripts/localjump.user.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 static/userscripts/localjump.user.js (limited to 'static/userscripts/localjump.user.js') diff --git a/static/userscripts/localjump.user.js b/static/userscripts/localjump.user.js new file mode 100644 index 0000000..8c6274e --- /dev/null +++ b/static/userscripts/localjump.user.js @@ -0,0 +1,17 @@ +// ==UserScript== +// @name localjump +// @author Anon +// @namespace http://textboard.org +// @description Change single post quote links inside full thread views from separate single post views to local scroll jumps within the thread +// @version 1 +// @match *://textboard.org/* +// @grant none +// ==/UserScript== +(function() { + 'use strict'; + Array.from (document.getElementsByTagName ("a")).filter (e => e.hasAttribute ("href")).forEach (e => { + var h = e.getAttribute ("href") + var s = h.replace (/^\/([^\/]+)\/(\d+)\/(\d+)$/, "/$1/$2#t$2p$3") + if (h != s) { e.setAttribute ("href", s); } +}) +})(); -- cgit v1.2.3