From b9c39740702d7a7927bf7a7d5693b633ba0f4010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?kleines=20Filmr=C3=B6llchen?= Date: Sun, 12 Oct 2025 21:57:06 +0200 Subject: [PATCH] multiple calendar / display fixes --- static/dbkcalendar.js | 11 ++++++++--- static/main.css | 7 ++++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/static/dbkcalendar.js b/static/dbkcalendar.js index 7beacf5..b0fb708 100644 --- a/static/dbkcalendar.js +++ b/static/dbkcalendar.js @@ -3,6 +3,9 @@ Modernization by @kleinesfilmroellchen */ +const uriRegex = + /(https?:\/\/([-\w\.]+)+(:\d+)?(\/([\w\/\-_\.\:]*(\?\S+)?)?)?)/gi; + export default function hackcal(e, p = 1) { if (!document.getElementById("dbkcalendar")) return; @@ -41,8 +44,10 @@ export default function hackcal(e, p = 1) { // use description as link on summary if it's a valid URL const summaryItem = entryItem.querySelector(".summary"); + const possibleUri = uriRegex.exec(event.description)?.[0]; + const cleanedDescription = event.description.replaceAll(uriRegex, ""); try { - const descriptionUri = new URL(event.description); + const descriptionUri = new URL(possibleUri); const descriptionLink = document.createElement("a"); descriptionLink.href = descriptionUri; descriptionLink.target = "_blank"; @@ -50,9 +55,9 @@ export default function hackcal(e, p = 1) { summaryItem.appendChild(descriptionLink); } catch (e) { summaryItem.innerText = event.summary; - entryItem.querySelector(".description").innerText = - event.description; } + entryItem.querySelector(".description").innerText = + cleanedDescription; // self-link location if it's a valid URL const locationItem = entryItem.querySelector(".location"); diff --git a/static/main.css b/static/main.css index b74f590..23339b5 100644 --- a/static/main.css +++ b/static/main.css @@ -83,6 +83,10 @@ h3 { font-size: 1.2rem; } +ul > li { + margin-top: 0.3em; +} + /* page header */ #space-image { @@ -105,7 +109,7 @@ header { "logo . nav nav" "logo . space-text space-image" min-content "logo . . ." min-content / - minmax(min-content, 25vw) 1fr auto minmax(0, min-content); + minmax(min-content, 25vw) 1fr auto 11vh; overflow: hidden; * { @@ -339,6 +343,7 @@ footer { em { background-color: var(--main-accent-color); padding: 0 0.25em; + margin-right: 0.2em; font-style: normal; font-weight: bold; color: var(--main-bg-color);