Vanessa 2022-10-24 22:42:27 +08:00
parent 7b96f9c36c
commit 031d2a4736
3 changed files with 9 additions and 7 deletions

View file

@ -4,7 +4,7 @@ import {Constants} from "../constants";
export const initMessage = () => {
const messageElement = document.getElementById("message");
messageElement.innerHTML = `<div class="fn__flex-1"></div>
<button class="b3-button b3-tooltips b3-tooltips__w" aria-label="${window.siyuan.languages.clearMessage}"><svg style="margin-right: 0"><use xlink:href="#iconSelect"></use></svg></button>`;
<button class="b3-button--cancel b3-button b3-tooltips b3-tooltips__w" aria-label="${window.siyuan.languages.clearMessage}"><svg style="margin-right: 0"><use xlink:href="#iconSelect"></use></svg></button>`;
messageElement.addEventListener("click", (event) => {
let target = event.target as HTMLElement;
while (target && !target.isEqualNode(messageElement)) {

View file

@ -166,10 +166,10 @@ const renderPDF = (id: string) => {
<label class="b3-label">
<div>
${window.siyuan.languages.exportPDF3}
<span id="scaleTip" style="float: right;color: var(--b3-theme-on-background);">${localData.scale||1}</span>
<span id="scaleTip" style="float: right;color: var(--b3-theme-on-background);">${localData.scale || 1}</span>
</div>
<span class="fn__hr"></span>
<input style="width: 192px" value="${localData.scale||1}" id="scale" step="0.1" class="b3-slider" type="range" min="0.1" max="2">
<input style="width: 192px" value="${localData.scale || 1}" id="scale" step="0.1" class="b3-slider" type="range" min="0.1" max="2">
</label>
<label class="b3-label">
<div>
@ -199,7 +199,7 @@ const renderPDF = (id: string) => {
<button class="b3-button b3-button--text">${window.siyuan.languages.confirm}</button>
</div>
</div>
<div class="protyle-wysiwyg protyle-wysiwyg--attr" id="preview">
<div class="protyle-wysiwyg${window.siyuan.config.editor.displayBookmarkIcon ? " protyle-wysiwyg--attr" : ""}" id="preview">
<div class="fn__loading" style="left:0"><img width="48px" src="${servePath}/stage/loading-pure.svg"></div>
</div>
<script src="${servePath}/appearance/icons/${window.siyuan.config.appearance.icon}/icon.js?${Constants.SIYUAN_VERSION}"></script>
@ -477,7 +477,7 @@ const onExport = (data: IWebSocketData, filePath: string, type: string, removeAs
</style>
</head>
<body>
<div class="${["htmlmd", "word"].includes(type) ? "b3-typography" : "protyle-wysiwyg protyle-wysiwyg--attr"}" style="max-width: 800px;margin: 0 auto;" id="preview">${data.data.content}</div>
<div class="${["htmlmd", "word"].includes(type) ? "b3-typography" : "protyle-wysiwyg" + (window.siyuan.config.editor.displayBookmarkIcon ? " protyle-wysiwyg--attr" : "")}" style="max-width: 800px;margin: 0 auto;" id="preview">${data.data.content}</div>
<script src="appearance/icons/${window.siyuan.config.appearance.icon}/icon.js?${Constants.SIYUAN_VERSION}"></script>
<script src="stage/build/export/protyle-method.js?${Constants.SIYUAN_VERSION}"></script>
<script src="stage/protyle/js/lute/lute.min.js?${Constants.SIYUAN_VERSION}"></script>

View file

@ -5,11 +5,13 @@ import {onGet} from "./onGet";
import {saveScroll} from "../scroll/saveScroll";
import {renderBacklink} from "../wysiwyg/renderBacklink";
export const reloadProtyle = (protyle:IProtyle) => {
export const reloadProtyle = (protyle: IProtyle) => {
if (window.siyuan.config.editor.displayBookmarkIcon) {
protyle.wysiwyg.element.classList.add("protyle-wysiwyg--attr");
protyle.title?.element.classList.add("protyle-wysiwyg--attr");
} else {
protyle.wysiwyg.element.classList.remove("protyle-wysiwyg--attr");
protyle.title?.element.classList.remove("protyle-wysiwyg--attr");
}
protyle.lute.SetProtyleMarkNetImg(window.siyuan.config.editor.displayNetImgMark);
addLoading(protyle);
@ -20,7 +22,7 @@ export const reloadProtyle = (protyle:IProtyle) => {
refTreeID: protyle.block.rootID
}, response => {
protyle.options.backlinkData = isMention ? response.data.backmentions : response.data.backlinks,
renderBacklink(protyle, protyle.options.backlinkData);
renderBacklink(protyle, protyle.options.backlinkData);
});
} else {
fetchPost("/api/filetree/getDoc", {