mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
🎨 桌面端拖入文件时可选择 使用 file:// 绝对路径并链接 或 复制为资源文件并插入 https://github.com/siyuan-note/siyuan/issues/5369
This commit is contained in:
parent
f89d16c3a2
commit
c5661c3f55
6 changed files with 13 additions and 3 deletions
|
|
@ -706,19 +706,19 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
if (isAllFile) {
|
||||
window.siyuan.menus.menu.remove();
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
label:window.siyuan.languages.upload,
|
||||
label:window.siyuan.languages.copyInsertAsAssets,
|
||||
icon:"iconUpload",
|
||||
click() {
|
||||
uploadLocalFiles(files, protyle);
|
||||
}
|
||||
}).element);
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
label:window.siyuan.languages.link,
|
||||
label:window.siyuan.languages.useFileProtoLink,
|
||||
icon:"iconLink",
|
||||
click() {
|
||||
let fileText = "";
|
||||
files.forEach((item) => {
|
||||
fileText = `[${pathPosix().basename(item)}](${item})\n`;
|
||||
fileText = `[${pathPosix().basename(item)}](file://${item})\n`;
|
||||
});
|
||||
insertHTML(protyle.lute.SpinBlockDOM(fileText), protyle);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue