summaryrefslogtreecommitdiff
path: root/static/userscripts
diff options
context:
space:
mode:
authorchers <admin@tilde.tailb619f6.ts.net>2026-07-31 09:18:39 +0000
committerchers <admin@tilde.tailb619f6.ts.net>2026-07-31 09:18:39 +0000
commit7023e4c7c8f158df78b5e71ddc2640290409eca1 (patch)
tree077fb46bdb484bbbf7f9a81fd1d512f66650be10 /static/userscripts
Update cl-bbsHEADmaster
Diffstat (limited to 'static/userscripts')
-rw-r--r--static/userscripts/highlight.user.js22
-rw-r--r--static/userscripts/localjump.user.js17
-rw-r--r--static/userscripts/unvip.user.js18
-rw-r--r--static/userscripts/wordfilter.user.js29
4 files changed, 86 insertions, 0 deletions
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;
+ }
+})();