diff --git a/app/src/card/openCard.ts b/app/src/card/openCard.ts index c93d2fd87..bc6a2a097 100644 --- a/app/src/card/openCard.ts +++ b/app/src/card/openCard.ts @@ -336,7 +336,7 @@ export const bindCardEvent = (options: { hideElements(["toolbar", "hint", "util"], editor.protyle); if (type === "-1") { // 显示答案 if (actionElements[0].classList.contains("fn__none")) { - type = "3" + type = "3"; } else { editor.protyle.element.classList.remove("card__block--hidemark", "card__block--hideli", "card__block--hidesb", "card__block--hideh"); actionElements[0].classList.add("fn__none"); diff --git a/app/src/constants.ts b/app/src/constants.ts index 7a145f90b..a96098e34 100644 --- a/app/src/constants.ts +++ b/app/src/constants.ts @@ -543,7 +543,7 @@ export abstract class Constants { "code-block": true, "math-block": true, "html-block": true - } + }; // image public static readonly SIYUAN_IMAGE_VIP: string = ` diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts index d90280145..4550870e2 100644 --- a/app/src/protyle/render/av/cell.ts +++ b/app/src/protyle/render/av/cell.ts @@ -12,7 +12,7 @@ export const getCellText = (cellElement: HTMLElement | false) => { if (!cellElement) { return ""; } - let cellText = "" + let cellText = ""; const textElement = cellElement.querySelector(".av__celltext"); if (textElement) { if (textElement.querySelector(".av__cellicon")) { @@ -29,7 +29,7 @@ export const getCellText = (cellElement: HTMLElement | false) => { const genCellValueByElement = (colType: TAVCol, cellElement: HTMLElement) => { let cellValue: IAVCellValue; if (colType === "number") { - const value = cellElement.querySelector(".av__celltext").getAttribute("data-content") + const value = cellElement.querySelector(".av__celltext").getAttribute("data-content"); cellValue = { type: colType, number: { @@ -45,13 +45,13 @@ const genCellValueByElement = (colType: TAVCol, cellElement: HTMLElement) => { } }; } else if (colType === "mSelect" || colType === "select") { - const mSelect: IAVCellSelectValue[] = [] + const mSelect: IAVCellSelectValue[] = []; cellElement.querySelectorAll(".b3-chip").forEach((item: HTMLElement) => { mSelect.push({ content: item.textContent.trim(), color: item.style.color.replace("var(--b3-font-color", "").replace(")", "") - }) - }) + }); + }); cellValue = { type: colType, mSelect @@ -70,7 +70,7 @@ const genCellValueByElement = (colType: TAVCol, cellElement: HTMLElement) => { }; } return cellValue; -} +}; export const genCellValue = (colType: TAVCol, value: string | any) => { let cellValue: IAVCellValue; @@ -323,7 +323,7 @@ const updateCellValueByInput = (protyle: IProtyle, type: TAVCol, cellElements: H let tempElement = protyle.wysiwyg.element.querySelector(`.av__cell[data-id="${cellElements[0].dataset.id}"]`) as HTMLElement; if (!tempElement) { // 修改单元格后修改其他没有内容的单元格(id 会随机) - tempElement = protyle.wysiwyg.element.querySelector(`.av__row[data-id="${rowElement.dataset.id}"] .av__cell[data-col-id="${cellElements[0].dataset.colId}"]`) as HTMLElement + tempElement = protyle.wysiwyg.element.querySelector(`.av__row[data-id="${rowElement.dataset.id}"] .av__cell[data-col-id="${cellElements[0].dataset.colId}"]`) as HTMLElement; } if (!tempElement) { return; @@ -451,18 +451,18 @@ const updateCellValueByInput = (protyle: IProtyle, type: TAVCol, cellElements: H }; export const updateCellsValue = (protyle: IProtyle, nodeElement: HTMLElement, value = "") => { - const doOperations: IOperation[] = [] - const undoOperations: IOperation[] = [] + const doOperations: IOperation[] = []; + const undoOperations: IOperation[] = []; - const avID = nodeElement.dataset.avId - const id = nodeElement.dataset.nodeId - let text = '' + const avID = nodeElement.dataset.avId; + const id = nodeElement.dataset.nodeId; + let text = ""; const cellElements: Element[] = Array.from(nodeElement.querySelectorAll(".av__cell--select")) || []; if (cellElements.length === 0) { nodeElement.querySelectorAll(".av__row--select:not(.av__row--header)").forEach(rowElement => { rowElement.querySelectorAll(".av__cell").forEach(cellElement => { - cellElements.push(cellElement) - }) + cellElements.push(cellElement); + }); }); } cellElements.forEach((item: HTMLElement) => { @@ -499,19 +499,19 @@ export const updateCellsValue = (protyle: IProtyle, nodeElement: HTMLElement, va if (!hasClosestByClassName(cellElements[0], "custom-attr")) { updateAttrViewCellAnimation(item); } - }) + }); if (doOperations.length > 0) { doOperations.push({ action: "doUpdateUpdated", id, data: dayjs().format("YYYYMMDDHHmmss"), - }) + }); undoOperations.push({ action: "doUpdateUpdated", id, data: nodeElement.getAttribute("updated"), - }) + }); transaction(protyle, doOperations, undoOperations); } return text; -} +}; diff --git a/app/src/protyle/render/av/row.ts b/app/src/protyle/render/av/row.ts index e160617a3..60d830e24 100644 --- a/app/src/protyle/render/av/row.ts +++ b/app/src/protyle/render/av/row.ts @@ -90,9 +90,9 @@ export const insertAttrViewBlockAnimation = (blockElement: Element, srcIDs: stri `; }); previousElement.insertAdjacentHTML("afterend", html); - const pageSize = parseInt(blockElement.getAttribute("data-page-size")) + const pageSize = parseInt(blockElement.getAttribute("data-page-size")); if (pageSize) { - const currentCount = blockElement.querySelectorAll(".av__row:not(.av__row--header)").length + const currentCount = blockElement.querySelectorAll(".av__row:not(.av__row--header)").length; if (pageSize < currentCount) { blockElement.setAttribute("data-page-size", currentCount.toString()); } @@ -253,4 +253,4 @@ export const deleteRow = (blockElement: HTMLElement, protyle: IProtyle) => { }); stickyRow(blockElement, protyle.contentElement.getBoundingClientRect(), "all"); updateHeader(blockElement.querySelector(".av__row")); -} +}; diff --git a/app/src/protyle/util/insertHTML.ts b/app/src/protyle/util/insertHTML.ts index a90b90a17..36a4a7edd 100644 --- a/app/src/protyle/util/insertHTML.ts +++ b/app/src/protyle/util/insertHTML.ts @@ -54,10 +54,10 @@ export const insertHTML = (html: string, protyle: IProtyle, isBlock = false, range.deleteContents(); const text = readText(); if (typeof text === "string") { - processAV(range, text, protyle, blockElement) + processAV(range, text, protyle, blockElement); } else { text.then((t) => { - processAV(range, t, protyle, blockElement) + processAV(range, t, protyle, blockElement); }); } return; diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index 180659dca..d9beba869 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -289,8 +289,8 @@ export class WYSIWYG { if (cellElements.length === 0) { nodeElement.querySelectorAll(".av__row--select:not(.av__row--header)").forEach(rowElement => { rowElement.querySelectorAll(".av__cell").forEach(cellElement => { - cellElements.push(cellElement) - }) + cellElements.push(cellElement); + }); }); } cellElements.forEach((item: HTMLElement) => { diff --git a/app/src/search/menu.ts b/app/src/search/menu.ts index 588571205..e3f2e3d2c 100644 --- a/app/src/search/menu.ts +++ b/app/src/search/menu.ts @@ -162,7 +162,7 @@ export const replaceFilterMenu = (config: ISearchOption) => { `; - }) + }); const filterDialog = new Dialog({ title: window.siyuan.languages.type, content: `
${html}