This commit is contained in:
Vanessa 2023-09-19 09:45:57 +08:00
parent f2f292c5fa
commit 56fe8371d1
13 changed files with 57 additions and 33 deletions

View file

@ -12,6 +12,7 @@ import {Constants} from "../../constants";
import {highlightRender} from "../render/highlightRender";
import {processRender} from "../util/processCode";
import {openByMobile, setStorageVal} from "../util/compatibility";
import {showFileInFolder} from "../../util/pathName";
export const afterExport = (exportPath: string, msgId: string) => {
/// #if !BROWSER
@ -19,7 +20,7 @@ export const afterExport = (exportPath: string, msgId: string) => {
<div class="fn__space"></div>
<button class="b3-button b3-button--white">${window.siyuan.languages.showInFolder}</button>`, 6000, "info", msgId);
document.querySelector(`#message [data-id="${msgId}"] button`).addEventListener("click", () => {
shell.showItemInFolder(path.join(exportPath));
showFileInFolder(path.join(exportPath));
hideMessage(msgId);
});
/// #endif

View file

@ -17,7 +17,7 @@ import * as path from "path";
import {Constants} from "../../constants";
import {openCardByData} from "../../card/openCard";
import {viewCards} from "../../card/viewCards";
import {getDisplayName, getNotebookName, pathPosix} from "../../util/pathName";
import {getDisplayName, getNotebookName, pathPosix, showFileInFolder} from "../../util/pathName";
import {makeCard, quickMakeCard} from "../../card/makeCard";
import {emitOpenMenu} from "../../plugin/EventBus";
import * as dayjs from "dayjs";
@ -247,7 +247,7 @@ export const openTitleMenu = (protyle: IProtyle, position: {
window.siyuan.menus.menu.append(new MenuItem({
label: window.siyuan.languages.showInFolder,
click: () => {
shell.showItemInFolder(path.join(window.siyuan.config.system.dataDir, protyle.notebookId, protyle.path));
showFileInFolder(path.join(window.siyuan.config.system.dataDir, protyle.notebookId, protyle.path));
}
}).element);
/// #endif