Skip to content

Commit aa21574

Browse files
committed
update: remove on hold templates
This feature has been implemented in the base forums
1 parent f47cc18 commit aa21574

1 file changed

Lines changed: 0 additions & 136 deletions

File tree

src/EGO Forum Enhancement.ts

Lines changed: 0 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@ interface NavbarURL_Map {
3333
url: string;
3434
}
3535

36-
interface OnHold_Map {
37-
name: string;
38-
reason: string;
39-
explain: string;
40-
}
41-
4236
interface CannedResponse {
4337
name: string;
4438
response: string;
@@ -48,7 +42,6 @@ const completedMap: Completed_Map[] = [];
4842
const signatureBlockList: string[] = [];
4943
const navbarURLs: NavbarURL_Map[] = [];
5044
const navbarRemovals: string[] = [];
51-
const onHoldTemplates: OnHold_Map[] = [];
5245
const autoMentionForums: string[] = [];
5346
const cannedResponses: { [category: string]: CannedResponse[] } = {};
5447
const appealForums: string[] = ["1234", "1236"];
@@ -253,22 +246,6 @@ function setupForumsConfig() {
253246
type: "textarea",
254247
default: "",
255248
},
256-
"on-hold-unchecked": {
257-
label: "On Hold Templates",
258-
section: [
259-
"On Hold Templates",
260-
"See <a href='https://github.com/blankdvth/eGOScripts/wiki/On-Hold-Templates' target='_blank'>this guide</a> on how to format your templates.",
261-
],
262-
type: "textarea",
263-
save: false,
264-
default:
265-
"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].",
266-
},
267-
"on-hold": {
268-
type: "hidden",
269-
default:
270-
"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].",
271-
},
272249
"auto-mention-unchecked": {
273250
label: "Auto Mention (Subforum IDs)",
274251
section: [
@@ -509,26 +486,6 @@ function setupForumsConfig() {
509486
)
510487
GM_config.set("navbar-urls", urls);
511488
});
512-
GM_config.fields["on-hold-unchecked"].node?.addEventListener(
513-
"change",
514-
function () {
515-
const onHold = GM_config.get(
516-
"on-hold-unchecked",
517-
true,
518-
) as string;
519-
if (
520-
onHold.length == 0 ||
521-
onHold
522-
.split(/\r?\n/)
523-
.every((line) =>
524-
line.match(
525-
/^[^;\r\n]+;[^;\r\n]*;[^;\r\n]*$/,
526-
),
527-
)
528-
)
529-
GM_config.set("on-hold", onHold);
530-
},
531-
);
532489
GM_config.fields[
533490
"auto-mention-unchecked"
534491
].node?.addEventListener("change", function () {
@@ -586,10 +543,6 @@ function setupForumsConfig() {
586543
alert(
587544
"Invalid navbar URL list. Ensure each URL is valid, on it's own line, and all URLs are in the format 'text;url'.",
588545
);
589-
if (forgotten["on-hold-unchecked"] !== GM_config.get("on-hold"))
590-
alert(
591-
"Invalid on hold list. Ensure each line is in the format 'name;reason;explain' and that no field contains a semicolon.",
592-
);
593546
if (
594547
forgotten["auto-mention-unchecked"] !==
595548
GM_config.get("auto-mention")
@@ -735,26 +688,6 @@ function loadNavbarRemovals() {
735688
});
736689
}
737690

738-
/**
739-
* Loads the on hold templates from config
740-
*/
741-
function loadOnHoldTemplates() {
742-
const onHoldTemplatesRaw = GM_config.get("on-hold") as string;
743-
if (onHoldTemplatesRaw.length == 0) return;
744-
onHoldTemplatesRaw.split(/\r?\n/).forEach((line) => {
745-
const parts = line.split(";");
746-
if (parts.length != 3) {
747-
alert("Invalid on hold line: " + line);
748-
return;
749-
}
750-
onHoldTemplates.push({
751-
name: parts[0],
752-
reason: parts[1],
753-
explain: parts[2],
754-
});
755-
});
756-
}
757-
758691
/**
759692
* Loads the auto mention list from config
760693
*/
@@ -1874,62 +1807,6 @@ function handleBanAppealReport(report: boolean = false) {
18741807
}
18751808
}
18761809

1877-
/**
1878-
* Adds "On Hold" templates to the menu and increases the size of the explain box.
1879-
* @param {HTMLElementEventMap} event
1880-
* @returns void
1881-
*/
1882-
function handleOnHold(target: HTMLElement) {
1883-
if (
1884-
target.nodeName != "DIV" ||
1885-
!target.classList.contains("overlay-container") ||
1886-
!(
1887-
target.querySelector(".overlay > .overlay-title") as HTMLDivElement
1888-
).innerText.includes("on hold")
1889-
)
1890-
return;
1891-
1892-
// Event may fire twice - add a mark the first time it fires, and ignore the rest
1893-
const mark = document.createElement("input");
1894-
mark.type = "hidden";
1895-
target.append(mark);
1896-
if (target.childNodes.length > 2) return;
1897-
1898-
const body = target.querySelector(
1899-
".overlay > .overlay-content > form > .block-container > .block-body",
1900-
) as HTMLDivElement;
1901-
const reason = body.querySelector(
1902-
":nth-child(1) > dd > input",
1903-
) as HTMLInputElement;
1904-
var explain = body.querySelector(
1905-
":nth-child(2) > dd > input",
1906-
) as HTMLInputElement;
1907-
// Convert the explain input into a textarea
1908-
explain.outerHTML = explain.outerHTML.replace("input", "textarea");
1909-
// Variable gets dereferenced - reference it again
1910-
explain = body.querySelector(":nth-child(2) > dd > textarea")!;
1911-
explain.style.height = "200px";
1912-
explain.setAttribute("maxlength", "1024");
1913-
const div = body.querySelector(
1914-
":nth-child(4) > dd > div > .formSubmitRow-controls",
1915-
) as HTMLDivElement;
1916-
1917-
// Insert presets
1918-
for (var i = 0; i < onHoldTemplates.length; i++) {
1919-
addForumsPreset(
1920-
onHoldTemplates[i].name,
1921-
i.toString(),
1922-
div,
1923-
function (this: HTMLElement) {
1924-
const preset =
1925-
onHoldTemplates[this.dataset.presetId as unknown as number];
1926-
if (preset.reason) reason.value = preset.reason;
1927-
if (preset.explain) explain.value = preset.explain;
1928-
},
1929-
);
1930-
}
1931-
}
1932-
19331810
/**
19341811
* Adds a button to open the script config in the user dropdown menu
19351812
* @param insertParent The parent element to insert into
@@ -2366,26 +2243,13 @@ function blockSignatures() {
23662243
loadSignatureBlockList();
23672244
loadNavbarURLs();
23682245
loadNavbarRemovals();
2369-
loadOnHoldTemplates();
23702246
loadAutoMentionList();
23712247
loadCannedResponses();
23722248

23732249
// Determine what page we're on
23742250
const url = window.location.href;
23752251
const hash = window.location.hash;
23762252

2377-
const onHoldObserver = new MutationObserver((mutations) => {
2378-
mutations.every((mutation) => {
2379-
mutation.addedNodes.forEach((node) => {
2380-
handleOnHold(node as HTMLElement);
2381-
});
2382-
});
2383-
});
2384-
onHoldObserver.observe(document.body, {
2385-
childList: true,
2386-
subtree: true,
2387-
});
2388-
23892253
// Add Helpful Links to the Navigation Bar
23902254
const nav_list = document.querySelector(".p-nav-list") as HTMLUListElement;
23912255
addMAULNav(nav_list);

0 commit comments

Comments
 (0)