Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(EternalNetwork TM): add support for three new websites #6679

Merged
merged 23 commits into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
998f09a
feat(EternalNetwork TM): add new presence
TheDjRider Aug 20, 2022
13a035a
fix(EternalNetwork TM): translation function and requested changes
TheDjRider Aug 21, 2022
650d16c
Merge branch 'PreMiD:main' into main
TheDjRider Aug 21, 2022
98915f8
Merge branch 'PreMiD:main' into main
TheDjRider Aug 23, 2022
6310c13
fix(EternalNetwork TM): requested changes
TheDjRider Aug 23, 2022
266f59a
Merge branch 'PreMiD:main' into main
TheDjRider Aug 26, 2022
9d4c846
fix(EternalNetwork TM): requested changes and new tracking
TheDjRider Aug 26, 2022
9f1ba78
fix(EternalNetwork TM): requested changes and new page messages
TheDjRider Aug 26, 2022
4be906a
Merge branch 'main' into main
TheDjRider Aug 29, 2022
99a0abf
Merge branch 'PreMiD:main' into main
TheDjRider Aug 29, 2022
e6a4c76
Merge branch 'PreMiD:main' into main
TheDjRider Aug 30, 2022
8331143
fix(EternalNetwork TM): requested changes
TheDjRider Aug 30, 2022
65b9d6b
Merge branch 'PreMiD:main' into main
TheDjRider Aug 31, 2022
18a5e7d
Merge branch 'PreMiD:main' into main
TheDjRider Sep 1, 2022
7e0efa2
Merge branch 'PreMiD:main' into main
TheDjRider Sep 3, 2022
b4ddaa9
fix(EternalNetwork TM): requested changes, changed messages
TheDjRider Sep 3, 2022
e1f95bc
fix(EternalNetwork TM): Fixing messages
TheDjRider Sep 3, 2022
cde112c
Merge branch 'PreMiD:main' into main
TheDjRider Sep 4, 2022
178719f
Merge branch 'PreMiD:main' into main
TheDjRider Sep 4, 2022
ce167d7
Merge branch 'PreMiD:main' into main
TheDjRider Sep 5, 2022
71b94b0
fix(EternalNetwork TM): Applying requested changes
TheDjRider Sep 5, 2022
9e42ad7
fix(EternalNetwork TM): eslint & prettier fixes
TheDjRider Sep 5, 2022
4074dcc
Merge branch 'PreMiD:main' into main
TheDjRider Sep 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions websites/E/EternalNetwork TM/dist/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@
"eternalnetworktm.com",
"forum.eternalnetworktm.com",
"radio.eternalnetworktm.com",
"status.eternalnetworktm.com"
"status.eternalnetworktm.com",
"et-log.eternalnetworktm.com",
"dev.eternalnetworktm.com",
"shortener.etrnltm.com"
],
"version": "1.1.13",
"version": "1.2.0",
"logo": "https://i.imgur.com/Saq6ADh.png",
"thumbnail": "https://i.imgur.com/8pBRB2e.png",
"color": "#c005e6",
Expand Down
88 changes: 61 additions & 27 deletions websites/E/EternalNetwork TM/presence.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
const presence = new Presence({
clientId: "440182142694064129",
}),
browsingTimestamp = Math.floor(Date.now() / 1000);

async function getStrings() {
return presence.getStrings(
{
buttonViewPage: "general.buttonViewPage",
listeningMusic: "general.listeningMusic",
readingPost: "general.readingPost",
viewPage: "general.viewPage",
viewUser: "general.viewUser",
watchingVid: "general.watchingVid",
},
await presence.getSetting<string>("lang").catch(() => "en")
);
}
browsingTimestamp = Math.floor(Date.now() / 1000),
getStrings = async () => {
return presence.getStrings(
{
buttonViewPage: "general.buttonViewPage",
listeningMusic: "general.listeningMusic",
readingPost: "general.readingPost",
viewPage: "general.viewPage",
viewUser: "general.viewUser",
watchingVid: "general.watchingVid",
},
await presence.getSetting<string>("lang").catch(() => "en")
);
};

let strings: Awaited<ReturnType<typeof getStrings>>,
oldLang: string = null;
Expand All @@ -30,6 +29,7 @@ presence.on("UpdateData", async () => {
buttons = await presence.getSetting<boolean>("buttons"),
{ hostname, pathname, search, hash } = document.location,
etrnl = "eternalnetworktm.com",
etrnltm = "etrnltm.com",
ttl = document.title;

if (oldLang !== newLang || !strings) {
Expand Down Expand Up @@ -65,7 +65,7 @@ presence.on("UpdateData", async () => {
if (pathname.startsWith("/")) presenceData.state = ttl;

if (pathname.includes("/wp-admin")) {
presenceData.state = "Using administrating power over the website !";
presenceData.state = "Administrating the website";
TheDjRider marked this conversation as resolved.
Show resolved Hide resolved
presenceData.smallImageText = "Admin Panel";
TheDjRider marked this conversation as resolved.
Show resolved Hide resolved
delete presenceData.buttons;
}
Expand All @@ -79,16 +79,16 @@ presence.on("UpdateData", async () => {
if (pathname.startsWith("/")) presenceData.state = ttl;

if (pathname.includes("/memberlist.php"))
presenceData.state = "Sneaking into member list !";
presenceData.state = "Sneaking into member list";
TheDjRider marked this conversation as resolved.
Show resolved Hide resolved

if (search.includes("?mode=team"))
presenceData.state = "Checking out team list !";
presenceData.state = "Checking out team list";
TheDjRider marked this conversation as resolved.
Show resolved Hide resolved

if (pathname.includes("/partner"))
presenceData.state = "Cheking our partners !";
presenceData.state = "Cheking our partners";

if (pathname.includes("/donation"))
presenceData.state = "Trying to make donation for the forum !";
presenceData.state = "Trying to make donation for the forum";
TheDjRider marked this conversation as resolved.
Show resolved Hide resolved

if (pathname.includes("/imageupload"))
presenceData.state = "Uploading images!";
Expand Down Expand Up @@ -124,7 +124,7 @@ presence.on("UpdateData", async () => {
}

if (pathname.includes("/adm/")) {
presenceData.state = "Using administrating power over the forum !";
presenceData.state = "Administrating the forum";
TheDjRider marked this conversation as resolved.
Show resolved Hide resolved
presenceData.smallImageText = "Admin Panel";
delete presenceData.buttons;
}
Expand All @@ -138,16 +138,16 @@ presence.on("UpdateData", async () => {

if (pathname.startsWith("/")) presenceData.state = ttl;

if (hash.includes("page_ABOUT")) presenceData.state = "About info page !";
if (hash.includes("page_ABOUT")) presenceData.state = "About info page";

if (hash.includes("page_PROGRAMS"))
presenceData.state = "Checking radio program !";
presenceData.state = "Checking radio program";

if (hash.includes("page_REQUEST"))
presenceData.state = "Requesting a song !";
presenceData.state = "Requesting a song";

if (hash.includes("page_CONTACTS"))
presenceData.state = "Contact us page !";
presenceData.state = "Contact us page";
TheDjRider marked this conversation as resolved.
Show resolved Hide resolved

break;
}
Expand All @@ -158,17 +158,51 @@ presence.on("UpdateData", async () => {
if (pathname.startsWith("/")) presenceData.state = ttl;

if (pathname.includes("/admin")) {
presenceData.state = "Adding new incident 😥 !";
presenceData.state = "Adding new incident";
presenceData.smallImageText = "Admin Panel";
delete presenceData.buttons;
}

if (search.includes("?do=settings"))
presenceData.state = "Adding new service !";
presenceData.state = "Adding new service";
delete presenceData.buttons;

break;
}
case `et-log.${etrnl}`:
case `www.et-log.${etrnl}`: {
presenceData.smallImageKey = "eternallogistic_logo";
TheDjRider marked this conversation as resolved.
Show resolved Hide resolved

if (pathname.startsWith("/")) presenceData.state = ttl;

break;
}
case `dev.${etrnl}`:
case `www.dev.${etrnl}`: {
presenceData.smallImageKey = "eternalnetworktm_dev";

if (pathname.startsWith("/")) {
presenceData.state = "Developing new features";
presenceData.smallImageText = "Dev's paradise";
TheDjRider marked this conversation as resolved.
Show resolved Hide resolved
delete presenceData.buttons;
}

break;
}
case `shortener.${etrnltm}`:
case `www.shortener.${etrnltm}`: {
presenceData.smallImageKey = "eternalshortener_logo";

if (pathname.startsWith("/")) presenceData.state = ttl;

if (pathname.includes("/admin")) {
presenceData.state = "Administrating the system";
TheDjRider marked this conversation as resolved.
Show resolved Hide resolved
presenceData.smallImageText = "Admin Panel";
delete presenceData.buttons;
}

break;
}
// No default
}

Expand Down