diff --git a/app/src/boot/globalEvent/keydown.ts b/app/src/boot/globalEvent/keydown.ts index cd67a4dce..e6b27f40a 100644 --- a/app/src/boot/globalEvent/keydown.ts +++ b/app/src/boot/globalEvent/keydown.ts @@ -1313,7 +1313,7 @@ export const windowKeyDown = (app: App, event: KeyboardEvent) => { // 需放在 dialog 前,否则属性面板中修改日期会先关闭 dialog,只剩修改界面 const avElement = document.querySelector(".av__panel"); if (avElement) { - const selectCellElement = document.querySelector(".av__cell--select") + const selectCellElement = document.querySelector(".av__cell--select"); if (selectCellElement) { focusBlock(hasClosestBlock(selectCellElement) as HTMLElement); } diff --git a/app/src/layout/dock/index.ts b/app/src/layout/dock/index.ts index a6bd5a159..d08b188de 100644 --- a/app/src/layout/dock/index.ts +++ b/app/src/layout/dock/index.ts @@ -190,7 +190,7 @@ export class Dock { documentSelf.onselect = null; this.setSize(); this.element.querySelectorAll(".dock__item--active").forEach(item => { - const customModel = this.data[item.getAttribute("data-type")] + const customModel = this.data[item.getAttribute("data-type")]; if (customModel && customModel instanceof Custom && customModel.resize) { customModel.resize(); } diff --git a/app/src/protyle/render/av/action.ts b/app/src/protyle/render/av/action.ts index 5b4e7fc8c..50ea29fdd 100644 --- a/app/src/protyle/render/av/action.ts +++ b/app/src/protyle/render/av/action.ts @@ -39,7 +39,7 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle const copyElement = hasClosestByAttribute(event.target, "data-type", "copy"); if (copyElement) { - const textElement = copyElement.previousElementSibling + const textElement = copyElement.previousElementSibling; if (textElement.querySelector(".av__cellicon")) { writeText(`${textElement.firstChild.textContent} → ${textElement.lastChild.textContent}`); } else { @@ -72,7 +72,7 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle if (gutterElement && gutterElement.parentElement.classList.contains("av__gutters")) { const rowElement = hasClosestByClassName(gutterElement, "av__row"); if (!rowElement) { - return + return; } if (gutterElement.dataset.action === "add") { const avID = blockElement.getAttribute("data-av-id"); @@ -204,9 +204,9 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle const cellElement = hasClosestByClassName(event.target, "av__cell"); if (cellElement && !hasClosestByClassName(cellElement, "av__row--header")) { - const scrollElement = hasClosestByClassName(cellElement, "av__scroll") + const scrollElement = hasClosestByClassName(cellElement, "av__scroll"); if (!scrollElement) { - return + return; } const rowElement = hasClosestByClassName(cellElement, "av__row"); if (!rowElement) { diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts index 080fac51a..c2dd5b81f 100644 --- a/app/src/protyle/render/av/cell.ts +++ b/app/src/protyle/render/av/cell.ts @@ -363,7 +363,7 @@ export const cellScrollIntoView = (blockElement: HTMLElement, cellElement: Eleme if (rowElement) { const stickyElement = rowElement.querySelector(".av__colsticky"); if (stickyElement) { - const stickyRight = stickyElement.getBoundingClientRect().right + const stickyRight = stickyElement.getBoundingClientRect().right; if (stickyRight > cellRect.left) { avScrollElement.scrollLeft = avScrollElement.scrollLeft + cellRect.left - stickyRight; } @@ -396,16 +396,16 @@ export const cellScrollIntoView = (blockElement: HTMLElement, cellElement: Eleme }; export const getTypeByCellElement = (cellElement: Element) => { - const scrollElement = hasClosestByClassName(cellElement, "av__scroll") + const scrollElement = hasClosestByClassName(cellElement, "av__scroll"); if (!scrollElement) { return; } return scrollElement.querySelector(".av__row--header").querySelector(`[data-col-id="${cellElement.getAttribute("data-col-id")}"]`).getAttribute("data-dtype") as TAVCol; -} +}; export const popTextCell = (protyle: IProtyle, cellElements: HTMLElement[], type?: TAVCol) => { if (!type) { - type = getTypeByCellElement(cellElements[0]) + type = getTypeByCellElement(cellElements[0]); } if (type === "updated" || type === "created") { return; diff --git a/app/src/protyle/render/av/col.ts b/app/src/protyle/render/av/col.ts index 125b8c1f8..30554c2ba 100644 --- a/app/src/protyle/render/av/col.ts +++ b/app/src/protyle/render/av/col.ts @@ -578,7 +578,7 @@ export const showColMenu = (protyle: IProtyle, blockElement: Element, cellElemen } }); } - const isPin = cellElement.dataset.pin === "true" + const isPin = cellElement.dataset.pin === "true"; menu.addItem({ icon: "iconPin", label: isPin ? window.siyuan.languages.unfreezeCol : window.siyuan.languages.freezeCol, diff --git a/app/src/protyle/render/av/keydown.ts b/app/src/protyle/render/av/keydown.ts index c0d740bab..378e2121e 100644 --- a/app/src/protyle/render/av/keydown.ts +++ b/app/src/protyle/render/av/keydown.ts @@ -43,7 +43,7 @@ export const avKeydown = (event: KeyboardEvent, nodeElement: HTMLElement, protyl newCellElement = selectCellElement.previousElementSibling.lastElementChild; } } else if (previousRowElement && !previousRowElement.classList.contains("av__row--header")) { - const previousCellElements = previousRowElement.querySelectorAll(".av__cell") + const previousCellElements = previousRowElement.querySelectorAll(".av__cell"); newCellElement = previousCellElements[previousCellElements.length - 1]; } if (newCellElement) { diff --git a/app/src/protyle/render/av/render.ts b/app/src/protyle/render/av/render.ts index 985e624d4..0569f1128 100644 --- a/app/src/protyle/render/av/render.ts +++ b/app/src/protyle/render/av/render.ts @@ -69,11 +69,11 @@ export const avRender = (element: Element, protyle: IProtyle, cb?: () => void) = pinMaxIndex = index; } } - }) + }); pinIndex = Math.min(pinIndex, pinMaxIndex); if (pinIndex > -1) { - tableHTML = '
' - calcHTML = '
' + tableHTML = '
'; + calcHTML = '
'; } data.columns.forEach((column: IAVColumn, index: number) => { if (column.hidden) { @@ -90,12 +90,12 @@ ${column.wrap ? "" : "white-space: nowrap;"}">
`; if (pinIndex === index) { - tableHTML += '
' + tableHTML += "
"; } calcHTML += `
${getCalcValue(column) || '' + window.siyuan.languages.calc}
`; if (pinIndex === index) { - calcHTML += '
' + calcHTML += "
"; } }); tableHTML += `
@@ -112,9 +112,9 @@ style="width: ${column.width || "200px"}">${getCalcValue(column) || '
`; if (pinIndex > -1) { - tableHTML += '
' + tableHTML += '
'; } else { - tableHTML += `
` + tableHTML += "
"; } row.cells.forEach((cell, index) => { @@ -194,7 +194,7 @@ ${cell.valueType !== "number" ? "" : "flex-direction: row-reverse;"} ${cell.color ? `color:${cell.color};` : ""}">${text}
`; if (pinIndex === index) { - tableHTML += '
' + tableHTML += "
"; } }); tableHTML += "
"; diff --git a/app/src/protyle/render/av/row.ts b/app/src/protyle/render/av/row.ts index 48d3e16b5..0355e0d16 100644 --- a/app/src/protyle/render/av/row.ts +++ b/app/src/protyle/render/av/row.ts @@ -4,7 +4,7 @@ import {focusBlock} from "../../util/selection"; export const selectRow = (checkElement: Element, type: "toggle" | "select" | "unselect" | "unselectAll") => { const rowElement = hasClosestByClassName(checkElement, "av__row"); if (!rowElement) { - return + return; } const useElement = checkElement.querySelector("use"); if (rowElement.classList.contains("av__row--header") || type === "unselectAll") { @@ -72,12 +72,12 @@ export const insertAttrViewBlockAnimation = (blockElement: Element, size: number let colHTML = '
'; const pinIndex = previousElement.querySelectorAll(".av__colsticky .av__cell").length - 1; if (pinIndex > -1) { - colHTML = `
`; + colHTML = "
"; } previousElement.querySelectorAll(".av__cell").forEach((item: HTMLElement, index) => { colHTML += `
`; if (pinIndex === index) { - colHTML += `
`; + colHTML += "
"; } }); diff --git a/app/src/protyle/scroll/event.ts b/app/src/protyle/scroll/event.ts index 24d1a1f8b..fb33c0836 100644 --- a/app/src/protyle/scroll/event.ts +++ b/app/src/protyle/scroll/event.ts @@ -24,7 +24,7 @@ export const scrollEvent = (protyle: IProtyle, element: HTMLElement) => { if (item.dataset.render !== "true") { return; } - const scrollRect = item.querySelector(".av__scroll").getBoundingClientRect() + const scrollRect = item.querySelector(".av__scroll").getBoundingClientRect(); const headerElement = item.querySelector(".av__row--header") as HTMLElement; if (headerElement) { const distance = Math.floor(elementRect.top - scrollRect.top); diff --git a/app/src/protyle/util/compatibility.ts b/app/src/protyle/util/compatibility.ts index 2fa71009c..004709522 100644 --- a/app/src/protyle/util/compatibility.ts +++ b/app/src/protyle/util/compatibility.ts @@ -92,8 +92,8 @@ export const isNotCtrl = (event: KeyboardEvent | MouseEvent) => { if (!event.metaKey && !event.ctrlKey) { return true; } - return false -} + return false; +}; export const isHuawei = () => { return window.siyuan.config.system.osPlatform.toLowerCase().indexOf("huawei") > -1; diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts index 706890f87..9165bdb32 100644 --- a/app/src/protyle/util/editorCommonEvent.ts +++ b/app/src/protyle/util/editorCommonEvent.ts @@ -856,23 +856,23 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => { if (targetClass.includes("dragover__left")) { if (targetElement.previousElementSibling) { if (targetElement.previousElementSibling.classList.contains("av__colsticky")) { - previousID = targetElement.previousElementSibling.lastElementChild.getAttribute("data-col-id") + previousID = targetElement.previousElementSibling.lastElementChild.getAttribute("data-col-id"); } else { - previousID = targetElement.previousElementSibling.getAttribute("data-col-id") + previousID = targetElement.previousElementSibling.getAttribute("data-col-id"); } } } else { - previousID = targetElement.getAttribute("data-col-id") + previousID = targetElement.getAttribute("data-col-id"); } let oldPreviousID = ""; const rowElement = hasClosestByClassName(targetElement, "av__row"); if (rowElement) { - const oldPreviousElement = rowElement.querySelector(`[data-col-id="${gutterTypes[2]}"`)?.previousElementSibling + const oldPreviousElement = rowElement.querySelector(`[data-col-id="${gutterTypes[2]}"`)?.previousElementSibling; if (oldPreviousElement) { if (oldPreviousElement.classList.contains("av__colsticky")) { - oldPreviousID = oldPreviousElement.lastElementChild.getAttribute("data-col-id") + oldPreviousID = oldPreviousElement.lastElementChild.getAttribute("data-col-id"); } else { - oldPreviousID = oldPreviousElement.getAttribute("data-col-id") + oldPreviousID = oldPreviousElement.getAttribute("data-col-id"); } } } @@ -1136,8 +1136,8 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => { // 表头只能拖拽到当前 av 的表头中 targetElement = hasClosestByClassName(event.target, "av__cell"); if (targetElement) { - const targetRowElement = hasClosestByClassName(targetElement, "av__row--header") - const dragRowElement = hasClosestByClassName(window.siyuan.dragElement, "av__row--header") + const targetRowElement = hasClosestByClassName(targetElement, "av__row--header"); + const dragRowElement = hasClosestByClassName(window.siyuan.dragElement, "av__row--header"); if (!targetRowElement || !dragRowElement || (targetRowElement && dragRowElement && !targetRowElement.isSameNode(dragRowElement)) ) { diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index 631d65acd..32cfbca26 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -384,7 +384,7 @@ export class WYSIWYG { let newWidth: string; documentSelf.onmousemove = (moveEvent: MouseEvent) => { newWidth = Math.max(oldWidth + (moveEvent.clientX - event.clientX), 58) + "px"; - const scrollElement = hasClosestByClassName(dragElement, "av__scroll") + const scrollElement = hasClosestByClassName(dragElement, "av__scroll"); if (scrollElement) { scrollElement.querySelectorAll(".av__row, .av__row--footer").forEach(item => { (item.querySelector(`[data-col-id="${dragColId}"]`) as HTMLElement).style.width = newWidth; diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts index f6aa408a4..83365b81a 100644 --- a/app/src/protyle/wysiwyg/keydown.ts +++ b/app/src/protyle/wysiwyg/keydown.ts @@ -1,5 +1,5 @@ import {hideElements} from "../ui/hideElements"; -import {copyPlainText, isMac, isNotCtrl, isOnlyMeta, writeText} from "../util/compatibility"; +import {isMac, isNotCtrl, isOnlyMeta, writeText} from "../util/compatibility"; import { focusBlock, focusByRange, diff --git a/app/src/util/upDownHint.ts b/app/src/util/upDownHint.ts index 5c2f5523e..3b2b39969 100644 --- a/app/src/util/upDownHint.ts +++ b/app/src/util/upDownHint.ts @@ -1,7 +1,7 @@ export const upDownHint = (listElement: Element, event: KeyboardEvent, classActiveName = "b3-list-item--focus") => { let currentHintElement: HTMLElement = listElement.querySelector("." + classActiveName); if (!currentHintElement) { - return + return; } const className = classActiveName.split("--")[0]; if (event.key === "ArrowDown") {