diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts index f5dab016b..e5df3ccd4 100644 --- a/app/src/menus/protyle.ts +++ b/app/src/menus/protyle.ts @@ -68,7 +68,7 @@ export const fileAnnotationRefMenu = (protyle: IProtyle, refElement: HTMLElement } else { refElement.innerHTML = "*"; } - } + }; anchorElement.addEventListener("input", (event: KeyboardEvent) => { if (event.isComposing) { return; diff --git a/app/src/plugin/EventBus.ts b/app/src/plugin/EventBus.ts index 59c9157bc..86a0051bb 100644 --- a/app/src/plugin/EventBus.ts +++ b/app/src/plugin/EventBus.ts @@ -49,4 +49,4 @@ export const emitOpenMenu = (options: { window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element); } } -} +}; diff --git a/app/src/protyle/header/Title.ts b/app/src/protyle/header/Title.ts index 4c76e4113..340eda547 100644 --- a/app/src/protyle/header/Title.ts +++ b/app/src/protyle/header/Title.ts @@ -5,7 +5,7 @@ import { } from "../util/selection"; import {fetchPost} from "../../util/fetch"; import {replaceFileName, validateName} from "../../editor/rename"; -import {MenuItem, subMenu} from "../../menus/Menu"; +import {MenuItem} from "../../menus/Menu"; import { copySubMenu, movePathToMenu, diff --git a/app/src/protyle/render/av/action.ts b/app/src/protyle/render/av/action.ts index 4ebfa4c56..023bbaadb 100644 --- a/app/src/protyle/render/av/action.ts +++ b/app/src/protyle/render/av/action.ts @@ -133,18 +133,18 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle if (checkElement) { window.siyuan.menus.menu.remove(); const rowElement = checkElement.parentElement; - const useElement = checkElement.querySelector("use") + const useElement = checkElement.querySelector("use"); if (rowElement.classList.contains("av__row--header")) { if ("#iconCheck" === useElement.getAttribute("xlink:href")) { rowElement.parentElement.querySelectorAll(".av__firstcol").forEach(item => { item.querySelector("use").setAttribute("xlink:href", "#iconUncheck"); item.parentElement.classList.remove("av__row--select"); - }) + }); } else { rowElement.parentElement.querySelectorAll(".av__firstcol").forEach(item => { item.querySelector("use").setAttribute("xlink:href", "#iconCheck"); item.parentElement.classList.add("av__row--select"); - }) + }); } } else { if (useElement.getAttribute("xlink:href") === "#iconUncheck") { @@ -181,7 +181,7 @@ export const avContextmenu = (protyle: IProtyle, event: MouseEvent & { detail: a return false; } if (rowElement.classList.contains("av__row--header")) { - return false + return false; } const blockElement = hasClosestBlock(rowElement); if (!blockElement) { diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts index 3e1094124..fcb0c50c8 100644 --- a/app/src/protyle/render/av/cell.ts +++ b/app/src/protyle/render/av/cell.ts @@ -51,9 +51,9 @@ const updateCellValue = (protyle: IProtyle, cellElement: HTMLElement, type: TAVC } const avMaskElement = document.querySelector(".av__mask"); const inputElement = avMaskElement.querySelector(".b3-text-field") as HTMLInputElement; - const cellId = cellElement.getAttribute("data-id") - const avId = blockElement.getAttribute("data-av-id") - const rowId = rowElement.getAttribute("data-id") + const cellId = cellElement.getAttribute("data-id"); + const avId = blockElement.getAttribute("data-av-id"); + const rowId = rowElement.getAttribute("data-id"); transaction(protyle, [{ action: "updateAttrViewCell", id: cellId, @@ -90,7 +90,7 @@ const removeCol = (cellElement: HTMLElement) => { export const showHeaderCellMenu = (protyle: IProtyle, blockElement: HTMLElement, cellElement: HTMLElement) => { const type = cellElement.getAttribute("data-dtype") as TAVCol; const menu = new Menu("av-header-cell", () => { - const newValue = (window.siyuan.menus.menu.element.querySelector(".b3-text-field") as HTMLInputElement).value + const newValue = (window.siyuan.menus.menu.element.querySelector(".b3-text-field") as HTMLInputElement).value; if (newValue === cellElement.textContent.trim()) { return; } diff --git a/app/src/protyle/render/av/col.ts b/app/src/protyle/render/av/col.ts index 5a0e1c094..977473034 100644 --- a/app/src/protyle/render/av/col.ts +++ b/app/src/protyle/render/av/col.ts @@ -14,26 +14,26 @@ export const updateHeader = (rowElement: HTMLElement) => { if (!blockElement) { return; } - const selectCount = rowElement.parentElement.querySelectorAll(".av__row--select:not(.av__row--header)").length - const diffCount = rowElement.parentElement.childElementCount - 3 - selectCount - const headElement = rowElement.parentElement.firstElementChild - const headUseElement = headElement.querySelector("use") - const counterElement = blockElement.querySelector(".av__counter") - const avHeadElement = blockElement.querySelector(".av__header") as HTMLElement + const selectCount = rowElement.parentElement.querySelectorAll(".av__row--select:not(.av__row--header)").length; + const diffCount = rowElement.parentElement.childElementCount - 3 - selectCount; + const headElement = rowElement.parentElement.firstElementChild; + const headUseElement = headElement.querySelector("use"); + const counterElement = blockElement.querySelector(".av__counter"); + const avHeadElement = blockElement.querySelector(".av__header") as HTMLElement; if (diffCount === 0) { headElement.classList.add("av__row--select"); headUseElement.setAttribute("xlink:href", "#iconCheck"); } else if (diffCount === rowElement.parentElement.childElementCount - 3) { headElement.classList.remove("av__row--select"); headUseElement.setAttribute("xlink:href", "#iconUncheck"); - counterElement.classList.add("fn__none") - avHeadElement.style.position = "" + counterElement.classList.add("fn__none"); + avHeadElement.style.position = ""; return; } else if (diffCount > 0) { headElement.classList.add("av__row--select"); headUseElement.setAttribute("xlink:href", "#iconIndeterminateCheck"); } - counterElement.classList.remove("fn__none") - counterElement.innerHTML = `${selectCount} selected` - avHeadElement.style.position = "sticky" -} + counterElement.classList.remove("fn__none"); + counterElement.innerHTML = `${selectCount} selected`; + avHeadElement.style.position = "sticky"; +}; diff --git a/app/src/protyle/render/av/render.ts b/app/src/protyle/render/av/render.ts index def76de61..1a2ca7dd4 100644 --- a/app/src/protyle/render/av/render.ts +++ b/app/src/protyle/render/av/render.ts @@ -48,19 +48,19 @@ export const avRender = (element: Element, cb?: () => void) => {
`; row.cells.forEach((cell, index) => { - let text: string + let text: string; if (cell.valueType === "text") { - text = cell.value?.text.content || "" + text = cell.value?.text.content || ""; } else if (cell.valueType === "block") { - text = cell.value?.block.content || "" + text = cell.value?.block.content || ""; } else if (cell.valueType === "number") { - text = cell.value?.number.content || "" + text = cell.value?.number.content || ""; } else if (cell.valueType === "select") { - text = cell.value?.select.content || "" + text = cell.value?.select.content || ""; } else if (cell.valueType === "mSelect") { - text = cell.value?.mSelect.content || "" + text = cell.value?.mSelect.content || ""; } else if (cell.valueType === "date") { - text = cell.value?.date.content || "" + text = cell.value?.date.content || ""; } tableHTML += `
${text}
`; }); diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts index 1ec180592..1af5949f3 100644 --- a/app/src/protyle/toolbar/index.ts +++ b/app/src/protyle/toolbar/index.ts @@ -15,7 +15,7 @@ import {Link} from "./Link"; import {setPosition} from "../../util/setPosition"; import {updateTransaction} from "../wysiwyg/transaction"; import {Constants} from "../../constants"; -import {getEventName, openByMobile, setStorageVal} from "../util/compatibility"; +import {openByMobile, setStorageVal} from "../util/compatibility"; import {upDownHint} from "../../util/upDownHint"; import {highlightRender} from "../render/highlightRender"; import {getContenteditableElement, hasNextSibling, hasPreviousSibling} from "../wysiwyg/getBlock"; diff --git a/app/src/search/util.ts b/app/src/search/util.ts index c5dc86366..2170163ad 100644 --- a/app/src/search/util.ts +++ b/app/src/search/util.ts @@ -1015,7 +1015,7 @@ const replace = (element: Element, config: ISearchOption, edit: Protyle, app: Ap if (isAll) { return; } - const rootId = currentList.getAttribute("data-root-id") + const rootId = currentList.getAttribute("data-root-id"); getAllModels().editor.forEach(item => { if (rootId === item.editor.protyle.block.rootID) { reloadProtyle(item.editor.protyle, false);