mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-08 05:32:33 +01:00
This commit is contained in:
parent
4f62adddc7
commit
b974eb08d6
5 changed files with 145 additions and 41 deletions
|
|
@ -3,9 +3,10 @@ import {Dialog} from "../dialog";
|
|||
import {isMobile} from "../util/functions";
|
||||
import {fetchPost} from "../util/fetch";
|
||||
|
||||
export const transferBlockRef = (id:string) => {
|
||||
export const transferBlockRef = (id: string) => {
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
label: window.siyuan.languages.transferBlockRef,
|
||||
icon: "iconScrollHoriz",
|
||||
click() {
|
||||
const renameDialog = new Dialog({
|
||||
title: window.siyuan.languages.transferBlockRef,
|
||||
|
|
|
|||
|
|
@ -488,7 +488,7 @@ export const initFileMenu = (app: App, notebookId: string, pathString: string, l
|
|||
return window.siyuan.menus.menu;
|
||||
};
|
||||
|
||||
const genImportMenu = (notebookId: string, pathString: string) => {
|
||||
export const genImportMenu = (notebookId: string, pathString: string) => {
|
||||
if (!window.siyuan.config.readonly) {
|
||||
/// #if !BROWSER
|
||||
const importstdmd = (label: string, isDoc?: boolean) => {
|
||||
|
|
|
|||
|
|
@ -82,20 +82,18 @@ export const openEditorTab = (app: App, id: string, notebookId?: string, pathStr
|
|||
});
|
||||
/// #if !BROWSER
|
||||
openSubmenus.push({type: "separator"});
|
||||
if (!window.siyuan.config.readonly) {
|
||||
openSubmenus.push({
|
||||
label: window.siyuan.languages.showInFolder,
|
||||
click: () => {
|
||||
if (notebookId) {
|
||||
shell.showItemInFolder(path.join(window.siyuan.config.system.dataDir, notebookId, pathString));
|
||||
} else {
|
||||
fetchPost("/api/block/getBlockInfo", {id}, (response) => {
|
||||
shell.showItemInFolder(path.join(window.siyuan.config.system.dataDir, response.data.box, response.data.path));
|
||||
});
|
||||
}
|
||||
openSubmenus.push({
|
||||
label: window.siyuan.languages.showInFolder,
|
||||
click: () => {
|
||||
if (notebookId) {
|
||||
shell.showItemInFolder(path.join(window.siyuan.config.system.dataDir, notebookId, pathString));
|
||||
} else {
|
||||
fetchPost("/api/block/getBlockInfo", {id}, (response) => {
|
||||
shell.showItemInFolder(path.join(window.siyuan.config.system.dataDir, response.data.box, response.data.path));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
/// #endif
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
label: window.siyuan.languages.openBy,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue