mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨
This commit is contained in:
parent
f2aef3fc25
commit
07e0eb26d2
2 changed files with 16 additions and 16 deletions
|
|
@ -1,21 +1,21 @@
|
|||
import {hideMessage, showMessage} from "../../dialog/message";
|
||||
import {Constants} from "../../constants";
|
||||
import { hideMessage, showMessage } from "../../dialog/message";
|
||||
import { Constants } from "../../constants";
|
||||
/// #if !BROWSER
|
||||
import {ipcRenderer} from "electron";
|
||||
import { ipcRenderer } from "electron";
|
||||
import * as fs from "fs";
|
||||
import * as path from "path";
|
||||
import {afterExport} from "./util";
|
||||
import { afterExport } from "./util";
|
||||
/// #endif
|
||||
import {confirmDialog} from "../../dialog/confirmDialog";
|
||||
import {getThemeMode, setInlineStyle} from "../../util/assets";
|
||||
import {fetchPost, fetchSyncPost} from "../../util/fetch";
|
||||
import {Dialog} from "../../dialog";
|
||||
import {replaceLocalPath} from "../../editor/rename";
|
||||
import {getScreenWidth, isInAndroid, isInHarmony, isInIOS, setStorageVal} from "../util/compatibility";
|
||||
import {getFrontend} from "../../util/functions";
|
||||
import { confirmDialog } from "../../dialog/confirmDialog";
|
||||
import { getThemeMode, setInlineStyle } from "../../util/assets";
|
||||
import { fetchPost, fetchSyncPost } from "../../util/fetch";
|
||||
import { Dialog } from "../../dialog";
|
||||
import { replaceLocalPath } from "../../editor/rename";
|
||||
import { getScreenWidth, isInAndroid, isInHarmony, isInIOS, setStorageVal } from "../util/compatibility";
|
||||
import { getFrontend } from "../../util/functions";
|
||||
|
||||
const getPluginStyle = async () => {
|
||||
const response = await fetchSyncPost("/api/petal/loadPetals", {frontend: getFrontend()});
|
||||
const response = await fetchSyncPost("/api/petal/loadPetals", { frontend: getFrontend() });
|
||||
let css = "";
|
||||
// 为加快启动速度,不进行 await
|
||||
response.data.forEach((item: IPluginData) => {
|
||||
|
|
@ -103,7 +103,7 @@ export const saveExport = (option: IExportOptions) => {
|
|||
btnsElement[1].addEventListener("click", () => {
|
||||
const removeAssets = (wordDialog.element.querySelector("#removeAssets") as HTMLInputElement).checked;
|
||||
const mergeSubdocs = (wordDialog.element.querySelector("#mergeSubdocs") as HTMLInputElement).checked;
|
||||
window.siyuan.storage[Constants.LOCAL_EXPORTWORD] = {removeAssets, mergeSubdocs};
|
||||
window.siyuan.storage[Constants.LOCAL_EXPORTWORD] = { removeAssets, mergeSubdocs };
|
||||
setStorageVal(Constants.LOCAL_EXPORTWORD, window.siyuan.storage[Constants.LOCAL_EXPORTWORD]);
|
||||
getExportPath(option, removeAssets, mergeSubdocs);
|
||||
wordDialog.destroy();
|
||||
|
|
@ -637,7 +637,7 @@ ${getIconScript(servePath)}
|
|||
</script>
|
||||
${getSnippetJS()}
|
||||
</body></html>`;
|
||||
fetchPost("/api/export/exportTempContent", {content: html}, (response) => {
|
||||
fetchPost("/api/export/exportTempContent", { content: html }, (response) => {
|
||||
ipcRenderer.send(Constants.SIYUAN_EXPORT_NEWWINDOW, response.data.url);
|
||||
});
|
||||
};
|
||||
|
|
@ -722,7 +722,7 @@ export const onExport = async (data: IWebSocketData, filePath: string, servePath
|
|||
js: `document.body.style.minWidth = "${screenWidth}px";`,
|
||||
css: `@page { size: A4; margin: 10mm 0 10mm 0; }
|
||||
.protyle-wysiwyg {padding: 0; margin: 0;}`
|
||||
} : {js: "", css: ""};
|
||||
} : { js: "", css: "" };
|
||||
const html = `<!DOCTYPE html>
|
||||
<html lang="${window.siyuan.config.appearance.lang}" data-theme-mode="${isInMobile ? "light" : getThemeMode()}" data-light-theme="${window.siyuan.config.appearance.themeLight}" data-dark-theme="${window.siyuan.config.appearance.themeDark}">
|
||||
<head>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { Constants } from "../../constants";
|
|||
import { hasClosestByClassName } from "../util/hasClosest";
|
||||
import { genIconHTML } from "./util";
|
||||
|
||||
export const mindmapRender = (element: Element, cdn = Constants.PROTYLE_CDN, markmapOptions: {zoom?: boolean; pan?: boolean} = {}) => {
|
||||
export const mindmapRender = (element: Element, cdn = Constants.PROTYLE_CDN, markmapOptions: { zoom?: boolean; pan?: boolean } = {}) => {
|
||||
let mindmapElements: Element[] = [];
|
||||
if (element.getAttribute("data-subtype") === "mindmap") {
|
||||
// 编辑器内代码块编辑渲染
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue