diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2026-06-13 13:04:07 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2026-06-13 13:04:07 +0200 |
| commit | 4882c5ca3a65075e03595588ef3780a36bc74b15 (patch) | |
| tree | 07aa2a276cd87a8e192147440411c1f51d8aa624 /js/config.js | |
| parent | 9fbd21ff6bf97b9ce77cb78f420abd951b8aaf27 (diff) | |
| download | bycs-sol-4882c5ca3a65075e03595588ef3780a36bc74b15.tar.gz bycs-sol-4882c5ca3a65075e03595588ef3780a36bc74b15.zip | |
move generic js into root
Diffstat (limited to 'js/config.js')
| -rw-r--r-- | js/config.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/js/config.js b/js/config.js new file mode 100644 index 0000000..2beb91b --- /dev/null +++ b/js/config.js @@ -0,0 +1,42 @@ +const GRADUATION_DB_ID = 262744; +const GRADUATION_ACTIVITY_ID = 92663494; +const GRADUATION_DB_PARAMS_MAP = { + id: "f_1133275", + name: "f_1130848", + group: "f_1130869", + change: "f_1133254", + reason: "f_1130860", + date: (date) => { + return { + f_1130863_d: date.getDate(), + f_1130863_m: date.getMonth(), + f_1130863_y: date.getFullYear(), + f_1130863_z: 1, + }; + }, + coach: "f_1130866", +} + +const courseId = 2466361; +function getCourseId() { + return courseId; +} + +function getCourseParticipantsUrl() { + return `https://lernplattform.bycs.de/user/index.php?id=${courseId}`; +} + +async function getUserIconUrl(userId) { + console.assert(userId, "getUserIconUrl needs a userId"); + const userRes = await fetch(`https://lernplattform.bycs.de/user/profile.php?id=${userId}`) + const userDoc = new DOMParser().parseFromString(await userRes.text(), 'text/html') + const userpicture = userDoc.querySelector(".userpicture"); + return userpicture ? userpicture.src : ""; +} + +export { + GRADUATION_DB_ID, GRADUATION_ACTIVITY_ID, GRADUATION_DB_PARAMS_MAP, + getCourseId, + getUserIconUrl, + getCourseParticipantsUrl +}; |
