소스 검색

:rotating_light:

Vanessa 2 년 전
부모
커밋
6ad89c12c1

+ 2 - 2
app/src/emoji/index.ts

@@ -79,7 +79,7 @@ export const lazyLoadEmojiImg = (element: Element) => {
     element.querySelectorAll("img").forEach((panelElement) => {
     element.querySelectorAll("img").forEach((panelElement) => {
         emojiIntersectionObserver.observe(panelElement);
         emojiIntersectionObserver.observe(panelElement);
     });
     });
-}
+};
 
 
 export const filterEmoji = (key = "", max?: number, assic = false) => {
 export const filterEmoji = (key = "", max?: number, assic = false) => {
     let html = "";
     let html = "";
@@ -428,7 +428,7 @@ export const updateFileTreeEmoji = (unicode: string, id: string, icon = "iconFil
     /// #if MOBILE
     /// #if MOBILE
     emojiElement = document.querySelector(`#sidebar [data-type="sidebar-file"] [data-node-id="${id}"] .b3-list-item__icon`);
     emojiElement = document.querySelector(`#sidebar [data-type="sidebar-file"] [data-node-id="${id}"] .b3-list-item__icon`);
     /// #else
     /// #else
-    const dockFile = getDockByType("file")
+    const dockFile = getDockByType("file");
     if (dockFile) {
     if (dockFile) {
         const files = dockFile.data.file as Files;
         const files = dockFile.data.file as Files;
         if (icon === "iconFile") {
         if (icon === "iconFile") {

+ 4 - 4
app/src/index.ts

@@ -134,19 +134,19 @@ class App {
                 window.siyuan.config.uiLayout.left = {
                 window.siyuan.config.uiLayout.left = {
                     pin: true,
                     pin: true,
                     data: response.data.conf.uiLayout.left
                     data: response.data.conf.uiLayout.left
-                }
+                };
                 window.siyuan.config.uiLayout.right = {
                 window.siyuan.config.uiLayout.right = {
                     pin: true,
                     pin: true,
                     data: response.data.conf.uiLayout.right
                     data: response.data.conf.uiLayout.right
-                }
+                };
                 window.siyuan.config.uiLayout.top = {
                 window.siyuan.config.uiLayout.top = {
                     pin: true,
                     pin: true,
                     data: response.data.conf.uiLayout.top
                     data: response.data.conf.uiLayout.top
-                }
+                };
                 window.siyuan.config.uiLayout.bottom = {
                 window.siyuan.config.uiLayout.bottom = {
                     pin: true,
                     pin: true,
                     data: response.data.conf.uiLayout.bottom
                     data: response.data.conf.uiLayout.bottom
-                }
+                };
             }
             }
             getLocalStorage(() => {
             getLocalStorage(() => {
                 fetchGet(`/appearance/langs/${window.siyuan.config.appearance.lang}.json?v=${Constants.SIYUAN_VERSION}`, (lauguages) => {
                 fetchGet(`/appearance/langs/${window.siyuan.config.appearance.lang}.json?v=${Constants.SIYUAN_VERSION}`, (lauguages) => {

+ 2 - 2
app/src/layout/dock/Backlink.ts

@@ -454,11 +454,11 @@ export class Backlink extends Model {
 
 
     private refresh() {
     private refresh() {
         const element = this.element.querySelector('.block__icon[data-type="refresh"] svg');
         const element = this.element.querySelector('.block__icon[data-type="refresh"] svg');
-        element.classList.add("fn__rotate")
+        element.classList.add("fn__rotate");
         fetchPost("/api/ref/refreshBacklink", {
         fetchPost("/api/ref/refreshBacklink", {
             id: this.blockId,
             id: this.blockId,
         }, () => {
         }, () => {
-            element.classList.remove("fn__rotate")
+            element.classList.remove("fn__rotate");
             this.searchBacklinks();
             this.searchBacklinks();
         });
         });
     }
     }

+ 8 - 8
app/src/layout/dock/index.ts

@@ -46,7 +46,7 @@ export class Dock {
         const dockClass = (options.position === "Bottom" || options.position === "Top") ? ' class="fn__flex"' : "";
         const dockClass = (options.position === "Bottom" || options.position === "Top") ? ' class="fn__flex"' : "";
         this.element.innerHTML = `<div${dockClass}></div><div class="fn__flex-1"></div><div${dockClass}></div>`;
         this.element.innerHTML = `<div${dockClass}></div><div class="fn__flex-1"></div><div${dockClass}></div>`;
         this.position = options.position;
         this.position = options.position;
-        this.pin = options.data.pin
+        this.pin = options.data.pin;
         this.data = {};
         this.data = {};
         if (options.data.data.length === 0) {
         if (options.data.data.length === 0) {
             this.element.firstElementChild.innerHTML = `<span class="dock__item ${this.pin ? "dock__item--pin " : ""}b3-tooltips b3-tooltips__${this.getClassDirect(0)}" aria-label="${this.pin ? window.siyuan.languages.unpin : window.siyuan.languages.pin}">
             this.element.firstElementChild.innerHTML = `<span class="dock__item ${this.pin ? "dock__item--pin " : ""}b3-tooltips b3-tooltips__${this.getClassDirect(0)}" aria-label="${this.pin ? window.siyuan.languages.unpin : window.siyuan.languages.pin}">
@@ -92,9 +92,9 @@ export class Dock {
                         } else {
                         } else {
                             this.layout.element.setAttribute("style", `height:${this.layout.element.clientHeight}px;left:0;right:0;${this.position === "Top" ? ("top:" + (1 + this.element.clientHeight + document.getElementById("toolbar").clientHeight) + "px") : ("bottom:" + (this.element.clientHeight + document.getElementById("status").clientHeight) + "px")};`);
                             this.layout.element.setAttribute("style", `height:${this.layout.element.clientHeight}px;left:0;right:0;${this.position === "Top" ? ("top:" + (1 + this.element.clientHeight + document.getElementById("toolbar").clientHeight) + "px") : ("bottom:" + (this.element.clientHeight + document.getElementById("status").clientHeight) + "px")};`);
                         }
                         }
-                        target.setAttribute("aria-label", window.siyuan.languages.pin)
+                        target.setAttribute("aria-label", window.siyuan.languages.pin);
                     } else {
                     } else {
-                        target.setAttribute("aria-label", window.siyuan.languages.unpin)
+                        target.setAttribute("aria-label", window.siyuan.languages.unpin);
                     }
                     }
                     target.classList.toggle("dock__item--pin");
                     target.classList.toggle("dock__item--pin");
                     this.layout.element.classList.toggle("layout--float");
                     this.layout.element.classList.toggle("layout--float");
@@ -107,7 +107,7 @@ export class Dock {
         });
         });
         this.layout.element.addEventListener("mouseleave", (event) => {
         this.layout.element.addEventListener("mouseleave", (event) => {
             if (this.pin) {
             if (this.pin) {
-                return
+                return;
             }
             }
             if (this.position === "Left" && event.clientX < 43) {
             if (this.position === "Left" && event.clientX < 43) {
                 return;
                 return;
@@ -121,8 +121,8 @@ export class Dock {
             if (this.position === "Bottom" && event.clientY > window.innerHeight - 73) {
             if (this.position === "Bottom" && event.clientY > window.innerHeight - 73) {
                 return;
                 return;
             }
             }
-            this.hideDock()
-        })
+            this.hideDock();
+        });
         if (window.siyuan.config.uiLayout.hideDock) {
         if (window.siyuan.config.uiLayout.hideDock) {
             this.element.classList.add("fn__none");
             this.element.classList.add("fn__none");
         }
         }
@@ -131,7 +131,7 @@ export class Dock {
                 if (this.position === "Left" || this.position === "Right") {
                 if (this.position === "Left" || this.position === "Right") {
                     this.layout.element.setAttribute("style", `opacity:0px;width:${this.layout.element.clientWidth}px;${this.position === "Right" ? "right" : "left"}:-${this.layout.element.clientWidth}px; top: ${1 + document.getElementById("toolbar").clientHeight + document.getElementById("dockTop").clientHeight}px; bottom: ${document.getElementById("status").clientHeight + document.getElementById("dockBottom").clientHeight + 1}px;`);
                     this.layout.element.setAttribute("style", `opacity:0px;width:${this.layout.element.clientWidth}px;${this.position === "Right" ? "right" : "left"}:-${this.layout.element.clientWidth}px; top: ${1 + document.getElementById("toolbar").clientHeight + document.getElementById("dockTop").clientHeight}px; bottom: ${document.getElementById("status").clientHeight + document.getElementById("dockBottom").clientHeight + 1}px;`);
                 } else {
                 } else {
-                    this.layout.element.setAttribute("style", `opacity:0px;height:${this.layout.element.clientHeight}px;left:0;right:0;${this.position === "Top" ? "top" : "bottom"}:-${this.layout.element.clientHeight}px;`)
+                    this.layout.element.setAttribute("style", `opacity:0px;height:${this.layout.element.clientHeight}px;left:0;right:0;${this.position === "Top" ? "top" : "bottom"}:-${this.layout.element.clientHeight}px;`);
                 }
                 }
                 this.layout.element.classList.add("layout--float");
                 this.layout.element.classList.add("layout--float");
                 this.resizeElement.classList.add("fn__none");
                 this.resizeElement.classList.add("fn__none");
@@ -141,7 +141,7 @@ export class Dock {
 
 
     public hideDock() {
     public hideDock() {
         if (this.layout.element.style.opacity === "0") {
         if (this.layout.element.style.opacity === "0") {
-            return
+            return;
         }
         }
         this.layout.element.style.opacity = "0";
         this.layout.element.style.opacity = "0";
         if (this.position === "Left") {
         if (this.position === "Left") {

+ 5 - 5
app/src/layout/dock/util.ts

@@ -91,20 +91,20 @@ export const resetFloatDockSize = () => {
         window.siyuan.layout.leftDock.layout.element.style.top = (1 + document.getElementById("toolbar").clientHeight + document.getElementById("dockTop").clientHeight) + "px";
         window.siyuan.layout.leftDock.layout.element.style.top = (1 + document.getElementById("toolbar").clientHeight + document.getElementById("dockTop").clientHeight) + "px";
         window.siyuan.layout.leftDock.layout.element.style.bottom = (document.getElementById("status").clientHeight + document.getElementById("dockBottom").clientHeight + 1) + "px";
         window.siyuan.layout.leftDock.layout.element.style.bottom = (document.getElementById("status").clientHeight + document.getElementById("dockBottom").clientHeight + 1) + "px";
         if (window.siyuan.layout.leftDock.layout.element.style.opacity === "1") {
         if (window.siyuan.layout.leftDock.layout.element.style.opacity === "1") {
-            window.siyuan.layout.leftDock.layout.element.style.left = (window.siyuan.layout.leftDock.element.clientWidth + .5) + "px"
+            window.siyuan.layout.leftDock.layout.element.style.left = (window.siyuan.layout.leftDock.element.clientWidth + .5) + "px";
         }
         }
     }
     }
     if (!window.siyuan.layout.rightDock.pin) {
     if (!window.siyuan.layout.rightDock.pin) {
         window.siyuan.layout.rightDock.layout.element.style.top = (1 + document.getElementById("toolbar").clientHeight + document.getElementById("dockTop").clientHeight) + "px";
         window.siyuan.layout.rightDock.layout.element.style.top = (1 + document.getElementById("toolbar").clientHeight + document.getElementById("dockTop").clientHeight) + "px";
         window.siyuan.layout.rightDock.layout.element.style.bottom = (document.getElementById("status").clientHeight + document.getElementById("dockBottom").clientHeight + 1) + "px";
         window.siyuan.layout.rightDock.layout.element.style.bottom = (document.getElementById("status").clientHeight + document.getElementById("dockBottom").clientHeight + 1) + "px";
         if (window.siyuan.layout.rightDock.layout.element.style.opacity === "1") {
         if (window.siyuan.layout.rightDock.layout.element.style.opacity === "1") {
-            window.siyuan.layout.rightDock.layout.element.style.right = (window.siyuan.layout.rightDock.element.clientWidth + .5) + "px"
+            window.siyuan.layout.rightDock.layout.element.style.right = (window.siyuan.layout.rightDock.element.clientWidth + .5) + "px";
         }
         }
     }
     }
     if (!window.siyuan.layout.topDock.pin && window.siyuan.layout.topDock.layout.element.style.opacity === "1") {
     if (!window.siyuan.layout.topDock.pin && window.siyuan.layout.topDock.layout.element.style.opacity === "1") {
-        window.siyuan.layout.topDock.layout.element.style.top = (document.getElementById("dockTop").clientHeight + document.getElementById("toolbar").clientHeight + 1) + "px"
+        window.siyuan.layout.topDock.layout.element.style.top = (document.getElementById("dockTop").clientHeight + document.getElementById("toolbar").clientHeight + 1) + "px";
     }
     }
     if (!window.siyuan.layout.bottomDock.pin && window.siyuan.layout.bottomDock.layout.element.style.opacity === "1") {
     if (!window.siyuan.layout.bottomDock.pin && window.siyuan.layout.bottomDock.layout.element.style.opacity === "1") {
-        window.siyuan.layout.bottomDock.layout.element.style.bottom = (document.getElementById("dockBottom").clientHeight + document.getElementById("status").clientHeight + 1) + "px"
+        window.siyuan.layout.bottomDock.layout.element.style.bottom = (document.getElementById("dockBottom").clientHeight + document.getElementById("status").clientHeight + 1) + "px";
     }
     }
-}
+};

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

@@ -138,7 +138,7 @@ const dockToJSON = (dock: Dock) => {
     return {
     return {
         pin: dock.pin,
         pin: dock.pin,
         data: json
         data: json
-    }
+    };
 };
 };
 
 
 export const resetLayout = () => {
 export const resetLayout = () => {

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

@@ -1478,7 +1478,7 @@ export class WYSIWYG {
         let shiftStartElement: HTMLElement;
         let shiftStartElement: HTMLElement;
         this.element.addEventListener("click", (event: MouseEvent & { target: HTMLElement }) => {
         this.element.addEventListener("click", (event: MouseEvent & { target: HTMLElement }) => {
             hideElements(["hint", "util"], protyle);
             hideElements(["hint", "util"], protyle);
-            const ctrlIsPressed = event.metaKey || event.ctrlKey
+            const ctrlIsPressed = event.metaKey || event.ctrlKey;
             /// #if !MOBILE
             /// #if !MOBILE
             const backlinkBreadcrumbItemElement = hasClosestByClassName(event.target, "protyle-breadcrumb__item");
             const backlinkBreadcrumbItemElement = hasClosestByClassName(event.target, "protyle-breadcrumb__item");
             if (backlinkBreadcrumbItemElement) {
             if (backlinkBreadcrumbItemElement) {

+ 4 - 4
app/src/search/util.ts

@@ -903,19 +903,19 @@ const updateConfig = (element: Element, item: ISearchOption, config: ISearchOpti
     }
     }
     (element.querySelector("#searchInput") as HTMLInputElement).value = item.k;
     (element.querySelector("#searchInput") as HTMLInputElement).value = item.k;
     (element.querySelector("#replaceInput") as HTMLInputElement).value = item.r;
     (element.querySelector("#replaceInput") as HTMLInputElement).value = item.r;
-    let methodTip = window.siyuan.languages.searchMethod + " "
+    let methodTip = window.siyuan.languages.searchMethod + " ";
     switch (item.method) {
     switch (item.method) {
         case 0:
         case 0:
             methodTip += window.siyuan.languages.keyword;
             methodTip += window.siyuan.languages.keyword;
             break;
             break;
         case 1:
         case 1:
-            methodTip += window.siyuan.languages.querySyntax
+            methodTip += window.siyuan.languages.querySyntax;
             break;
             break;
         case 2:
         case 2:
-            methodTip += "SQL"
+            methodTip += "SQL";
             break;
             break;
         case 3:
         case 3:
-            methodTip += window.siyuan.languages.regex
+            methodTip += window.siyuan.languages.regex;
             break;
             break;
     }
     }
     element.querySelector("#searchSyntaxCheck").setAttribute("aria-label", methodTip);
     element.querySelector("#searchSyntaxCheck").setAttribute("aria-label", methodTip);

+ 8 - 8
app/src/util/globalShortcut.ts

@@ -103,8 +103,8 @@ export const globalShortcut = () => {
                     if (!hasClosestByClassName(event.target as HTMLElement, "b3-menu") &&
                     if (!hasClosestByClassName(event.target as HTMLElement, "b3-menu") &&
                         !hasClosestByClassName(event.target as HTMLElement, "layout--float") &&
                         !hasClosestByClassName(event.target as HTMLElement, "layout--float") &&
                         window.siyuan.layout.leftDock.layout.element.style.opacity !== "1") {
                         window.siyuan.layout.leftDock.layout.element.style.opacity !== "1") {
-                        window.siyuan.layout.leftDock.layout.element.style.left = (window.siyuan.layout.leftDock.element.clientWidth + .5) + "px"
-                        window.siyuan.layout.leftDock.layout.element.style.opacity = "1"
+                        window.siyuan.layout.leftDock.layout.element.style.left = (window.siyuan.layout.leftDock.element.clientWidth + .5) + "px";
+                        window.siyuan.layout.leftDock.layout.element.style.opacity = "1";
                     }
                     }
                 } else {
                 } else {
                     window.siyuan.layout.leftDock.hideDock();
                     window.siyuan.layout.leftDock.hideDock();
@@ -115,8 +115,8 @@ export const globalShortcut = () => {
                 if (event.clientY > document.getElementById("toolbar").clientHeight + document.getElementById("dockTop").clientHeight &&
                 if (event.clientY > document.getElementById("toolbar").clientHeight + document.getElementById("dockTop").clientHeight &&
                     event.clientY < window.innerHeight - document.getElementById("status").clientHeight - document.getElementById("dockBottom").clientHeight) {
                     event.clientY < window.innerHeight - document.getElementById("status").clientHeight - document.getElementById("dockBottom").clientHeight) {
                     if (!hasClosestByClassName(event.target as HTMLElement, "layout--float") && window.siyuan.layout.rightDock.layout.element.style.opacity !== "1") {
                     if (!hasClosestByClassName(event.target as HTMLElement, "layout--float") && window.siyuan.layout.rightDock.layout.element.style.opacity !== "1") {
-                        window.siyuan.layout.rightDock.layout.element.style.right = (window.siyuan.layout.rightDock.element.clientWidth + .5) + "px"
-                        window.siyuan.layout.rightDock.layout.element.style.opacity = "1"
+                        window.siyuan.layout.rightDock.layout.element.style.right = (window.siyuan.layout.rightDock.element.clientWidth + .5) + "px";
+                        window.siyuan.layout.rightDock.layout.element.style.opacity = "1";
                     }
                     }
                 } else {
                 } else {
                     window.siyuan.layout.rightDock.hideDock();
                     window.siyuan.layout.rightDock.hideDock();
@@ -126,13 +126,13 @@ export const globalShortcut = () => {
 
 
         if (event.clientY < 75) {
         if (event.clientY < 75) {
             if (!window.siyuan.layout.topDock.pin && window.siyuan.layout.topDock.layout.element.style.opacity !== "1") {
             if (!window.siyuan.layout.topDock.pin && window.siyuan.layout.topDock.layout.element.style.opacity !== "1") {
-                window.siyuan.layout.topDock.layout.element.style.top = (document.getElementById("dockTop").clientHeight + document.getElementById("toolbar").clientHeight + 1) + "px"
-                window.siyuan.layout.topDock.layout.element.style.opacity = "1"
+                window.siyuan.layout.topDock.layout.element.style.top = (document.getElementById("dockTop").clientHeight + document.getElementById("toolbar").clientHeight + 1) + "px";
+                window.siyuan.layout.topDock.layout.element.style.opacity = "1";
             }
             }
         } else if (event.clientY > window.innerHeight - 73) {
         } else if (event.clientY > window.innerHeight - 73) {
             if (!window.siyuan.layout.bottomDock.pin && window.siyuan.layout.bottomDock.layout.element.style.opacity !== "1") {
             if (!window.siyuan.layout.bottomDock.pin && window.siyuan.layout.bottomDock.layout.element.style.opacity !== "1") {
-                window.siyuan.layout.bottomDock.layout.element.style.bottom = (document.getElementById("dockBottom").clientHeight + document.getElementById("status").clientHeight + 1) + "px"
-                window.siyuan.layout.bottomDock.layout.element.style.opacity = "1"
+                window.siyuan.layout.bottomDock.layout.element.style.bottom = (document.getElementById("dockBottom").clientHeight + document.getElementById("status").clientHeight + 1) + "px";
+                window.siyuan.layout.bottomDock.layout.element.style.opacity = "1";
             }
             }
         }
         }