mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 08:30:12 +01:00
This commit is contained in:
parent
f340a163f1
commit
bab0e764e2
5 changed files with 41 additions and 18 deletions
|
|
@ -25,13 +25,12 @@ export const afterExport = (exportPath: string, msgId: string) => {
|
|||
/// #endif
|
||||
};
|
||||
|
||||
export const exportImage = (id: string, fileType:string) => {
|
||||
export const exportImage = (id: string) => {
|
||||
const exportDialog = new Dialog({
|
||||
title: window.siyuan.languages.exportAsImage,
|
||||
content: `<div class="b3-dialog__content" style="${isMobile() ? "padding:8px;" : ""};background-color: var(--b3-theme-background)">
|
||||
<div style="${isMobile() ? "padding: 16px;margin: 16px 0" : "padding: 48px;margin: 8px 0 24px"};border: 1px solid var(--b3-border-color);border-radius: var(--b3-border-radius-b);"
|
||||
class="export-img protyle-wysiwyg${window.siyuan.config.editor.displayBookmarkIcon ? " protyle-wysiwyg--attr" : ""}"
|
||||
data-doc-type="${fileType}"
|
||||
id="preview"></div>
|
||||
<div class="fn__hr--b"></div>
|
||||
<div class="fn__hr--b"></div>
|
||||
|
|
@ -92,6 +91,19 @@ id="preview"></div>
|
|||
});
|
||||
const refreshPreview = (response: IWebSocketData) => {
|
||||
previewElement.innerHTML = response.data.content;
|
||||
previewElement.setAttribute("data-doc-type", response.data.type || "NodeDocument");
|
||||
if (response.data.attrs.memo) {
|
||||
previewElement.setAttribute("memo", response.data.attrs.memo);
|
||||
}
|
||||
if (response.data.attrs.name) {
|
||||
previewElement.setAttribute("name", response.data.attrs.name);
|
||||
}
|
||||
if (response.data.attrs.bookmark) {
|
||||
previewElement.setAttribute("bookmark", response.data.attrs.bookmark);
|
||||
}
|
||||
if (response.data.attrs.alias) {
|
||||
previewElement.setAttribute("alias", response.data.attrs.alias);
|
||||
}
|
||||
processRender(previewElement);
|
||||
highlightRender(previewElement);
|
||||
previewElement.querySelectorAll("table").forEach((item: HTMLElement) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue