From 9294c83cebae13ac57f06269a313ee21b3d23cac Mon Sep 17 00:00:00 2001 From: blankdvth Date: Mon, 22 Dec 2025 05:10:08 -0500 Subject: [PATCH 1/6] update: remove MAUL profile buttons from members page & tooltip This feature has been implemented in the base forums --- src/EGO Forum Enhancement.ts | 92 ++---------------------------------- 1 file changed, 4 insertions(+), 88 deletions(-) diff --git a/src/EGO Forum Enhancement.ts b/src/EGO Forum Enhancement.ts index 51a2f4f..cd0d91c 100644 --- a/src/EGO Forum Enhancement.ts +++ b/src/EGO Forum Enhancement.ts @@ -1,7 +1,7 @@ // ==UserScript== // @name EdgeGamers Forum Enhancement%RELEASE_TYPE% // @namespace https://github.com/blankdvth/eGOScripts/blob/master/src/EGO%20Forum%20Enhancement.ts -// @version 4.11.6 +// @version 4.11.7 // @description Add various enhancements & QOL additions to the EdgeGamers Forums that are beneficial for Leadership members. // @author blank_dvth, Skle, MSWS, PixeL // @match https://www.edgegamers.com/* @@ -133,13 +133,6 @@ function setupForumsConfig() { id: "forums-config", title: "Forums Enhancement Script Configuration", fields: { - "maul-dropdown": { - label: "Use dropdown for MAUL links", - section: ["Feature Settings"], - title: "When checked, all additional MAUL links will be in a dropdown in the original MAUL button. When unchecked, all MAUL buttons will be added to the navigation bar after the MAUL button.", - type: "checkbox", - default: true, - }, "show-confidential-watermark": { label: "Show confidential watermarks on LE forums", title: "When checked, all LE forums will have a red confidential watermark on them.", @@ -170,18 +163,6 @@ function setupForumsConfig() { type: "checkbox", default: true, }, - "maul-button-text": { - label: "MAUL Button Text", - title: "The text to display on the MAUL buttons that are displayed on profiles", - type: "text", - default: "MAUL", - }, - "append-profile": { - label: "Append profile buttons", - title: "When checked, a buttons added to profiles will be appended to their respective groups, else, they will be prepended. This does not apply to all buttons.", - type: "checkbox", - default: false, - }, "maul-reauth-enable": { label: "Enable MAUL Reauthenthication", title: "When checked, the script will automatically reauthenthicate with MAUL in the background if it's been a while since the last authenthication (see timeout below).", @@ -810,10 +791,9 @@ function loadCannedResponses() { function addMAULProfileButton(div: HTMLDivElement, member_id: number | string) { createButton( "https://maul.edgegamers.com/index.php?page=home&id=" + member_id, - GM_config.get("maul-button-text") as string, + "MAUL", div, - "_blank", - GM_config.get("append-profile") as boolean, + "_blank" ); } @@ -1647,52 +1627,6 @@ function generateResponseText(response: string) { .replaceAll("{{{op username}}}", getOP()?.innerText ?? ""); } -/** - * Listens to and appends MAUL button when user hovers over a profile - * @param {HTMLElementEventMap} event - * @returns void - */ -function tooltipMAULListener(target: HTMLElement) { - // Make sure this specific event is the node we want - if ( - target.nodeName != "DIV" || - !target.classList.contains("tooltip-content-inner") - ) - return; - - // The buttongroup containing the "Follow" button - const buttenGroupOne = target.querySelector( - ".memberTooltip > .memberTooltip-actions > :nth-child(1)", - ) as HTMLDivElement; - if (!buttenGroupOne) return; - buttenGroupOne - .querySelector("a") - ?.href.match( - /^https:\/\/www\.edgegamers\.com\/members\/(\d+)\/follow$/, - ); - const matches = buttenGroupOne - .querySelector("a") - ?.href.match( - /^https:\/\/www\.edgegamers\.com\/members\/(\d+)\/follow$/, - ); - // Make sure matches were found, exit gracefully if not. - if (!matches) return; - - const id = matches[1]; - // The buttongroup containing the "Start conversation" button - const buttonGroupTwo = target.querySelector( - ".memberTooltip > .memberTooltip-actions > :nth-child(2)", - ) as HTMLDivElement; - // If the user is banned, buttonGroupTwo will be null. Default to buttonGroupOne. - createButton( - "https://maul.edgegamers.com/index.php?page=home&id=" + id, - GM_config.get("maul-button-text") as string, - buttonGroupTwo ?? buttenGroupOne, - "_blank", - GM_config.get("append-profile") as boolean, - ); -} - /** * Moves and auto-fills out the moving prompt for a thread. * @param {string} hash The hash of the URL, should be the thread ID only @@ -2439,18 +2373,6 @@ function blockSignatures() { const url = window.location.href; const hash = window.location.hash; - const tooltipObserver = new MutationObserver((mutations) => { - mutations.every((mutation) => { - mutation.addedNodes.forEach((node) => { - tooltipMAULListener(node as HTMLElement); - }); - }); - }); - tooltipObserver.observe(document.body, { - childList: true, - subtree: true, - }); - const onHoldObserver = new MutationObserver((mutations) => { mutations.every((mutation) => { mutation.addedNodes.forEach((node) => { @@ -2473,13 +2395,7 @@ function blockSignatures() { removeNavButtons(navbarRemovals, nav_list); replaceLogoLink(); - if (url.match(/^https:\/\/www\.edgegamers\.com\/members\/\d+/)) - // Members Page - addMAULProfileButton( - document.querySelector(".memberHeader-buttons") as HTMLDivElement, - window.location.pathname.match(/\/members\/(\d+)/)![1], - ); - else if ( + if ( url.match( /^^https:\/\/www\.edgegamers\.com\/threads\/\d+\/move(?:#\d+)?$/, ) && From f47cc18d7cf7820120f1b3d843a270be975bc5f9 Mon Sep 17 00:00:00 2001 From: blankdvth Date: Mon, 22 Dec 2025 05:10:32 -0500 Subject: [PATCH 2/6] update: disable MAUL reauth until future fix --- src/EGO Forum Enhancement.ts | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/EGO Forum Enhancement.ts b/src/EGO Forum Enhancement.ts index cd0d91c..fb205fd 100644 --- a/src/EGO Forum Enhancement.ts +++ b/src/EGO Forum Enhancement.ts @@ -651,21 +651,22 @@ function setupForumsConfig() { * Automatically authenthicates with MAUL in the background if it's been a while since the last authenthication */ function autoMAULAuth() { - if (!GM_config.get("maul-reauth-enable")) return; - const lastAuth = GM_getValue("lastMAULAuth", 0); - if (Date.now() - lastAuth < (GM_config.get("maul-reauth") as number)) - return; - const authLink = document.querySelector( - 'a.p-navEl-link[href^="/maul"]', - ) as HTMLAnchorElement; - if (!authLink) return; - GM_xmlhttpRequest({ - method: "GET", - url: authLink.href, - onload: function () { - GM_setValue("lastMAULAuth", Date.now()); - }, - }); + console.warn("MAUL reauth feature is currently disabled due to issues with the feature. Your config settings have been preserved, and the feature will return once fixed."); + // if (!GM_config.get("maul-reauth-enable")) return; + // const lastAuth = GM_getValue("lastMAULAuth", 0); + // if (Date.now() - lastAuth < (GM_config.get("maul-reauth") as number)) + // return; + // const authLink = document.querySelector( + // 'a.p-navEl-link[href^="/maul"]', + // ) as HTMLAnchorElement; + // if (!authLink) return; + // GM_xmlhttpRequest({ + // method: "GET", + // url: authLink.href, + // onload: function () { + // GM_setValue("lastMAULAuth", Date.now()); + // }, + // }); } /** From aa21574b4b058447ffe2b942728b0578b5f4ee7d Mon Sep 17 00:00:00 2001 From: blankdvth Date: Mon, 22 Dec 2025 05:12:03 -0500 Subject: [PATCH 3/6] update: remove on hold templates This feature has been implemented in the base forums --- src/EGO Forum Enhancement.ts | 136 ----------------------------------- 1 file changed, 136 deletions(-) diff --git a/src/EGO Forum Enhancement.ts b/src/EGO Forum Enhancement.ts index fb205fd..711769f 100644 --- a/src/EGO Forum Enhancement.ts +++ b/src/EGO Forum Enhancement.ts @@ -33,12 +33,6 @@ interface NavbarURL_Map { url: string; } -interface OnHold_Map { - name: string; - reason: string; - explain: string; -} - interface CannedResponse { name: string; response: string; @@ -48,7 +42,6 @@ const completedMap: Completed_Map[] = []; const signatureBlockList: string[] = []; const navbarURLs: NavbarURL_Map[] = []; const navbarRemovals: string[] = []; -const onHoldTemplates: OnHold_Map[] = []; const autoMentionForums: string[] = []; const cannedResponses: { [category: string]: CannedResponse[] } = {}; const appealForums: string[] = ["1234", "1236"]; @@ -253,22 +246,6 @@ function setupForumsConfig() { type: "textarea", default: "", }, - "on-hold-unchecked": { - label: "On Hold Templates", - section: [ - "On Hold Templates", - "See this guide on how to format your templates.", - ], - type: "textarea", - save: false, - default: - "No MAUL Account (Reason);MAUL account must be created and verified;\nSteam Verification;Steam account must be verified in MAUL;In order for you to fix this you'll need to click the MAUL link at the top of the page in the navbar, click \"Edit Game IDs,\" then click the Sign in through Steam button under the Source ID section. Once you've done so, please reply to this post!\nMinecraft Verification;Minecraft ID must be verified in MAUL;In order for you to fix this you'll need to click the MAUL link at the top of the page in the navbar, click \"Edit Game IDs,\" then under ID for Minecraft, input your Minecraft username, click Convert to Game ID, then log onto our Minecraft server. Once you've done so, please reply to this post!\"\nBattlefield Verification;Battlefield account must be verified in MAUL;In order for you to fix this you'll need to click the MAUL link at the top of the page in the navbar, in MAUL hover over the home link in the top left, click help, then follow the instructions for Battlefield. Once you have done so, please reply to this post!\nDiscord Verification;Discord ID must be verfied in MAUL;In order for you to fix this you'll need to click the MAUL link at the top of the page in the navbar, click \"Edit Game IDs,\" then click the sign in through Discord button under the discord ID section. Once you have done so, please reply to this post!\nInappropriate Name;Inappropriate Name;As for your name, Please click [URL='https://www.edgegamers.com/account/username']here[/URL] and fill out a name change request. After you fill it out, please wait while your name change request is finalized and the change is completed. Once it is done your application process will resume. If you want to have an understanding on our naming policy inside of eGO please click [URL='https://www.edgegamers.com/threads/378540/']here[/URL].", - }, - "on-hold": { - type: "hidden", - default: - "No MAUL Account (Reason);MAUL account must be created and verified;\nSteam Verification;Steam account must be verified in MAUL;In order for you to fix this you'll need to click the MAUL link at the top of the page in the navbar, click \"Edit Game IDs,\" then click the Sign in through Steam button under the Source ID section. Once you've done so, please reply to this post!\nMinecraft Verification;Minecraft ID must be verified in MAUL;In order for you to fix this you'll need to click the MAUL link at the top of the page in the navbar, click \"Edit Game IDs,\" then under ID for Minecraft, input your Minecraft username, click Convert to Game ID, then log onto our Minecraft server. Once you've done so, please reply to this post!\"\nBattlefield Verification;Battlefield account must be verified in MAUL;In order for you to fix this you'll need to click the MAUL link at the top of the page in the navbar, in MAUL hover over the home link in the top left, click help, then follow the instructions for Battlefield. Once you have done so, please reply to this post!\nDiscord Verification;Discord ID must be verfied in MAUL;In order for you to fix this you'll need to click the MAUL link at the top of the page in the navbar, click \"Edit Game IDs,\" then click the sign in through Discord button under the discord ID section. Once you have done so, please reply to this post!\nInappropriate Name;Inappropriate Name;As for your name, Please click [URL='https://www.edgegamers.com/account/username']here[/URL] and fill out a name change request. After you fill it out, please wait while your name change request is finalized and the change is completed. Once it is done your application process will resume. If you want to have an understanding on our naming policy inside of eGO please click [URL='https://www.edgegamers.com/threads/378540/']here[/URL].", - }, "auto-mention-unchecked": { label: "Auto Mention (Subforum IDs)", section: [ @@ -509,26 +486,6 @@ function setupForumsConfig() { ) GM_config.set("navbar-urls", urls); }); - GM_config.fields["on-hold-unchecked"].node?.addEventListener( - "change", - function () { - const onHold = GM_config.get( - "on-hold-unchecked", - true, - ) as string; - if ( - onHold.length == 0 || - onHold - .split(/\r?\n/) - .every((line) => - line.match( - /^[^;\r\n]+;[^;\r\n]*;[^;\r\n]*$/, - ), - ) - ) - GM_config.set("on-hold", onHold); - }, - ); GM_config.fields[ "auto-mention-unchecked" ].node?.addEventListener("change", function () { @@ -586,10 +543,6 @@ function setupForumsConfig() { alert( "Invalid navbar URL list. Ensure each URL is valid, on it's own line, and all URLs are in the format 'text;url'.", ); - if (forgotten["on-hold-unchecked"] !== GM_config.get("on-hold")) - alert( - "Invalid on hold list. Ensure each line is in the format 'name;reason;explain' and that no field contains a semicolon.", - ); if ( forgotten["auto-mention-unchecked"] !== GM_config.get("auto-mention") @@ -735,26 +688,6 @@ function loadNavbarRemovals() { }); } -/** - * Loads the on hold templates from config - */ -function loadOnHoldTemplates() { - const onHoldTemplatesRaw = GM_config.get("on-hold") as string; - if (onHoldTemplatesRaw.length == 0) return; - onHoldTemplatesRaw.split(/\r?\n/).forEach((line) => { - const parts = line.split(";"); - if (parts.length != 3) { - alert("Invalid on hold line: " + line); - return; - } - onHoldTemplates.push({ - name: parts[0], - reason: parts[1], - explain: parts[2], - }); - }); -} - /** * Loads the auto mention list from config */ @@ -1874,62 +1807,6 @@ function handleBanAppealReport(report: boolean = false) { } } -/** - * Adds "On Hold" templates to the menu and increases the size of the explain box. - * @param {HTMLElementEventMap} event - * @returns void - */ -function handleOnHold(target: HTMLElement) { - if ( - target.nodeName != "DIV" || - !target.classList.contains("overlay-container") || - !( - target.querySelector(".overlay > .overlay-title") as HTMLDivElement - ).innerText.includes("on hold") - ) - return; - - // Event may fire twice - add a mark the first time it fires, and ignore the rest - const mark = document.createElement("input"); - mark.type = "hidden"; - target.append(mark); - if (target.childNodes.length > 2) return; - - const body = target.querySelector( - ".overlay > .overlay-content > form > .block-container > .block-body", - ) as HTMLDivElement; - const reason = body.querySelector( - ":nth-child(1) > dd > input", - ) as HTMLInputElement; - var explain = body.querySelector( - ":nth-child(2) > dd > input", - ) as HTMLInputElement; - // Convert the explain input into a textarea - explain.outerHTML = explain.outerHTML.replace("input", "textarea"); - // Variable gets dereferenced - reference it again - explain = body.querySelector(":nth-child(2) > dd > textarea")!; - explain.style.height = "200px"; - explain.setAttribute("maxlength", "1024"); - const div = body.querySelector( - ":nth-child(4) > dd > div > .formSubmitRow-controls", - ) as HTMLDivElement; - - // Insert presets - for (var i = 0; i < onHoldTemplates.length; i++) { - addForumsPreset( - onHoldTemplates[i].name, - i.toString(), - div, - function (this: HTMLElement) { - const preset = - onHoldTemplates[this.dataset.presetId as unknown as number]; - if (preset.reason) reason.value = preset.reason; - if (preset.explain) explain.value = preset.explain; - }, - ); - } -} - /** * Adds a button to open the script config in the user dropdown menu * @param insertParent The parent element to insert into @@ -2366,7 +2243,6 @@ function blockSignatures() { loadSignatureBlockList(); loadNavbarURLs(); loadNavbarRemovals(); - loadOnHoldTemplates(); loadAutoMentionList(); loadCannedResponses(); @@ -2374,18 +2250,6 @@ function blockSignatures() { const url = window.location.href; const hash = window.location.hash; - const onHoldObserver = new MutationObserver((mutations) => { - mutations.every((mutation) => { - mutation.addedNodes.forEach((node) => { - handleOnHold(node as HTMLElement); - }); - }); - }); - onHoldObserver.observe(document.body, { - childList: true, - subtree: true, - }); - // Add Helpful Links to the Navigation Bar const nav_list = document.querySelector(".p-nav-list") as HTMLUListElement; addMAULNav(nav_list); From 479de56d0a5f35951f9296a2161208eb30efafa9 Mon Sep 17 00:00:00 2001 From: blankdvth Date: Mon, 22 Dec 2025 10:13:16 +0000 Subject: [PATCH 4/6] Prettified Code! --- src/EGO Forum Enhancement.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/EGO Forum Enhancement.ts b/src/EGO Forum Enhancement.ts index 711769f..71f528a 100644 --- a/src/EGO Forum Enhancement.ts +++ b/src/EGO Forum Enhancement.ts @@ -604,7 +604,9 @@ function setupForumsConfig() { * Automatically authenthicates with MAUL in the background if it's been a while since the last authenthication */ function autoMAULAuth() { - console.warn("MAUL reauth feature is currently disabled due to issues with the feature. Your config settings have been preserved, and the feature will return once fixed."); + console.warn( + "MAUL reauth feature is currently disabled due to issues with the feature. Your config settings have been preserved, and the feature will return once fixed.", + ); // if (!GM_config.get("maul-reauth-enable")) return; // const lastAuth = GM_getValue("lastMAULAuth", 0); // if (Date.now() - lastAuth < (GM_config.get("maul-reauth") as number)) @@ -727,7 +729,7 @@ function addMAULProfileButton(div: HTMLDivElement, member_id: number | string) { "https://maul.edgegamers.com/index.php?page=home&id=" + member_id, "MAUL", div, - "_blank" + "_blank", ); } From c15409010944433b328b75208c8273f41249ca2c Mon Sep 17 00:00:00 2001 From: blankdvth Date: Mon, 22 Dec 2025 05:15:22 -0500 Subject: [PATCH 5/6] fix: remove leftover on-hold config --- src/EGO Forum Enhancement.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/EGO Forum Enhancement.ts b/src/EGO Forum Enhancement.ts index 71f528a..57362db 100644 --- a/src/EGO Forum Enhancement.ts +++ b/src/EGO Forum Enhancement.ts @@ -427,7 +427,6 @@ function setupForumsConfig() { "navbar-urls-unchecked", GM_config.get("navbar-urls"), ); - GM_config.set("on-hold-unchecked", GM_config.get("on-hold")); GM_config.set( "auto-mention-unchecked", GM_config.get("auto-mention"), From 765e34953e670e1618b87b60932a27477f5c8cfb Mon Sep 17 00:00:00 2001 From: blankdvth Date: Mon, 22 Dec 2025 05:16:44 -0500 Subject: [PATCH 6/6] fix: readd mistakenly removed maul-dropdown --- src/EGO Forum Enhancement.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/EGO Forum Enhancement.ts b/src/EGO Forum Enhancement.ts index 57362db..565fc0f 100644 --- a/src/EGO Forum Enhancement.ts +++ b/src/EGO Forum Enhancement.ts @@ -126,6 +126,13 @@ function setupForumsConfig() { id: "forums-config", title: "Forums Enhancement Script Configuration", fields: { + "maul-dropdown": { + label: "Use dropdown for MAUL links", + section: ["Feature Settings"], + title: "When checked, all additional MAUL links will be in a dropdown in the original MAUL button. When unchecked, all MAUL buttons will be added to the navigation bar after the MAUL button.", + type: "checkbox", + default: true, + }, "show-confidential-watermark": { label: "Show confidential watermarks on LE forums", title: "When checked, all LE forums will have a red confidential watermark on them.",