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/highlight.user.js | 22 ++++++++++++++++++++++ static/userscripts/localjump.user.js | 17 +++++++++++++++++ static/userscripts/unvip.user.js | 18 ++++++++++++++++++ static/userscripts/wordfilter.user.js | 29 +++++++++++++++++++++++++++++ 4 files changed, 86 insertions(+) create mode 100644 static/userscripts/highlight.user.js create mode 100644 static/userscripts/localjump.user.js create mode 100644 static/userscripts/unvip.user.js create mode 100644 static/userscripts/wordfilter.user.js (limited to 'static/userscripts') diff --git a/static/userscripts/highlight.user.js b/static/userscripts/highlight.user.js new file mode 100644 index 0000000..94d8ba5 --- /dev/null +++ b/static/userscripts/highlight.user.js @@ -0,0 +1,22 @@ +// ==UserScript== +// @name Syntax Highlighting for textboard.org +// @namespace http://textboard.org/ +// @description Syntax Highlighting of code blocks with highlight.js +// @version 1 +// @match *://textboard.org/* +// @resource css https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css +// @require https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js +// @require https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/haskell.min.js +// @require https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/lisp.min.js +// @require https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/scheme.min.js +// @require https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/javascript.min.js +// @require https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/lua.min.js +// @require https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/go.min.js +// @grant GM_addStyle +// @grant GM_getResourceText +// ==/UserScript== +GM_addStyle(GM_getResourceText('css')); +(function () { + 'use strict'; + hljs.initHighlighting(); +})(); 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); } +}) +})(); diff --git a/static/userscripts/unvip.user.js b/static/userscripts/unvip.user.js new file mode 100644 index 0000000..e5017cb --- /dev/null +++ b/static/userscripts/unvip.user.js @@ -0,0 +1,18 @@ +// ==UserScript== +// @name UnVIP +// @author Anon +// @namespace http://textboard.org +// @description View the thread list in update order regardless of VIPs +// @version 1 +// @match *://textboard.org/* +// @grant none +// ==/UserScript== +(function() { + 'use strict'; + const tbody = document.getElementsByTagName ("tbody") [0] + const rows = Array.from (tbody.children) + const upd = e => e.children [3].children [0].textContent + rows.sort ((a, b) => {var u = upd (a); var v = upd (b); return u < v ? 1 : u > v ? -1 : 0; }) + tbody.innerHTML = "" + rows.forEach (e => tbody.appendChild (e)) +})(); diff --git a/static/userscripts/wordfilter.user.js b/static/userscripts/wordfilter.user.js new file mode 100644 index 0000000..476706f --- /dev/null +++ b/static/userscripts/wordfilter.user.js @@ -0,0 +1,29 @@ +// ==UserScript== +// @name Word Filter for textboard.org +// @namespace http://textboard.org +// @description Replace words with other words +// @version 1 +// @match *://textboard.org/* +// @grant none +// ==/UserScript== +(function() { + 'use strict'; + var replacements, regex, key, textnodes, node, s; + replacements = { + "nigger": "mujina", + "faggot": "baku", + }; + regex = {}; + for (key in replacements) { + regex[key] = new RegExp(key, 'gi'); + } + textnodes = document.evaluate( "//body//text()", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); + for (var i = 0; i < textnodes.snapshotLength; i++) { + node = textnodes.snapshotItem(i); + s = node.data; + for (key in replacements) { + s = s.replace(regex[key], replacements[key]); + } + node.data = s; + } +})(); -- cgit v1.2.3