This commit is contained in:
2026-07-24 22:45:07 +03:00
parent 055edc7750
commit 7443ec059f
4 changed files with 13 additions and 17 deletions
+5 -7
View File
@@ -153,12 +153,14 @@ var AttachmentCleanPasteModule = class extends BaseModule {
textarea.inputEl.style.width = "100%";
});
}
async processAll(files, editor, settings) {
async processAll(files, editor, settings, evt) {
const matchingFiles = Array.from(files).filter(
(f) => this.shouldProcess(f.name, settings)
);
if (matchingFiles.length === 0)
return;
evt.preventDefault();
evt.stopPropagation();
const links = [];
for (const file of matchingFiles) {
const link = await this.processFile(file, settings);
@@ -175,9 +177,7 @@ var AttachmentCleanPasteModule = class extends BaseModule {
const files = (_a = evt.clipboardData) == null ? void 0 : _a.files;
if (!files || files.length === 0)
return;
evt.preventDefault();
evt.stopPropagation();
await this.processAll(files, editor, settings);
await this.processAll(files, editor, settings, evt);
};
}
createDropHandler(settings) {
@@ -186,9 +186,7 @@ var AttachmentCleanPasteModule = class extends BaseModule {
const files = (_a = evt.dataTransfer) == null ? void 0 : _a.files;
if (!files || files.length === 0)
return;
evt.preventDefault();
evt.stopPropagation();
await this.processAll(files, editor, settings);
await this.processAll(files, editor, settings, evt);
};
}
shouldProcess(filename, settings) {