mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 09:00:12 +01:00
📱 export
This commit is contained in:
parent
26881d906e
commit
55558d0a77
1 changed files with 11 additions and 13 deletions
|
|
@ -1,3 +1,8 @@
|
|||
/// #if !BROWSER
|
||||
import {escapeHtml} from "../../util/escape";
|
||||
import {shell} from "electron";
|
||||
import * as path from "path";
|
||||
/// #endif
|
||||
import {hideMessage, showMessage} from "../../dialog/message";
|
||||
import {fetchPost} from "../../util/fetch";
|
||||
import {Dialog} from "../../dialog";
|
||||
|
|
@ -13,12 +18,10 @@ import {chartRender} from "../markdown/chartRender";
|
|||
import {mindmapRender} from "../markdown/mindmapRender";
|
||||
import {abcRender} from "../markdown/abcRender";
|
||||
import {plantumlRender} from "../markdown/plantumlRender";
|
||||
/// #if !BROWSER
|
||||
import {escapeHtml} from "../../util/escape";
|
||||
import {shell} from "electron";
|
||||
import * as path from "path";
|
||||
|
||||
declare const html2canvas: (element: Element) => Promise<any>;
|
||||
export const afterExport = (exportPath: string, msgId: string) => {
|
||||
/// #if !BROWSER
|
||||
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);
|
||||
|
|
@ -26,20 +29,15 @@ export const afterExport = (exportPath: string, msgId: string) => {
|
|||
shell.showItemInFolder(path.join(exportPath));
|
||||
hideMessage(msgId);
|
||||
});
|
||||
/// #endif
|
||||
};
|
||||
/// #endif
|
||||
|
||||
declare const html2canvas: (element: Element) => Promise<any>;
|
||||
|
||||
export const exportImage = (id: string) => {
|
||||
const exportDialog = new Dialog({
|
||||
title: window.siyuan.languages.exportAsImage,
|
||||
content: `<div class="b3-dialog__content" style="max-height: 70vh;overflow: auto">
|
||||
<div style="padding: 48px;
|
||||
border: 1px solid var(--b3-border-color);
|
||||
border-radius: 10px;
|
||||
margin: 8px 0 24px;" class="protyle-wysiwyg${window.siyuan.config.editor.displayBookmarkIcon ? " protyle-wysiwyg--attr" : ""}" id="preview">
|
||||
<div class="fn__loading" style="left:0"><img height="48px" width="48px" src="stage/loading-pure.svg"></div>
|
||||
content: `<div class="b3-dialog__content" style="max-height: 70vh;overflow: auto;${isMobile()?"padding:8px;":""}">
|
||||
<div style="${isMobile()?"padding: 16px;margin: 16px 0":"padding: 48px;margin: 8px 0 24px"};border: 1px solid var(--b3-border-color);border-radius: 10px;" class="protyle-wysiwyg${window.siyuan.config.editor.displayBookmarkIcon ? " protyle-wysiwyg--attr" : ""}" id="preview">
|
||||
<div class="fn__loading" style="left:0"><img height="128px" width="128px" src="stage/loading-pure.svg"></div>
|
||||
</div>
|
||||
<div class="ft__smaller ft__on-surface fn__flex"><img style="height: 18px;margin: 0 8px" src="stage/icon.png">${window.siyuan.languages.exportBySiYuan}</div>
|
||||
<div class="fn__hr--b"></div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue