This commit is contained in:
Vanessa 2023-09-16 16:01:57 +08:00
parent 4f62adddc7
commit b974eb08d6
5 changed files with 145 additions and 41 deletions

View file

@ -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,

View file

@ -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) => {

View file

@ -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,