Molodetz blogrol volgens DPP-template

This commit is contained in:
2026-10-05 09:36:20 +02:00
commit f290a4c766
277 changed files with 15758 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
// retoor <retoor@molodetz.nl>
export class EditorPreview {
constructor() {
this.source = document.querySelector("[data-preview-source]");
this.target = document.querySelector("[data-preview-target]");
if (!this.source || !this.target) {
return;
}
this.timer = null;
this.source.addEventListener("input", () => this.schedule());
customElements.whenDefined("dp-content").then(() => this.update());
}
schedule() {
clearTimeout(this.timer);
this.timer = setTimeout(() => this.update(), 150);
}
update() {
this.target.markdown = this.source.value;
}
}
window.editorPreview = new EditorPreview();