From f58395c80a4041fea6877f357a2eb194f4eb1323 Mon Sep 17 00:00:00 2001 From: fren_gor Date: Thu, 19 Sep 2024 23:00:55 +0200 Subject: [PATCH] Use new online calendar --- templates/course.gohtml | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/templates/course.gohtml b/templates/course.gohtml index 69199c0..ba6f3ce 100644 --- a/templates/course.gohtml +++ b/templates/course.gohtml @@ -56,7 +56,7 @@ COPY - + Apri online
@@ -77,7 +77,7 @@ const elements = document.getElementsByClassName("cal"); const url = new URL(document.baseURI); - // const openPrefix = "https://larrybolt.github.io/online-ics-feed-viewer/#"; + const openPrefix = "https://simonrob.github.io/online-ics-feed-viewer/#"; const googlePrefix = "https://www.google.com/calendar/render?cid="; const applePrefix = ""; @@ -103,13 +103,13 @@ }); - // const aOpen = el.getElementsByClassName("open")[0] - // aOpen.href = openPrefix + new URLSearchParams({ - // feed: `${url.origin}${calPath}`, - // cors: false, - // title: "Lezioni", - // hideinput: true - // }) + const aOpen = el.getElementsByClassName("open")[0] + aOpen.href = openPrefix + new URLSearchParams({ + feed: `${url.origin}${calPath}`, + cors: false, + title: "Lezioni", + hideinput: true + }) const addToGoogleBtn = el.getElementsByClassName("google")[0] addToGoogleBtn.href = googlePrefix + encodeURIComponent(webcalLink) @@ -182,10 +182,9 @@ el.innerHTML = res } else { - // if (el.classList.contains("open")) { - // el.href = res - // } else - if (el.classList.contains("google")) { + if (el.classList.contains("open")) { + el.href = res + } else if (el.classList.contains("google")) { el.href = googlePrefix + encodeURIComponent(res) } else if (el.classList.contains("apple")) { el.href = res