siyuan/app/src/protyle/export/util.ts

17 lines
687 B
TypeScript
Raw Normal View History

import {hideMessage, showMessage} from "../../dialog/message";
/// #if !BROWSER
import {escapeHtml} from "../../util/escape";
import {shell} from "electron";
import * as path from "path";
2022-06-06 23:04:56 +08:00
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));
2022-06-06 23:04:56 +08:00
hideMessage(msgId);
});
};
/// #endif