You've already forked joplin
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:
@ -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,
|
||||
|
Reference in New Issue
Block a user