From cd9baa2b67c2aaccb1940290b6b0eb880a613adc Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 3 Nov 2024 11:48:07 +0800 Subject: [PATCH] :rotating_light: --- app/src/block/Panel.ts | 4 ++-- app/src/boot/globalEvent/command/protyle.ts | 2 +- app/src/layout/dock/Files.ts | 12 ++++++------ app/src/mobile/dock/MobileFiles.ts | 12 ++++++------ app/src/protyle/gutter/index.ts | 2 +- app/src/protyle/wysiwyg/input.ts | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/app/src/block/Panel.ts b/app/src/block/Panel.ts index 8943ca420..1a896dcd7 100644 --- a/app/src/block/Panel.ts +++ b/app/src/block/Panel.ts @@ -259,14 +259,14 @@ export class BlockPanel { html += '
'; } this.element.innerHTML = html; - let resizeTimeout: number + let resizeTimeout: number; this.observerResize = new ResizeObserver(() => { clearTimeout(resizeTimeout); resizeTimeout = window.setTimeout(() => { this.editors.forEach(item => { resize(item.protyle); }); - }, Constants.TIMEOUT_TRANSITION) + }, Constants.TIMEOUT_TRANSITION); }); this.observerResize.observe(this.element); this.observerLoad = new IntersectionObserver((e) => { diff --git a/app/src/boot/globalEvent/command/protyle.ts b/app/src/boot/globalEvent/command/protyle.ts index b38142c33..a20e9b4f7 100644 --- a/app/src/boot/globalEvent/command/protyle.ts +++ b/app/src/boot/globalEvent/command/protyle.ts @@ -19,7 +19,7 @@ export const onlyProtyleCommand = (options: { topNodeElement.nextElementSibling?.classList.contains("list") && topNodeElement.previousElementSibling.classList.contains("protyle-action")) { topNodeElement = topNodeElement.parentElement; } - const id = topNodeElement.getAttribute("data-node-id") + const id = topNodeElement.getAttribute("data-node-id"); if (options.protyle.options.backlinkData) { openFileById({ app: options.protyle.app, diff --git a/app/src/layout/dock/Files.ts b/app/src/layout/dock/Files.ts index c335be94e..adbd4f732 100644 --- a/app/src/layout/dock/Files.ts +++ b/app/src/layout/dock/Files.ts @@ -150,13 +150,13 @@ export class Files extends Model { }); break; } else if (type === "toggle") { - const svgElement = target.querySelector("svg") + const svgElement = target.querySelector("svg"); if (svgElement.classList.contains("b3-list-item__arrow--open")) { - this.closeElement.style.height = "30px" + this.closeElement.style.height = "30px"; svgElement.classList.remove("b3-list-item__arrow--open"); this.closeElement.lastElementChild.classList.add("fn__none"); } else { - this.closeElement.style.height = "40%" + this.closeElement.style.height = "40%"; svgElement.classList.add("b3-list-item__arrow--open"); this.closeElement.lastElementChild.classList.remove("fn__none"); } @@ -775,7 +775,7 @@ export class Files extends Model { if (!init) { return; } - const svgElement = this.closeElement.querySelector("svg") + const svgElement = this.closeElement.querySelector("svg"); if (html !== "") { this.closeElement.style.height = "30px"; svgElement.classList.remove("b3-list-item__arrow--open"); @@ -954,9 +954,9 @@ export class Files extends Model { tempElement.innerHTML = fileHTML; // 保持文件夹展开状态 nextElement.querySelectorAll(":scope > .b3-list-item > .b3-list-item__toggle> .b3-list-item__arrow--open").forEach(item => { - const openLiElement = hasClosestByClassName(item, "b3-list-item") + const openLiElement = hasClosestByClassName(item, "b3-list-item"); if (openLiElement) { - const tempOpenLiElement = tempElement.content.querySelector(`.b3-list-item[data-node-id="${openLiElement.getAttribute("data-node-id")}"]`) + const tempOpenLiElement = tempElement.content.querySelector(`.b3-list-item[data-node-id="${openLiElement.getAttribute("data-node-id")}"]`); tempOpenLiElement.after(openLiElement.nextElementSibling); tempOpenLiElement.querySelector(".b3-list-item__arrow").classList.add("b3-list-item__arrow--open"); } diff --git a/app/src/mobile/dock/MobileFiles.ts b/app/src/mobile/dock/MobileFiles.ts index 0868c6389..a674e6f49 100644 --- a/app/src/mobile/dock/MobileFiles.ts +++ b/app/src/mobile/dock/MobileFiles.ts @@ -158,13 +158,13 @@ export class MobileFiles extends Model { event.stopPropagation(); break; } else if (type === "toggle") { - const svgElement = target.querySelector("svg") + const svgElement = target.querySelector("svg"); if (svgElement.classList.contains("b3-list-item__arrow--open")) { - this.closeElement.style.height = "42px" + this.closeElement.style.height = "42px"; svgElement.classList.remove("b3-list-item__arrow--open"); this.closeElement.lastElementChild.classList.add("fn__none"); } else { - this.closeElement.style.height = "40%" + this.closeElement.style.height = "40%"; svgElement.classList.add("b3-list-item__arrow--open"); this.closeElement.lastElementChild.classList.remove("fn__none"); } @@ -322,7 +322,7 @@ export class MobileFiles extends Model { if (!init) { return; } - const svgElement = this.closeElement.querySelector("svg") + const svgElement = this.closeElement.querySelector("svg"); if (html !== "") { this.closeElement.style.height = "30px"; svgElement.classList.remove("b3-list-item__arrow--open"); @@ -546,9 +546,9 @@ export class MobileFiles extends Model { tempElement.innerHTML = fileHTML; // 保持文件夹展开状态 nextElement.querySelectorAll(":scope > .b3-list-item > .b3-list-item__toggle> .b3-list-item__arrow--open").forEach(item => { - const openLiElement = hasClosestByClassName(item, "b3-list-item") + const openLiElement = hasClosestByClassName(item, "b3-list-item"); if (openLiElement) { - const tempOpenLiElement = tempElement.content.querySelector(`.b3-list-item[data-node-id="${openLiElement.getAttribute("data-node-id")}"]`) + const tempOpenLiElement = tempElement.content.querySelector(`.b3-list-item[data-node-id="${openLiElement.getAttribute("data-node-id")}"]`); tempOpenLiElement.after(openLiElement.nextElementSibling); tempOpenLiElement.querySelector(".b3-list-item__arrow").classList.add("b3-list-item__arrow--open"); } diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.ts index 52fade93d..a4a8f0fde 100644 --- a/app/src/protyle/gutter/index.ts +++ b/app/src/protyle/gutter/index.ts @@ -76,7 +76,7 @@ export class Gutter { .replace(/⌘/g, "Ctrl+").replace(/⌥/g, "Alt+").replace(/⇧/g, "Shift+").replace(/⌃/g, "Ctrl+"); } if (protyle.options.backlinkData) { - this.gutterTip = this.gutterTip.replace(window.siyuan.languages.enter, window.siyuan.languages.openBy) + this.gutterTip = this.gutterTip.replace(window.siyuan.languages.enter, window.siyuan.languages.openBy); } this.element = document.createElement("div"); this.element.className = "protyle-gutters"; diff --git a/app/src/protyle/wysiwyg/input.ts b/app/src/protyle/wysiwyg/input.ts index 849caf00b..589ac72e2 100644 --- a/app/src/protyle/wysiwyg/input.ts +++ b/app/src/protyle/wysiwyg/input.ts @@ -158,7 +158,7 @@ export const input = async (protyle: IProtyle, blockElement: HTMLElement, range: // 在数学公式输入框中撤销到最后一步,再继续撤销会撤销编辑器正文内容,从而出发 input 事件 hideElements(["util"], protyle, true); if (type === "NodeTable") { - blockElement.querySelector(".table__select").removeAttribute("style") + blockElement.querySelector(".table__select").removeAttribute("style"); } const tempElement = document.createElement("template"); tempElement.innerHTML = html;