Skip to content

Commit 9294c83

Browse files
committed
update: remove MAUL profile buttons from members page & tooltip
This feature has been implemented in the base forums
1 parent d8e0ce9 commit 9294c83

1 file changed

Lines changed: 4 additions & 88 deletions

File tree

src/EGO Forum Enhancement.ts

Lines changed: 4 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ==UserScript==
22
// @name EdgeGamers Forum Enhancement%RELEASE_TYPE%
33
// @namespace https://github.com/blankdvth/eGOScripts/blob/master/src/EGO%20Forum%20Enhancement.ts
4-
// @version 4.11.6
4+
// @version 4.11.7
55
// @description Add various enhancements & QOL additions to the EdgeGamers Forums that are beneficial for Leadership members.
66
// @author blank_dvth, Skle, MSWS, PixeL
77
// @match https://www.edgegamers.com/*
@@ -133,13 +133,6 @@ function setupForumsConfig() {
133133
id: "forums-config",
134134
title: "Forums Enhancement Script Configuration",
135135
fields: {
136-
"maul-dropdown": {
137-
label: "Use dropdown for MAUL links",
138-
section: ["Feature Settings"],
139-
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.",
140-
type: "checkbox",
141-
default: true,
142-
},
143136
"show-confidential-watermark": {
144137
label: "Show confidential watermarks on LE forums",
145138
title: "When checked, all LE forums will have a red confidential watermark on them.",
@@ -170,18 +163,6 @@ function setupForumsConfig() {
170163
type: "checkbox",
171164
default: true,
172165
},
173-
"maul-button-text": {
174-
label: "MAUL Button Text",
175-
title: "The text to display on the MAUL buttons that are displayed on profiles",
176-
type: "text",
177-
default: "MAUL",
178-
},
179-
"append-profile": {
180-
label: "Append profile buttons",
181-
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.",
182-
type: "checkbox",
183-
default: false,
184-
},
185166
"maul-reauth-enable": {
186167
label: "Enable MAUL Reauthenthication",
187168
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() {
810791
function addMAULProfileButton(div: HTMLDivElement, member_id: number | string) {
811792
createButton(
812793
"https://maul.edgegamers.com/index.php?page=home&id=" + member_id,
813-
GM_config.get("maul-button-text") as string,
794+
"MAUL",
814795
div,
815-
"_blank",
816-
GM_config.get("append-profile") as boolean,
796+
"_blank"
817797
);
818798
}
819799

@@ -1647,52 +1627,6 @@ function generateResponseText(response: string) {
16471627
.replaceAll("{{{op username}}}", getOP()?.innerText ?? "");
16481628
}
16491629

1650-
/**
1651-
* Listens to and appends MAUL button when user hovers over a profile
1652-
* @param {HTMLElementEventMap} event
1653-
* @returns void
1654-
*/
1655-
function tooltipMAULListener(target: HTMLElement) {
1656-
// Make sure this specific event is the node we want
1657-
if (
1658-
target.nodeName != "DIV" ||
1659-
!target.classList.contains("tooltip-content-inner")
1660-
)
1661-
return;
1662-
1663-
// The buttongroup containing the "Follow" button
1664-
const buttenGroupOne = target.querySelector(
1665-
".memberTooltip > .memberTooltip-actions > :nth-child(1)",
1666-
) as HTMLDivElement;
1667-
if (!buttenGroupOne) return;
1668-
buttenGroupOne
1669-
.querySelector("a")
1670-
?.href.match(
1671-
/^https:\/\/www\.edgegamers\.com\/members\/(\d+)\/follow$/,
1672-
);
1673-
const matches = buttenGroupOne
1674-
.querySelector("a")
1675-
?.href.match(
1676-
/^https:\/\/www\.edgegamers\.com\/members\/(\d+)\/follow$/,
1677-
);
1678-
// Make sure matches were found, exit gracefully if not.
1679-
if (!matches) return;
1680-
1681-
const id = matches[1];
1682-
// The buttongroup containing the "Start conversation" button
1683-
const buttonGroupTwo = target.querySelector(
1684-
".memberTooltip > .memberTooltip-actions > :nth-child(2)",
1685-
) as HTMLDivElement;
1686-
// If the user is banned, buttonGroupTwo will be null. Default to buttonGroupOne.
1687-
createButton(
1688-
"https://maul.edgegamers.com/index.php?page=home&id=" + id,
1689-
GM_config.get("maul-button-text") as string,
1690-
buttonGroupTwo ?? buttenGroupOne,
1691-
"_blank",
1692-
GM_config.get("append-profile") as boolean,
1693-
);
1694-
}
1695-
16961630
/**
16971631
* Moves and auto-fills out the moving prompt for a thread.
16981632
* @param {string} hash The hash of the URL, should be the thread ID only
@@ -2439,18 +2373,6 @@ function blockSignatures() {
24392373
const url = window.location.href;
24402374
const hash = window.location.hash;
24412375

2442-
const tooltipObserver = new MutationObserver((mutations) => {
2443-
mutations.every((mutation) => {
2444-
mutation.addedNodes.forEach((node) => {
2445-
tooltipMAULListener(node as HTMLElement);
2446-
});
2447-
});
2448-
});
2449-
tooltipObserver.observe(document.body, {
2450-
childList: true,
2451-
subtree: true,
2452-
});
2453-
24542376
const onHoldObserver = new MutationObserver((mutations) => {
24552377
mutations.every((mutation) => {
24562378
mutation.addedNodes.forEach((node) => {
@@ -2473,13 +2395,7 @@ function blockSignatures() {
24732395
removeNavButtons(navbarRemovals, nav_list);
24742396
replaceLogoLink();
24752397

2476-
if (url.match(/^https:\/\/www\.edgegamers\.com\/members\/\d+/))
2477-
// Members Page
2478-
addMAULProfileButton(
2479-
document.querySelector(".memberHeader-buttons") as HTMLDivElement,
2480-
window.location.pathname.match(/\/members\/(\d+)/)![1],
2481-
);
2482-
else if (
2398+
if (
24832399
url.match(
24842400
/^^https:\/\/www\.edgegamers\.com\/threads\/\d+\/move(?:#\d+)?$/,
24852401
) &&

0 commit comments

Comments
 (0)