🐛 export msg

This commit is contained in:
Vanessa 2022-06-06 23:04:56 +08:00
parent 23ad748535
commit 432fe6be1e
5 changed files with 23 additions and 20 deletions

View file

@ -4,16 +4,13 @@ import {escapeHtml} from "../../util/escape";
import {shell} from "electron";
import * as path from "path";
export const afterExport = (exportPath: string) => {
const id = showMessage(`<div class="fn__flex">
<div class="fn__flex-center">${window.siyuan.languages.exported}${escapeHtml(exportPath)}</div>
<div class="fn__space"></div>
<div class="fn__space"></div>
<button class="b3-button b3-button--white">${window.siyuan.languages.showInFolder}</button>
</div>`, 6000);
document.querySelector("#message button").addEventListener("click", () => {
export const afterExport = (exportPath: string, msgId: string) => {
showMessage(`${window.siyuan.languages.exported}${escapeHtml(exportPath)}
<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));
hideMessage(id);
hideMessage(msgId);
});
};
/// #endif