From: JTH Date: Fri, 30 Sep 2022 18:12:53 +0000 (+0200) Subject: Redirect to archive if topic is gone X-Git-Url: https://git.aero2k.de/?p=dfde%2Fquickmods.git;a=commitdiff_plain;h=cdd0440402c168ff58f37d14e124d53fc011fef8 Redirect to archive if topic is gone --- diff --git a/quickmod.user.js b/quickmod.user.js index 8307483..8dbbd14 100644 --- a/quickmod.user.js +++ b/quickmod.user.js @@ -114,6 +114,13 @@ function prefixSubject(input, reason) { return subject.slice(0, maxLen); } +function redirectToArchive() { + /* TODO: Make the location configurable, redirect to homepage, "Aktive + * Themen", "Neue Beiträge", or other? + */ + window.location = `./viewforum.php?f=${ARCHIVFORUMID}`; +} + async function remove_post_handler(event) { const post = event.currentTarget.closest('.post'); const usernameElem = post.querySelector(".author .username,.author .username-coloured"); @@ -210,10 +217,7 @@ function updatePageAfterSplit(post) { if (document.querySelectorAll(".post").length > 1) { post.parentNode.removeChild(post); } else { - /* TODO: Make the location configurable, redirect to homepage, "Aktive - * Themen", "Neue Beiträge", or other? - */ - window.location = "/"; + redirectToArchive(); } }