diff options
-rw-r--r-- | index.html | 21 |
1 files changed, 19 insertions, 2 deletions
@@ -56,7 +56,10 @@ courses.map(course=>{ checkb.innerHTML = "<input id=\"" + course.Name + "\" type=checkbox onclick=\"onCheckBoxClicked(event)\">"; for (const [key, value] of Object.entries(course)) { box = row.insertCell(); - box.innerHTML = value; + if (key === "Dozent") + box.innerHTML = dozwhomepage(value) + else + box.innerHTML = value; }; }); @@ -78,6 +81,20 @@ function onCheckBoxClicked(e) { console.log(listofchecked); } +function dozwhomepage(dozent) { + doz2hp = new Map ([ + ["Stolle", "https://www.tha.de/Elektrotechnik/Reinhard-Stolle.html"], + ["Kamuf", "https://www.tha.de/Elektrotechnik/Matthias-Kamuf.html"], + ["Beckmann", "https://www.tha.de/Elektrotechnik/Friedrich-Beckmann.html"], + ["Königbauer", "https://www.tha.de/Elektrotechnik/Prof.-Dr.-rer.nat.-martina-koenigbauer.html"] + ]); + if (homepagelink = doz2hp.get(dozent)){ + return "<a href=\"" + homepagelink + "\">" + dozent + "</a>"; + } else { + return dozent; + } +} + function dayname2number(dayname) { const d2n = new Map ([ ["Montag", 1], @@ -97,7 +114,7 @@ function addpart2calendar (name,dozent,tag,startzeit,ende,raum,id,color) { event = { "start": caldatestring + startzeit, "end": caldatestring + ende, - "title": {html: name + "</br>" + "Raum: " + raum}, + "title": {html: name + "</br>" + raum + " / " + dozwhomepage(dozent)}, "id": id, "color": color }; |