Publish curated VacatureRadar source snapshot

This commit is contained in:
Jens committed 2026-09-29 22:19:10 +02:00
commit e29774cb7f
338 files changed
+32699

No files matched your search

+103
View File
@@ -0,0 +1,103 @@
(() => {
"use strict";
const root = document.documentElement;
const frame = document.querySelector("[data-app-frame]");
const sidebar = document.querySelector("[data-sidebar]");
const navToggle = document.querySelector("[data-nav-toggle]");
let returnFocus = null;
try {
const storedTheme = localStorage.getItem("vacatureradar-theme");
if (storedTheme === "light" || storedTheme === "dark") root.dataset.theme = storedTheme;
} catch { /* Persistent storage is optional. */ }
const themeToggle = document.querySelector("[data-theme-toggle]");
const updateThemeLabel = () => {
themeToggle?.setAttribute("aria-label", root.dataset.theme === "light" ? "Donker thema activeren" : "Licht thema activeren");
};
updateThemeLabel();
themeToggle?.addEventListener("click", () => {
const next = root.dataset.theme === "light" ? "dark" : "light";
root.dataset.theme = next;
updateThemeLabel();
try { localStorage.setItem("vacatureradar-theme", next); } catch { /* Current page still updates. */ }
});
const globalSearch = document.getElementById("global-search");
globalSearch?.form?.addEventListener("submit", () => {
const query = globalSearch.value.trim();
if (!query) return;
try {
const previous = JSON.parse(localStorage.getItem("vacatureradar-recent-searches") || "[]");
const recent = [query, ...previous.filter((item) => item !== query)].slice(0, 5);
localStorage.setItem("vacatureradar-recent-searches", JSON.stringify(recent));
} catch { /* Zoeken werkt ook zonder lokale geschiedenis. */ }
});
const closeNavigation = () => {
frame?.classList.remove("nav-open");
navToggle?.setAttribute("aria-expanded", "false");
if (returnFocus instanceof HTMLElement) returnFocus.focus();
};
navToggle?.addEventListener("click", () => {
returnFocus = document.activeElement;
frame?.classList.add("nav-open");
navToggle.setAttribute("aria-expanded", "true");
sidebar?.querySelector("a, button")?.focus();
});
document.querySelectorAll("[data-nav-close], [data-nav-scrim]").forEach((control) => control.addEventListener("click", closeNavigation));
document.querySelectorAll("[data-disclosure]").forEach((button) => {
button.addEventListener("click", () => {
const target = document.getElementById(button.getAttribute("aria-controls"));
if (!target) return;
const expanded = button.getAttribute("aria-expanded") === "true";
button.setAttribute("aria-expanded", String(!expanded));
target.hidden = expanded;
});
});
document.querySelectorAll("[data-view-switch]").forEach((button) => {
button.addEventListener("click", () => {
const group = button.closest("[data-view-controls]");
const view = button.dataset.viewSwitch;
group?.querySelectorAll("[data-view-switch]").forEach((item) => item.setAttribute("aria-pressed", String(item === button)));
document.querySelectorAll("[data-view]").forEach((panel) => { panel.hidden = panel.dataset.view !== view; });
});
});
if (document.body.dataset.demoReadOnly === "true") {
document.querySelectorAll('form[method="post" i]:not([data-demo-allow])').forEach((form) => {
form.querySelectorAll('button:not([type]), button[type="submit"], input[type="submit"]').forEach((control) => {
control.disabled = true;
control.dataset.demoDisabled = "true";
control.setAttribute("aria-describedby", "demo-read-only-note");
control.title = "Niet beschikbaar in de alleen-lezen demo";
});
});
}
const motionAllowed = !window.matchMedia("(prefers-reduced-motion: reduce)").matches;
if (motionAllowed) {
document.querySelectorAll("[data-radar-illustration]").forEach((illustration) => {
illustration.addEventListener("pointermove", (event) => {
const bounds = illustration.getBoundingClientRect();
illustration.style.setProperty("--radar-x", `${((event.clientX - bounds.left) / bounds.width - .5) * 10}px`);
illustration.style.setProperty("--radar-y", `${((event.clientY - bounds.top) / bounds.height - .5) * 10}px`);
});
illustration.addEventListener("pointerleave", () => {
illustration.style.removeProperty("--radar-x");
illustration.style.removeProperty("--radar-y");
});
});
}
document.addEventListener("keydown", (event) => {
if (event.key === "Escape") closeNavigation();
if (event.key === "/" && !/INPUT|TEXTAREA|SELECT/.test(document.activeElement?.tagName || "")) {
event.preventDefault();
document.getElementById("global-search")?.focus();
}
});
})();
+28
View File
@@ -0,0 +1,28 @@
(() => {
"use strict";
const toggle = document.querySelector("[data-pw-toggle]");
const password = document.getElementById("id_password");
if (toggle && password) {
const eye = toggle.querySelector("[data-eye]");
const eyeOff = toggle.querySelector("[data-eye-off]");
toggle.addEventListener("click", () => {
const show = password.type === "password";
password.type = show ? "text" : "password";
toggle.setAttribute("aria-label", show ? "Wachtwoord verbergen" : "Wachtwoord tonen");
if (eye && eyeOff) {
eye.hidden = show;
eyeOff.hidden = !show;
}
});
}
const form = document.querySelector("form.auth-form");
form?.addEventListener("submit", () => {
const button = form.querySelector("[data-submit]");
if (!button || button.dataset.busy || !form.checkValidity()) return;
button.dataset.busy = "1";
const label = button.querySelector("[data-label]");
if (label) label.textContent = "Bezig met inloggen…";
});
})();
+42
View File
@@ -0,0 +1,42 @@
(() => {
const manualForm = document.querySelector("#manual-import-form");
const pastedText = document.getElementById("id_pasted_text");
const byteCounter = document.getElementById("manual-import-byte-count");
const copyButton = document.getElementById("copy-bookmarklet");
const bookmarkletCode = document.getElementById("manual-bookmarklet-code");
const bookmarkletLink = document.getElementById("manual-bookmarklet");
if (!manualForm || !pastedText || !byteCounter || !copyButton || !bookmarkletLink) {
return;
}
const maxBytes = Number(manualForm.dataset.pasteLimit || "0");
const encodeUriForBytes = (value) => new TextEncoder().encode(value).length;
const updateCount = () => {
const used = encodeUriForBytes(pastedText.value || "");
const remaining = Math.max(0, maxBytes - used);
byteCounter.textContent = `${remaining}`;
byteCounter.setAttribute("title", `${used} bytes gebruikt`);
};
pastedText.addEventListener("input", updateCount, { passive: true });
updateCount();
const endpoint = bookmarkletLink.dataset.manualImportEndpoint || "";
const quotedEndpoint = endpoint.replace(/'/g, "\\'");
const code = `javascript:(function(){var u=encodeURIComponent(window.location.href);window.open('${quotedEndpoint}?source_url='+u,'_blank');})();`;
bookmarkletCode.value = code;
bookmarkletLink.setAttribute("href", code);
copyButton.addEventListener("click", async () => {
try {
await navigator.clipboard.writeText(code);
copyButton.textContent = "Gekopieerd";
} catch {
copyButton.textContent = "Kopieer niet ondersteund";
}
setTimeout(() => {
copyButton.textContent = "Bookmarklet kopiëren";
}, 2000);
});
})();