From 003949be5b314e6c91feacf796a993ff301ae0b7 Mon Sep 17 00:00:00 2001 From: Dark_Ville Date: Sun, 24 Nov 2024 13:18:36 +0100 Subject: [PATCH] chore(WIMS): delete presence, due to website deletion --- websites/W/WIMS/metadata.json | 31 ------- websites/W/WIMS/presence.ts | 152 ---------------------------------- 2 files changed, 183 deletions(-) delete mode 100644 websites/W/WIMS/metadata.json delete mode 100644 websites/W/WIMS/presence.ts diff --git a/websites/W/WIMS/metadata.json b/websites/W/WIMS/metadata.json deleted file mode 100644 index 4844a12a45be..000000000000 --- a/websites/W/WIMS/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "$schema": "https://schemas.premid.app/metadata/1.11", - "apiVersion": 1, - "author": { - "name": "Migush", - "id": "123859829453357056" - }, - "service": "WIMS", - "description": { - "en": "This presence is for WIMS' default theme. WIMS is a multipurpose server-project designed for mathematical exercises. Get it now to show people how hard you're working on your assignments.", - "ro": "Această prezență este pentru tema implicită a WIMS. WIMS este un server-proiect polivalent conceput pentru exerciții matematice. Obțineți-l acum pentru a le arăta oamenilor cât de greu lucrați la sarcinile dvs.", - "pt_BR": "Essa presença é para o tema padrão do WIMS. WIMS é um servidor de projeto de propósito geral projetado para exercícios matemáticos. Obtenha-o agora para mostrar para as pessoas o quão difícil você está trabalhando em sua tarefa matemática.", - "fr": "Cette présence est pour le thème par défaut de WIMS. WIMS est un projet de serveur polyvalent conçu pour des exercices mathématiques. Obtenez-le maintenant pour montrer aux gens à quel point vous travaillez dur sur vos devoirs.", - "uk_UA": "Ця присутність призначена для теми WIMS за замовчуванням. WIMS - це багатоцільовий серверний проект, призначений для математичних вправ. Поставте це прямо зараз, щоб показати людям, як ви наполегливо працюєте над своїми завданнями.", - "nl": "Deze presence is alleen voor WIMS' standaard thema. WIMS is een multifunctioneel server-project ontworpen voor wiskundige oefeningen. Download het nu om mensen te laten zien hoe hard je aan je opdrachten werkt.", - "ga_IE": "Tá an láithreacht seo do théama réamhshocraithe WIMS. Is tionscadal freastalaí ilchuspóireach é WIMS atá deartha le haghaidh cleachtaí matamaitice. Faigh é anois chun a thaispeáint do dhaoine cé chomh deacair agus atá tú ag obair ar do thascanna." - }, - "url": [ - "wims-schaersvoorde.nl", - "85.148.206.56" - ], - "version": "2.3.25", - "logo": "https://cdn.rcd.gg/PreMiD/websites/W/WIMS/assets/logo.png", - "thumbnail": "https://cdn.rcd.gg/PreMiD/websites/W/WIMS/assets/thumbnail.png", - "color": "#f4f8d7", - "category": "other", - "tags": [ - "general", - "school" - ] -} \ No newline at end of file diff --git a/websites/W/WIMS/presence.ts b/websites/W/WIMS/presence.ts deleted file mode 100644 index 9b2bb384cdfb..000000000000 --- a/websites/W/WIMS/presence.ts +++ /dev/null @@ -1,152 +0,0 @@ -const presence = new Presence({ - clientId: "656959119118565406", -}); - -// Redirect to iframe source, to prevent loss of progress -if ( - document.querySelectorAll("frame")[1] && - document.baseURI !== document.querySelectorAll("frame")[1].getAttribute("src") -) { - window.location.replace( - document.querySelectorAll("frame")[1].getAttribute("src") - ); -} - -// Check whether loggedout -let loggedout = false; -if ( - (document.baseURI.match(/module=adm/) && - document.baseURI.match(/(type=|classes)/)) || - (document.querySelectorAll(".menuitem")[1] as HTMLElement).textContent === "" -) - loggedout = true; - -let classname: string, - worksheet = "...", - WSNo: string, - EXNo: string, - exercise: string, - timestamp: number, - timeleft: number; - -// In Worksheet -if (!loggedout) { - // Set Class - // if (document.querySelector(".wimscenter")) - if (document.querySelector(".wims_subclasses")) { - [, classname] = document - .querySelector(".wimscenter") - .textContent.split("\n"); - } else if (document.querySelectorAll("td.small")[1]) { - classname = `${ - document - .querySelectorAll("td.small")[1] - .textContent.split(" ")[0] - } `; - } else { - classname = `${ - document - .querySelector(".wimscenter") - .textContent.split("\n")[0] - } `; - } - - // Set Worksheet - if (document.baseURI.match(/sh=/)) { - WSNo = document.baseURI.match(/sh=(.?.?)/)[1].replaceAll("&|#", ""); - worksheet = `- ${ - document.querySelectorAll(".text_item")[1].textContent - }${WSNo}`; - exercise = "..."; - } else if (document.baseURI.match(/(worksheet=|reply)/)) { - // In Exercise - // Set Worksheet - WSNo = document - .querySelector(".sheet") - .href.match(/sh=(.?.?)/)[1] - .replaceAll("&|#", ""); - worksheet = `- ${ - document.querySelector(".sheet").textContent - } ${WSNo}`; - classname = `${ - document - .querySelectorAll("td.small")[2] - .textContent.split(" ")[0] - } `; - - // Set Exercise - if (document.querySelector(".main_body .titre")) { - if ( - document.querySelector(".main_body .titre") && - document.querySelectorAll("kbd")[1] && - !document.querySelector(".answer") - ) { - [EXNo] = document.querySelectorAll("kbd")[1].textContent.match(/\d+/); - exercise = `${document - .querySelector(".sheet") - .href.match(/#ex(.?.?)/)[1] - .replaceAll("&|#", "")}.${EXNo}: ${ - document.querySelector(".main_body .titre").textContent - }`; - } else { - exercise = - document.querySelector(".main_body .titre").textContent; - } // Results page, so no EXNo - } - if (document.querySelector(".oeftitle")) { - if ( - document.querySelector(".oeftitle") && - document.querySelectorAll("kbd")[1] && - !document.querySelector(".oefanswer") - ) { - [EXNo] = document.querySelectorAll("kbd")[1].textContent.match(/\d+/); - exercise = `${ - document.querySelector(".oeftitle").textContent - }: ${EXNo}`; - } else - exercise = document.querySelector(".oeftitle").textContent; - } - if (EXNo > "1") { - // If exercise >1 get last time - timestamp = parseInt(sessionStorage.getItem("TimeStampStorage")); - } else if ( - document.querySelector(".answer") || - document.querySelector(".oefanswer") - ) { - // If answer page hide time - timestamp = 0; - } else timestamp = Date.now(); // Else reset time - } else if (document.baseURI.match(/(exam=)/)) { - // In Exam - worksheet = ""; - exercise = - document.querySelector("h1.wims_title font").textContent; - timeleft = - Date.now() + - (parseInt( - document - .querySelector("p#exam_clock") - .textContent.split(":")[1] - ) * - 60 + - parseInt( - document - .querySelector("p#exam_clock") - .textContent.split(":")[2] - )) * - 1000; - } -} - -presence.on("UpdateData", async () => { - const presenceData: PresenceData = { - details: classname + worksheet, - state: exercise, - startTimestamp: timestamp, - endTimestamp: timeleft, - largeImageKey: "https://cdn.rcd.gg/PreMiD/websites/W/WIMS/assets/logo.png", - }; - if (loggedout) presence.setActivity(); - else presence.setActivity(presenceData); - if (EXNo) sessionStorage.setItem("TimeStampStorage", timestamp.toString()); -});