This commit is contained in:
Guillem George 2026-05-16 20:29:28 +02:00
parent 34e5527244
commit 77a6d7fa6c
3 changed files with 15 additions and 7 deletions

View file

@ -7,6 +7,7 @@
import $ from "jquery"; import $ from "jquery";
import { getPixelInfo } from "./index"; import { getPixelInfo } from "./index";
import { getStudent } from "../../students";
const canvasContainer = $("#canvas-container")?.[0]; const canvasContainer = $("#canvas-container")?.[0];
const canvas = $("#canvas")?.[0]; const canvas = $("#canvas")?.[0];
@ -74,6 +75,7 @@ export const toggleTooltip = async (state = false) => {
date.toLocaleDateString(); date.toLocaleDateString();
document.getElementById("tooltip-time").innerText = document.getElementById("tooltip-time").innerText =
date.toLocaleTimeString(); date.toLocaleTimeString();
getStudent(response.placedByUid);
} }
}; };

View file

@ -1,4 +1,5 @@
import { authedAPIRequest } from "../utils/auth"; import { authedAPIRequest } from "../utils/auth";
import { displayStudentProfile } from "./utils";
//get a student from the API by its uid or login //get a student from the API by its uid or login
async function getStudent(login) { async function getStudent(login) {
@ -27,8 +28,7 @@ async function getStudent(login) {
console.debug(res); console.debug(res);
// Update HTML // Update HTML
// const roomNameElt = document.getElementById("room-name"); displayStudentProfile(res.avatarURL, res.login, res.guild, res.quote);
// roomNameElt.innerText = res.metadata.name
} }
//// get the user's uid from the token in local storage //// get the user's uid from the token in local storage

View file

@ -1,5 +1,11 @@
// FIXME: This file should handle the students DOM manipulation // display the student's profile in the DOM
// Link buttons to their respective functions function displayStudentProfile(picture, login, guild, quote) {
// Functions may include: document.getElementById("tooltip-info-avatar").src = picture;
// - displayStudentProfile (display the student's profile in the DOM) document.getElementById("tooltip-info-login").innerText = login;
// - showModal (add a form modal to the DOM) document.getElementById("tooltip-info-guild").innerText = guild;
document.getElementById("tooltip-info-quote").innerText = quote;
}
// add a form modal to the DOM
function showModal() {}
export { displayStudentProfile, showModal };