From ed19a428cb5eef84c8cf3fed5fda3afd5fc96305 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sun, 18 Jan 2026 23:43:12 +0100 Subject: Move client scripts to build-crate --- ui/client-scripts/src/dangerbutton.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 ui/client-scripts/src/dangerbutton.ts (limited to 'ui/client-scripts/src/dangerbutton.ts') diff --git a/ui/client-scripts/src/dangerbutton.ts b/ui/client-scripts/src/dangerbutton.ts new file mode 100644 index 0000000..b33b3dc --- /dev/null +++ b/ui/client-scripts/src/dangerbutton.ts @@ -0,0 +1,14 @@ +/* + This file is part of jellything (https://codeberg.org/metamuffin/jellything) + which is licensed under the GNU Affero General Public License (version 3); see /COPYING. + Copyright (C) 2026 metamuffin +*/ +globalThis.addEventListener("DOMContentLoaded", () => { + document.querySelectorAll("input.danger").forEach(el => { + el.addEventListener("click", ev => { + if (!confirm(`Really ${(el as HTMLInputElement).value}?`)) { + ev.preventDefault() + } + }) + }) +}) -- cgit v1.3