From e3fe4a8521b1e6dbafd647213393c200d46896d6 Mon Sep 17 00:00:00 2001 From: Anderson T Date: Sat, 22 Jun 2024 08:45:27 -0700 Subject: [PATCH] add show courses button --- static/index.html | 11 +++++++---- static/main.js | 13 +++++++++++++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/static/index.html b/static/index.html index 2711990..1b983be 100644 --- a/static/index.html +++ b/static/index.html @@ -46,6 +46,9 @@ + @@ -67,9 +70,6 @@ - @@ -315,7 +318,7 @@

Loading courses...

--> -

Click here to create a new save.

+

Click here to create a new save.
(note: it will not autosave)

diff --git a/static/main.js b/static/main.js index d8b83e9..1f6c9a4 100644 --- a/static/main.js +++ b/static/main.js @@ -267,6 +267,19 @@ document.addEventListener('DOMContentLoaded', async function () { c.clearFCalendar(false) }) + document.getElementById("showCRNsButton").addEventListener("click", function (event) { + let out = "" + let details = "" + for (const id of c.courses_oncalendar) { + out += id.split("-")[2] + " " + + let c_obj = c.coursesMap.get(id) + details += `${c_obj.crn} ${c_obj.subject} ${c_obj.course_code} ${c_obj.section} ${c_obj.title} ${c_obj.schedule[0].instructor}\n` + console.log(c_obj) + } + alert(out + "\n\n" + details) + }) + // TODO: redo this // populate termSelector and event handler for changing terms let ts = document.getElementById("termSelector")