Compare commits

..

No commits in common. "3e2af3b038653537d94bf69dc560543dbfcaa488" and "6a9655543a798bb0322865788f6f058be2e7cd82" have entirely different histories.

2 changed files with 7 additions and 17 deletions

View file

@ -3,9 +3,6 @@
Modernization by @kleinesfilmroellchen Modernization by @kleinesfilmroellchen
*/ */
const uriRegex =
/(https?:\/\/([-\w\.]+)+(:\d+)?(\/([\w\/\-_\.\:]*(\?\S+)?)?)?)/gi;
export default function hackcal(e, p = 1) { export default function hackcal(e, p = 1) {
if (!document.getElementById("dbkcalendar")) return; if (!document.getElementById("dbkcalendar")) return;
@ -44,10 +41,8 @@ export default function hackcal(e, p = 1) {
// use description as link on summary if it's a valid URL // use description as link on summary if it's a valid URL
const summaryItem = entryItem.querySelector(".summary"); const summaryItem = entryItem.querySelector(".summary");
const possibleUri = uriRegex.exec(event.description)?.[0];
const cleanedDescription = event.description.replaceAll(uriRegex, "");
try { try {
const descriptionUri = new URL(possibleUri); const descriptionUri = new URL(event.description);
const descriptionLink = document.createElement("a"); const descriptionLink = document.createElement("a");
descriptionLink.href = descriptionUri; descriptionLink.href = descriptionUri;
descriptionLink.target = "_blank"; descriptionLink.target = "_blank";
@ -55,9 +50,9 @@ export default function hackcal(e, p = 1) {
summaryItem.appendChild(descriptionLink); summaryItem.appendChild(descriptionLink);
} catch (e) { } catch (e) {
summaryItem.innerText = event.summary; summaryItem.innerText = event.summary;
}
entryItem.querySelector(".description").innerText = entryItem.querySelector(".description").innerText =
cleanedDescription; event.description;
}
// self-link location if it's a valid URL // self-link location if it's a valid URL
const locationItem = entryItem.querySelector(".location"); const locationItem = entryItem.querySelector(".location");

View file

@ -3,8 +3,8 @@
--main-bg-color: oklch(1% 0 0); --main-bg-color: oklch(1% 0 0);
--main-bg-contrast-color: oklch(40% 0 0); --main-bg-contrast-color: oklch(40% 0 0);
--main-text-color: oklch(92% 0 none); --main-text-color: oklch(92% 0 none);
--main-accent-color: oklch(85.23% 0.1662 89.73); --main-accent-color: #f9c827;
--secondary-accent-color: oklch(64.41% 0.1673 44.98); --secondary-accent-color: #ff925f;
/* Tell browser that we support dark and light mode. /* Tell browser that we support dark and light mode.
Allows browser to change UI elements to match the color scheme. Allows browser to change UI elements to match the color scheme.
@ -83,10 +83,6 @@ h3 {
font-size: 1.2rem; font-size: 1.2rem;
} }
ul > li {
margin-top: 0.3em;
}
/* page header */ /* page header */
#space-image { #space-image {
@ -109,7 +105,7 @@ header {
"logo . nav nav" "logo . nav nav"
"logo . space-text space-image" min-content "logo . space-text space-image" min-content
"logo . . ." min-content / "logo . . ." min-content /
minmax(min-content, 25vw) 1fr auto 11vh; minmax(min-content, 25vw) 1fr auto minmax(0, min-content);
overflow: hidden; overflow: hidden;
* { * {
@ -341,9 +337,8 @@ footer {
margin-top: 0.2em; margin-top: 0.2em;
em { em {
background-color: var(--secondary-accent-color); background-color: var(--main-accent-color);
padding: 0 0.25em; padding: 0 0.25em;
margin-right: 0.2em;
font-style: normal; font-style: normal;
font-weight: bold; font-weight: bold;
color: var(--main-bg-color); color: var(--main-bg-color);