Initial deploy setup
deploy / deploy (push) Canceled after 0s

This commit is contained in:
Jens
2026-07-21 14:00:00 +02:00
commit b8091e59bd
285 changed files with 27854 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
(() => {
const toggle = document.querySelector('[data-nav-toggle]');
const sidebar = document.querySelector('[data-sidebar]');
if (!toggle || !sidebar) return;
const close = () => {
sidebar.classList.remove('open');
toggle.setAttribute('aria-expanded', 'false');
};
toggle.addEventListener('click', () => {
const open = sidebar.classList.toggle('open');
toggle.setAttribute('aria-expanded', String(open));
});
document.addEventListener('keydown', (event) => {
if (event.key === 'Escape') close();
});
document.addEventListener('click', (event) => {
if (sidebar.classList.contains('open') && !sidebar.contains(event.target) && !toggle.contains(event.target)) {
close();
}
});
})();
+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);
});
})();