Browse Source

:rotating_light:

Vanessa 2 years ago
parent
commit
b542a80f56

+ 0 - 1
app/src/config/appearance.ts

@@ -6,7 +6,6 @@ import {Constants} from "../constants";
 import {exportLayout, resetLayout} from "../layout/util";
 import {exportLayout, resetLayout} from "../layout/util";
 import {isBrowser} from "../util/functions";
 import {isBrowser} from "../util/functions";
 import {fetchPost} from "../util/fetch";
 import {fetchPost} from "../util/fetch";
-import {loadAssets} from "../util/assets";
 import {genOptions} from "../util/genOptions";
 import {genOptions} from "../util/genOptions";
 import {openSnippets} from "./util/snippets";
 import {openSnippets} from "./util/snippets";
 import {openColorPicker} from "./util/colorPicker";
 import {openColorPicker} from "./util/colorPicker";

+ 1 - 1
app/src/editor/util.ts

@@ -200,7 +200,7 @@ const getUnInitTab = (options: IOpenFileOptions) => {
             }
             }
         }
         }
     });
     });
-}
+};
 
 
 const switchEditor = (editor: Editor, options: IOpenFileOptions, allModels: IModels) => {
 const switchEditor = (editor: Editor, options: IOpenFileOptions, allModels: IModels) => {
     allModels.editor.forEach((item) => {
     allModels.editor.forEach((item) => {

+ 1 - 1
app/src/layout/util.ts

@@ -428,7 +428,7 @@ export const layoutToJSON = (layout: Layout | Wnd | Tab | Model, json: any) => {
 export const resizeDrag = () => {
 export const resizeDrag = () => {
     const dragElement = document.getElementById("drag");
     const dragElement = document.getElementById("drag");
     const width = dragElement.clientWidth;
     const width = dragElement.clientWidth;
-    const dragRect = dragElement.getBoundingClientRect()
+    const dragRect = dragElement.getBoundingClientRect();
     const left = dragRect.left;
     const left = dragRect.left;
     const right = window.innerWidth - dragRect.right;
     const right = window.innerWidth - dragRect.right;
     if (left > right && left - right < width) {
     if (left > right && left - right < width) {

+ 2 - 2
app/src/protyle/export/util.ts

@@ -58,8 +58,8 @@ export const exportImage = (id: string) => {
             }
             }
         });
         });
         previewElement.querySelectorAll(".li > .protyle-action > svg").forEach(item => {
         previewElement.querySelectorAll(".li > .protyle-action > svg").forEach(item => {
-            const id = item.firstElementChild.getAttribute("xlink:href")
-            const symbolElements = document.querySelectorAll(id)
+            const id = item.firstElementChild.getAttribute("xlink:href");
+            const symbolElements = document.querySelectorAll(id);
             let viewBox = "0 0 32 32";
             let viewBox = "0 0 32 32";
             if (id === "#iconDot") {
             if (id === "#iconDot") {
                 viewBox = "0 0 20 20";
                 viewBox = "0 0 20 20";

+ 1 - 1
app/src/protyle/gutter/index.ts

@@ -3,7 +3,7 @@ import {getIconByType} from "../../editor/getIcon";
 import {iframeMenu, setFold, tableMenu, videoMenu, zoomOut} from "../../menus/protyle";
 import {iframeMenu, setFold, tableMenu, videoMenu, zoomOut} from "../../menus/protyle";
 import {MenuItem} from "../../menus/Menu";
 import {MenuItem} from "../../menus/Menu";
 import {copySubMenu, openAttr, openWechatNotify} from "../../menus/commonMenuItem";
 import {copySubMenu, openAttr, openWechatNotify} from "../../menus/commonMenuItem";
-import {isCtrl, updateHotkeyTip, writeText} from "../util/compatibility";
+import {updateHotkeyTip, writeText} from "../util/compatibility";
 import {
 import {
     transaction,
     transaction,
     turnsIntoOneTransaction, turnsIntoTransaction,
     turnsIntoOneTransaction, turnsIntoTransaction,

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

@@ -18,9 +18,9 @@ export const reloadProtyle = (protyle: IProtyle) => {
     addLoading(protyle);
     addLoading(protyle);
     if (protyle.options.backlinkData) {
     if (protyle.options.backlinkData) {
         const isMention = protyle.element.getAttribute("data-ismention") === "true";
         const isMention = protyle.element.getAttribute("data-ismention") === "true";
-        const tabElement = hasClosestByClassName(protyle.element, "sy__backlink")
+        const tabElement = hasClosestByClassName(protyle.element, "sy__backlink");
         if (tabElement) {
         if (tabElement) {
-            const inputsElement = tabElement.querySelectorAll(".b3-form__icon-input") as NodeListOf<HTMLInputElement>
+            const inputsElement = tabElement.querySelectorAll(".b3-form__icon-input") as NodeListOf<HTMLInputElement>;
             fetchPost(isMention ? "/api/ref/getBackmentionDoc" : "/api/ref/getBacklinkDoc", {
             fetchPost(isMention ? "/api/ref/getBackmentionDoc" : "/api/ref/getBacklinkDoc", {
                 defID: protyle.element.getAttribute("data-defid"),
                 defID: protyle.element.getAttribute("data-defid"),
                 refTreeID: protyle.block.rootID,
                 refTreeID: protyle.block.rootID,

+ 4 - 4
app/src/protyle/wysiwyg/keydown.ts

@@ -361,8 +361,8 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
                         if (previousElement) {
                         if (previousElement) {
                             previousElement.setAttribute("select-end", "true");
                             previousElement.setAttribute("select-end", "true");
                             if (previousElement.getBoundingClientRect().top <= protyle.contentElement.getBoundingClientRect().top) {
                             if (previousElement.getBoundingClientRect().top <= protyle.contentElement.getBoundingClientRect().top) {
-                                preventScroll(protyle)
-                                previousElement.scrollIntoView(true)
+                                preventScroll(protyle);
+                                previousElement.scrollIntoView(true);
                             }
                             }
                         }
                         }
                     }
                     }
@@ -398,8 +398,8 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
                         if (nextElement) {
                         if (nextElement) {
                             nextElement.setAttribute("select-end", "true");
                             nextElement.setAttribute("select-end", "true");
                             if (nextElement.getBoundingClientRect().bottom >= protyle.contentElement.getBoundingClientRect().bottom) {
                             if (nextElement.getBoundingClientRect().bottom >= protyle.contentElement.getBoundingClientRect().bottom) {
-                                preventScroll(protyle)
-                                nextElement.scrollIntoView(false)
+                                preventScroll(protyle);
+                                nextElement.scrollIntoView(false);
                             }
                             }
                         }
                         }
                     }
                     }

+ 2 - 2
app/src/util/assets.ts

@@ -251,7 +251,7 @@ const watchTheme = (data: { init: boolean, OSTheme: string }) => {
     if ((window.siyuan.config.system.container === "ios" && window.webkit?.messageHandlers) ||
     if ((window.siyuan.config.system.container === "ios" && window.webkit?.messageHandlers) ||
         (window.siyuan.config.system.container === "android" && window.JSAndroid)) {
         (window.siyuan.config.system.container === "android" && window.JSAndroid)) {
         setTimeout(() => {
         setTimeout(() => {
-            const backgroundColor = getComputedStyle(document.body).getPropertyValue("--b3-theme-background")
+            const backgroundColor = getComputedStyle(document.body).getPropertyValue("--b3-theme-background");
             let mode = window.siyuan.config.appearance.mode;
             let mode = window.siyuan.config.appearance.mode;
             if (window.siyuan.config.appearance.modeOS) {
             if (window.siyuan.config.appearance.modeOS) {
                 if (data.OSTheme === "dark") {
                 if (data.OSTheme === "dark") {
@@ -304,4 +304,4 @@ const watchTheme = (data: { init: boolean, OSTheme: string }) => {
         window.siyuan.config.appearance = response.data.appearance;
         window.siyuan.config.appearance = response.data.appearance;
         loadAssets(response.data.appearance);
         loadAssets(response.data.appearance);
     });
     });
-}
+};