More supported attatchment types and cancel uploads

This commit is contained in:
MathMan05 2024-06-28 19:15:10 -05:00
parent 039491ca87
commit a05c74bb3c
13 changed files with 416 additions and 103 deletions

View file

@ -208,15 +208,15 @@ function filetohtml(file) {
return createunknownfile(file);
}
}
import { File } from "./file.js";
document.addEventListener('paste', async (e) => {
Array.from(e.clipboardData.files).forEach(async (file) => {
Array.from(e.clipboardData.files).forEach(async (f) => {
const file = File.initFromBlob(f);
e.preventDefault();
const html = filetohtml(file);
const html = file.upHTML(images, f);
pasteimage.appendChild(html);
const blob = URL.createObjectURL(file);
images.push(file);
images.push(f);
imageshtml.push(html);
console.log(file.type);
});
});
setTheme();