浏览代码

:art: https://github.com/siyuan-note/siyuan/issues/6333

Vanessa 2 年之前
父节点
当前提交
031d2a4736
共有 3 个文件被更改,包括 9 次插入7 次删除
  1. 1 1
      app/src/dialog/message.ts
  2. 4 4
      app/src/protyle/export/index.ts
  3. 4 2
      app/src/protyle/util/reload.ts

+ 1 - 1
app/src/dialog/message.ts

@@ -4,7 +4,7 @@ import {Constants} from "../constants";
 export const initMessage = () => {
 export const initMessage = () => {
     const messageElement = document.getElementById("message");
     const messageElement = document.getElementById("message");
     messageElement.innerHTML = `<div class="fn__flex-1"></div>
     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) => {
     messageElement.addEventListener("click", (event) => {
         let target = event.target as HTMLElement;
         let target = event.target as HTMLElement;
         while (target && !target.isEqualNode(messageElement)) {
         while (target && !target.isEqualNode(messageElement)) {

+ 4 - 4
app/src/protyle/export/index.ts

@@ -166,10 +166,10 @@ const renderPDF = (id: string) => {
     <label class="b3-label">
     <label class="b3-label">
         <div>
         <div>
             ${window.siyuan.languages.exportPDF3}
             ${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>
         </div>
         <span class="fn__hr"></span>
         <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>
     <label class="b3-label">
     <label class="b3-label">
         <div>
         <div>
@@ -199,7 +199,7 @@ const renderPDF = (id: string) => {
       <button class="b3-button b3-button--text">${window.siyuan.languages.confirm}</button>
       <button class="b3-button b3-button--text">${window.siyuan.languages.confirm}</button>
     </div>
     </div>
 </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 class="fn__loading" style="left:0"><img width="48px" src="${servePath}/stage/loading-pure.svg"></div>
 </div>
 </div>
 <script src="${servePath}/appearance/icons/${window.siyuan.config.appearance.icon}/icon.js?${Constants.SIYUAN_VERSION}"></script>
 <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>
     </style>
 </head>
 </head>
 <body>
 <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="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/build/export/protyle-method.js?${Constants.SIYUAN_VERSION}"></script>
 <script src="stage/protyle/js/lute/lute.min.js?${Constants.SIYUAN_VERSION}"></script>    
 <script src="stage/protyle/js/lute/lute.min.js?${Constants.SIYUAN_VERSION}"></script>    

+ 4 - 2
app/src/protyle/util/reload.ts

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