1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-16 00:14:34 +02:00

Desktop: WYSIWYG: Handle drag and drop of notes and files

This commit is contained in:
Laurent Cozic
2020-05-10 16:28:22 +01:00
parent 6ca41ddf80
commit 9f9f760ede
5 changed files with 72 additions and 53 deletions

View File

@ -49,29 +49,6 @@ export async function attachedResources(noteBody: string): Promise<any> {
return output;
}
export async function attachResources() {
const filePaths = bridge().showOpenDialog({
properties: ['openFile', 'createDirectory', 'multiSelections'],
});
if (!filePaths || !filePaths.length) return [];
const output = [];
for (const filePath of filePaths) {
try {
const resource = await shim.createResourceFromPath(filePath);
output.push({
item: resource,
markdownTag: Resource.markdownTag(resource),
});
} catch (error) {
bridge().showErrorMessageBox(error.message);
}
}
return output;
}
export async function commandAttachFileToBody(body:string, filePaths:string[] = null, options:any = null) {
options = {
createFileURL: false,