diff --git a/app/src/card/openCard.ts b/app/src/card/openCard.ts index bbbedbafd..264cf32a4 100644 --- a/app/src/card/openCard.ts +++ b/app/src/card/openCard.ts @@ -485,10 +485,10 @@ export const openCardByData = async (app: App, cardsData: ICardData, cardType: T dialog }); dialog.editor = editor; - const focusElement = dialog.element.querySelector('.b3-button[data-type="-1"]') as HTMLButtonElement + const focusElement = dialog.element.querySelector('.b3-button[data-type="-1"]') as HTMLButtonElement; focusElement.focus(); - const range = document.createRange() - range.selectNodeContents(focusElement) + const range = document.createRange(); + range.selectNodeContents(focusElement); focusByRange(range); }; diff --git a/app/src/history/diff.ts b/app/src/history/diff.ts index 82e6a51b0..5f229ec6b 100644 --- a/app/src/history/diff.ts +++ b/app/src/history/diff.ts @@ -161,7 +161,7 @@ export const showDiff = (app: App, data: { id: string, time: string }[]) => { rightEditor = undefined; } }); - dialog.element.setAttribute("data-key", Constants.DIALOG_HISTORYCOMPARE) + dialog.element.setAttribute("data-key", Constants.DIALOG_HISTORYCOMPARE); dialog.element.addEventListener("click", (event) => { if (typeof event.detail === "string") { renderCompare(app, dialog.element.querySelector(".history__diff .b3-list-item--focus")); diff --git a/app/src/history/keydown.ts b/app/src/history/keydown.ts index 53d0120f9..5d9d37475 100644 --- a/app/src/history/keydown.ts +++ b/app/src/history/keydown.ts @@ -1,8 +1,8 @@ import {Dialog} from "../dialog"; export const historyKeydown = (event: KeyboardEvent, dialog: Dialog) => { - let currentItem = dialog.element.querySelector(".history__diff .b3-list-item--focus") - const items = Array.from(dialog.element.querySelectorAll(".history__diff .b3-list-item[data-id]")) + let currentItem = dialog.element.querySelector(".history__diff .b3-list-item--focus"); + const items = Array.from(dialog.element.querySelectorAll(".history__diff .b3-list-item[data-id]")); if (items.length < 2) { return; } @@ -11,9 +11,9 @@ export const historyKeydown = (event: KeyboardEvent, dialog: Dialog) => { } else { currentItem.classList.remove("b3-list-item--focus"); if (event.key === "Home") { - currentItem = items[0] + currentItem = items[0]; } else if (event.key === "End") { - currentItem = items[items.length - 1] + currentItem = items[items.length - 1]; } else { items.find((item, index) => { if (item.isSameNode(currentItem)) { @@ -32,7 +32,7 @@ export const historyKeydown = (event: KeyboardEvent, dialog: Dialog) => { } return true; } - }) + }); } } currentItem.classList.add("b3-list-item--focus"); @@ -44,9 +44,9 @@ export const historyKeydown = (event: KeyboardEvent, dialog: Dialog) => { const historyDiffElement = dialog.element.querySelector(".history__diff"); const historyDiffRect = historyDiffElement.getBoundingClientRect(); if (currentItemRect.bottom > historyDiffRect.bottom) { - currentItem.scrollIntoView(false) + currentItem.scrollIntoView(false); } else if (currentItemRect.top < historyDiffRect.top) { - currentItem.scrollIntoView() + currentItem.scrollIntoView(); } dialog.element.dispatchEvent(new CustomEvent("click", {detail: event.key.toLowerCase()})); -} +}; diff --git a/app/src/layout/util.ts b/app/src/layout/util.ts index 764bc3546..ee6ad3fb2 100644 --- a/app/src/layout/util.ts +++ b/app/src/layout/util.ts @@ -875,7 +875,7 @@ export const adjustLayout = (layout: Layout = window.siyuan.layout.centerLayout. item.element.style.minWidth = ""; } }); - let lastItem: HTMLElement + let lastItem: HTMLElement; while (layout.element.scrollWidth > layout.element.clientWidth) { layout.children.find((item: Layout | Wnd) => { if (item.element.style.width && item.element.style.width !== "0px") { diff --git a/app/src/mobile/settings/account.ts b/app/src/mobile/settings/account.ts index 928725ef1..8ec9b4590 100644 --- a/app/src/mobile/settings/account.ts +++ b/app/src/mobile/settings/account.ts @@ -20,7 +20,7 @@ export const showAccountInfo = () => { }); userTitlesHTML += ""; } - let subscriptionHTML = "" + let subscriptionHTML = ""; if (window.siyuan.user.userSiYuanProExpireTime === -1) { // 终身会员 subscriptionHTML = `
${Constants.SIYUAN_IMAGE_VIP}${window.siyuan.languages.account12}
`; diff --git a/app/src/protyle/index.ts b/app/src/protyle/index.ts index 7c5b61c9d..014172ad7 100644 --- a/app/src/protyle/index.ts +++ b/app/src/protyle/index.ts @@ -58,7 +58,7 @@ export class Protyle { if (item.protyleOptions) { pluginsOptions = merge(pluginsOptions, item.protyleOptions); } - }) + }); const getOptions = new Options(pluginsOptions); const mergedOptions = getOptions.merge(); this.protyle = { diff --git a/app/src/protyle/render/av/asset.ts b/app/src/protyle/render/av/asset.ts index 0d07cdb53..646a57650 100644 --- a/app/src/protyle/render/av/asset.ts +++ b/app/src/protyle/render/av/asset.ts @@ -103,12 +103,12 @@ export const updateAssetCell = (options: { const colId = options.cellElements[0].dataset.colId; const cellDoOperations: IOperation[] = []; const cellUndoOperations: IOperation[] = []; - let mAssetValue: IAVCellAssetValue[] + let mAssetValue: IAVCellAssetValue[]; options.cellElements.forEach((item, elementIndex) => { if (!options.blockElement.contains(item)) { const rowElement = hasClosestByClassName(item, "av__row"); if (rowElement) { - item = options.cellElements[elementIndex] = options.blockElement.querySelector(`.av__row[data-id="${rowElement.dataset.id}"] .av__cell[data-col-id="${item.dataset.colId}"]`) as HTMLElement + item = options.cellElements[elementIndex] = options.blockElement.querySelector(`.av__row[data-id="${rowElement.dataset.id}"] .av__cell[data-col-id="${item.dataset.colId}"]`) as HTMLElement; } } const cellValue = genCellValueByElement(getTypeByCellElement(item) || item.dataset.type as TAVCol, item); @@ -144,9 +144,9 @@ export const updateAssetCell = (options: { } else { cellValue.mAsset = options.replaceValue; } - mAssetValue = cellValue.mAsset + mAssetValue = cellValue.mAsset; } else { - cellValue.mAsset = mAssetValue + cellValue.mAsset = mAssetValue; } cellDoOperations.push({ action: "updateAttrViewCell", diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts index e5877ebc7..e30fcd9ad 100644 --- a/app/src/protyle/render/av/cell.ts +++ b/app/src/protyle/render/av/cell.ts @@ -209,7 +209,7 @@ export const cellScrollIntoView = (blockElement: HTMLElement, cellElement: Eleme contentElement.scrollTop = contentElement.scrollTop + cellRect.top - avHeaderRect.bottom; } } else { - const footerElement = blockElement.querySelector(".av__row--footer") + const footerElement = blockElement.querySelector(".av__row--footer"); if (footerElement.querySelector(".av__calc--ashow")) { const avFooterRect = footerElement.getBoundingClientRect(); if (avFooterRect.top < cellRect.bottom) { @@ -557,7 +557,7 @@ export const renderCell = (cellValue: IAVCellValue, wrap: boolean) => { } else if (cellValue.type === "checkbox") { text += ``; } else if (cellValue.type === "rollup") { - cellValue?.rollup?.contents?.forEach((item, index) => { + cellValue?.rollup?.contents?.forEach((item) => { const rollupText = ["select", "mSelect", "mAsset", "checkbox", "relation"].includes(item.type) ? renderCell(item, wrap) : renderRollup(item); if (rollupText) { text += rollupText + ", "; diff --git a/app/src/protyle/render/av/render.ts b/app/src/protyle/render/av/render.ts index f96a4bc40..a61cd9a76 100644 --- a/app/src/protyle/render/av/render.ts +++ b/app/src/protyle/render/av/render.ts @@ -1,7 +1,7 @@ import {fetchPost} from "../../../util/fetch"; import {getColIconByType} from "./col"; import {Constants} from "../../../constants"; -import {popTextCell, renderCell} from "./cell"; +import {renderCell} from "./cell"; import {unicode2Emoji} from "../../../emoji"; import {focusBlock} from "../../util/selection"; import {hasClosestBlock, hasClosestByClassName} from "../../util/hasClosest"; @@ -264,7 +264,7 @@ ${cell.color ? `color:${cell.color};` : ""}">${renderCell(cell.value, data.colum const refreshTimeouts: { [key: string]: number; } = {}; -export const refreshAV = (protyle: IProtyle, operation: IOperation, isUndo: boolean) => { +export const refreshAV = (protyle: IProtyle, operation: IOperation) => { if (operation.action === "setAttrViewName") { Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${operation.id}"]`)).forEach((item: HTMLElement) => { const titleElement = item.querySelector(".av__title") as HTMLElement; diff --git a/app/src/protyle/render/av/row.ts b/app/src/protyle/render/av/row.ts index 48bed10cb..24d69246b 100644 --- a/app/src/protyle/render/av/row.ts +++ b/app/src/protyle/render/av/row.ts @@ -108,14 +108,14 @@ export const insertAttrViewBlockAnimation = (protyle: IProtyle, blockElement: El const sideRowCellElement = sideRow.querySelector(`.av__cell[data-col-id="${item.column}"]`) as HTMLElement; currentRow.querySelector(`.av__cell[data-col-id="${item.column}"]`).innerHTML = renderCell(genCellValueByElement(getTypeByCellElement(sideRowCellElement), sideRowCellElement), sideRowCellElement.dataset.wrap === "true"); - }) + }); response.data.sorts.forEach((item: IAVSort) => { const sideRowCellElement = sideRow.querySelector(`.av__cell[data-col-id="${item.column}"]`) as HTMLElement; currentRow.querySelector(`.av__cell[data-col-id="${item.column}"]`).innerHTML = renderCell(genCellValueByElement(getTypeByCellElement(sideRowCellElement), sideRowCellElement), sideRowCellElement.dataset.wrap === "true"); - }) + }); popTextCell(protyle, [currentRow.querySelector('.av__cell[data-detached="true"]')], "block"); - }) + }); } else { popTextCell(protyle, [currentRow.querySelector('.av__cell[data-detached="true"]')], "block"); } diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts index f3092aa89..7771a57d5 100644 --- a/app/src/protyle/toolbar/index.ts +++ b/app/src/protyle/toolbar/index.ts @@ -1294,7 +1294,7 @@ export class Toolbar { `; const listElement = this.subElement.querySelector(".b3-list"); const previewElement = this.subElement.firstElementChild.lastElementChild; - let previewPath: string + let previewPath: string; listElement.addEventListener("mouseover", (event) => { const target = event.target as HTMLElement; const hoverItemElement = hasClosestByClassName(target, "b3-list-item"); diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts index 37b2f9f76..fe43f5fb7 100644 --- a/app/src/protyle/wysiwyg/transaction.ts +++ b/app/src/protyle/wysiwyg/transaction.ts @@ -725,7 +725,7 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo: "replaceAttrViewBlock", "updateAttrViewColTemplate", "setAttrViewColPin", "addAttrViewView", "removeAttrViewView", "setAttrViewViewName", "setAttrViewViewIcon", "duplicateAttrViewView", "sortAttrViewView", "updateAttrViewColRelation", "setAttrViewPageSize", "updateAttrViewColRollup"].includes(operation.action)) { - refreshAV(protyle, operation, isUndo); + refreshAV(protyle, operation); } else if (operation.action === "doUpdateUpdated") { updateElements.forEach(item => { item.setAttribute("updated", operation.data);