mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 15:40:12 +01:00
🎨 Support calling system printing on Android https://github.com/siyuan-note/siyuan/issues/16152
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
ff3b74ff00
commit
229ff22397
1 changed files with 4 additions and 3 deletions
|
|
@ -11,7 +11,7 @@ import {getThemeMode, setInlineStyle} from "../../util/assets";
|
||||||
import {fetchPost, fetchSyncPost} from "../../util/fetch";
|
import {fetchPost, fetchSyncPost} from "../../util/fetch";
|
||||||
import {Dialog} from "../../dialog";
|
import {Dialog} from "../../dialog";
|
||||||
import {replaceLocalPath} from "../../editor/rename";
|
import {replaceLocalPath} from "../../editor/rename";
|
||||||
import {setStorageVal} from "../util/compatibility";
|
import {isInAndroid, setStorageVal} from "../util/compatibility";
|
||||||
import {getFrontend} from "../../util/functions";
|
import {getFrontend} from "../../util/functions";
|
||||||
|
|
||||||
const getPluginStyle = async () => {
|
const getPluginStyle = async () => {
|
||||||
|
|
@ -669,6 +669,7 @@ export const onExport = async (data: IWebSocketData, filePath: string, exportOpt
|
||||||
if (!isDefault) {
|
if (!isDefault) {
|
||||||
themeStyle = `<link rel="stylesheet" type="text/css" id="themeStyle" href="${servePath}appearance/themes/${themeName}/theme.css?${Constants.SIYUAN_VERSION}"/>`;
|
themeStyle = `<link rel="stylesheet" type="text/css" id="themeStyle" href="${servePath}appearance/themes/${themeName}/theme.css?${Constants.SIYUAN_VERSION}"/>`;
|
||||||
}
|
}
|
||||||
|
const minWidthHtml = isInAndroid() ? `document.body.style.minWidth = "${window.JSAndroid.getScreenWidthPx()}px"` : "";
|
||||||
const html = `<!DOCTYPE html>
|
const html = `<!DOCTYPE html>
|
||||||
<html lang="${window.siyuan.config.appearance.lang}" data-theme-mode="${getThemeMode()}" data-light-theme="${window.siyuan.config.appearance.themeLight}" data-dark-theme="${window.siyuan.config.appearance.themeDark}">
|
<html lang="${window.siyuan.config.appearance.lang}" data-theme-mode="${getThemeMode()}" data-light-theme="${window.siyuan.config.appearance.themeLight}" data-dark-theme="${window.siyuan.config.appearance.themeDark}">
|
||||||
<head>
|
<head>
|
||||||
|
|
@ -693,12 +694,12 @@ export const onExport = async (data: IWebSocketData, filePath: string, exportOpt
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="${["htmlmd", "word"].includes(exportOption.type) ? "b3-typography" : "protyle-wysiwyg" + (window.siyuan.config.editor.displayBookmarkIcon ? " protyle-wysiwyg--attr" : "")}"
|
<div class="${["htmlmd", "word"].includes(exportOption.type) ? "b3-typography" : "protyle-wysiwyg" + (window.siyuan.config.editor.displayBookmarkIcon ? " protyle-wysiwyg--attr" : "")}"
|
||||||
style="${window.JSAndroid ? "margin: 0 16px;" : "max-width: 800px;margin: 0 auto;"}" id="preview">${data.data.content}</div>
|
style="${isInAndroid() ? "margin: 0 16px;" : "max-width: 800px;margin: 0 auto;"}" id="preview">${data.data.content}</div>
|
||||||
<script src="${servePath}/appearance/icons/${window.siyuan.config.appearance.icon}/icon.js?v=${Constants.SIYUAN_VERSION}"></script>
|
<script src="${servePath}/appearance/icons/${window.siyuan.config.appearance.icon}/icon.js?v=${Constants.SIYUAN_VERSION}"></script>
|
||||||
<script src="${servePath}/stage/build/export/protyle-method.js?v=${Constants.SIYUAN_VERSION}"></script>
|
<script src="${servePath}/stage/build/export/protyle-method.js?v=${Constants.SIYUAN_VERSION}"></script>
|
||||||
<script src="${servePath}/stage/protyle/js/lute/lute.min.js?v=${Constants.SIYUAN_VERSION}"></script>
|
<script src="${servePath}/stage/protyle/js/lute/lute.min.js?v=${Constants.SIYUAN_VERSION}"></script>
|
||||||
<script>
|
<script>
|
||||||
${window.JSAndroid ? document.body.style.minWidth = window.JSAndroid.getScreenWidthPx() + "px" : ""};
|
${minWidthHtml};
|
||||||
window.siyuan = {
|
window.siyuan = {
|
||||||
config: {
|
config: {
|
||||||
appearance: { mode: ${mode}, codeBlockThemeDark: "${window.siyuan.config.appearance.codeBlockThemeDark}", codeBlockThemeLight: "${window.siyuan.config.appearance.codeBlockThemeLight}" },
|
appearance: { mode: ${mode}, codeBlockThemeDark: "${window.siyuan.config.appearance.codeBlockThemeDark}", codeBlockThemeLight: "${window.siyuan.config.appearance.codeBlockThemeLight}" },
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue