Initial checkin

This commit is contained in:
David committed 2026-10-27 20:22:37 -05:00
commit 954ef3d036
95 files changed
+43476

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
/*
* Shows a pix if they add one
*/
document.querySelectorAll('input[type=file]').forEach(input => {
input.addEventListener('change', function () {
const preview = document.getElementById(
this.dataset.preview
);
console.log("preview: ", {preview});
if (!preview) {
console.error(
"Preview element not found:",
this.dataset.preview
);
return;
}
if (!this.files.length) return;
const reader = new FileReader();
reader.onload = e => {
console.log("loaded");
//console.log(e.target.result.substring(0,50));
preview.src = e.target.result;
preview.style.display = 'block';
//console.log("preview.src = ", preview.src);
};
console.log("reading: ", this.files[0]);
reader.readAsDataURL(this.files[0]);
});
});