diff --git a/app/src/ai/actions.ts b/app/src/ai/actions.ts index 0aea42ec0..8de2287c2 100644 --- a/app/src/ai/actions.ts +++ b/app/src/ai/actions.ts @@ -81,7 +81,7 @@ const editDialog = (customName: string, customMemo: string) => { dialog.destroy(); }); nameElement.focus(); -} +}; const customDialog = (protyle: IProtyle, ids: string[], elements: Element[]) => { const dialog = new Dialog({ @@ -134,7 +134,7 @@ const customDialog = (protyle: IProtyle, ids: string[], elements: Element[]) => dialog.destroy(); }); nameElement.focus(); -} +}; const filterAI = (element: HTMLElement, inputElement: HTMLInputElement) => { element.querySelectorAll(".b3-list-item").forEach(item => { @@ -143,17 +143,17 @@ const filterAI = (element: HTMLElement, inputElement: HTMLInputElement) => { } else { item.classList.add("fn__none"); } - }) - element.querySelectorAll('.b3-menu__separator').forEach(item => { + }); + element.querySelectorAll(".b3-menu__separator").forEach(item => { if (inputElement.value) { item.classList.add("fn__none"); } else { item.classList.remove("fn__none"); } - }) + }); element.querySelector(".b3-list-item--focus").classList.remove("b3-list-item--focus"); element.querySelector(".b3-list-item:not(.fn__none)").classList.add("b3-list-item--focus"); -} +}; export const AIActions = (elements: Element[], protyle: IProtyle) => { window.siyuan.menus.menu.remove(); @@ -164,7 +164,7 @@ export const AIActions = (elements: Element[], protyle: IProtyle) => { const menu = new Menu("ai", () => { focusByRange(protyle.toolbar.range); }); - let customHTML = "" + let customHTML = ""; window.siyuan.storage[Constants.LOCAL_AI].forEach((item: { name: string, memo: string }) => { customHTML += `
${escapeHtml(item.name)} @@ -258,7 +258,7 @@ export const AIActions = (elements: Element[], protyle: IProtyle) => { }); inputElement.addEventListener("compositionend", () => { filterAI(element, inputElement); - }) + }); inputElement.addEventListener("input", (event: KeyboardEvent) => { if (event.isComposing) { return; diff --git a/app/src/config/ai.ts b/app/src/config/ai.ts index 2c8d7e1d8..2751d4f2f 100644 --- a/app/src/config/ai.ts +++ b/app/src/config/ai.ts @@ -160,12 +160,12 @@ export const ai = {
`; }, bindEvent: () => { - const togglePassword = ai.element.querySelector('.b3-form__icona-icon[data-action="togglePassword"]') + const togglePassword = ai.element.querySelector('.b3-form__icona-icon[data-action="togglePassword"]'); togglePassword.addEventListener("click", () => { const isEye = togglePassword.firstElementChild.getAttribute("xlink:href") === "#iconEye"; togglePassword.firstElementChild.setAttribute("xlink:href", isEye ? "#iconEyeoff" : "#iconEye"); togglePassword.previousElementSibling.setAttribute("type", isEye ? "text" : "password"); - }) + }); ai.element.querySelectorAll("input, select").forEach((item) => { item.addEventListener("change", () => { fetchPost("/api/setting/setAI", { diff --git a/app/src/protyle/render/av/filter.ts b/app/src/protyle/render/av/filter.ts index 0e065a2d3..cac63620d 100644 --- a/app/src/protyle/render/av/filter.ts +++ b/app/src/protyle/render/av/filter.ts @@ -140,9 +140,9 @@ export const setFilter = async (options: { contents: [newValue], }, type: "rollup" - } + }; } else { - newFilter.value = newValue + newFilter.value = newValue; } let isSame = false; options.data.view.filters.find((filter, index) => { @@ -225,7 +225,7 @@ export const setFilter = async (options: { type: filterValue.type }; } else { - filterValue = item.value.rollup.contents[0] + filterValue = item.value.rollup.contents[0]; } return true; } diff --git a/app/src/protyle/render/av/openMenuPanel.ts b/app/src/protyle/render/av/openMenuPanel.ts index c83bd7f13..4f229c57b 100644 --- a/app/src/protyle/render/av/openMenuPanel.ts +++ b/app/src/protyle/render/av/openMenuPanel.ts @@ -366,10 +366,10 @@ export const openMenuPanel = (options: { } targetElement.classList.remove("dragover__bottom", "dragover__top"); const blockIDs: string[] = []; - const contents: IAVCellValue[] = [] + const contents: IAVCellValue[] = []; targetElement.parentElement.querySelectorAll(".fn__grab").forEach(item => { - const dateElement = item.nextElementSibling as HTMLElement - blockIDs.push(dateElement.dataset.id) + const dateElement = item.nextElementSibling as HTMLElement; + blockIDs.push(dateElement.dataset.id); contents.push({ isDetached: !dateElement.style.color, type: "block", @@ -377,8 +377,8 @@ export const openMenuPanel = (options: { content: dateElement.textContent, id: dateElement.dataset.id } - }) - }) + }); + }); updateCellsValue(options.protyle, options.blockElement as HTMLElement, { blockIDs, contents, diff --git a/app/src/protyle/render/av/relation.ts b/app/src/protyle/render/av/relation.ts index 89357b11d..dc3c0353f 100644 --- a/app/src/protyle/render/av/relation.ts +++ b/app/src/protyle/render/av/relation.ts @@ -237,11 +237,11 @@ const filterItem = (menuElement: Element, cellElement: HTMLElement, keyword: str const cells = response.data.rows.values as IAVCellValue[] || []; let html = ""; let selectHTML = ""; - const hasIds: string[] = [] + const hasIds: string[] = []; cellElement.querySelectorAll("span").forEach((item) => { hasIds.push(item.dataset.id); selectHTML += ``; - }) + }); cells.forEach((item) => { if (!hasIds.includes(item.block.id)) { html += genSelectItemHTML("unselect", item.block.id, item.isDetached, item.block.content || "Untitled"); @@ -267,11 +267,11 @@ export const bindRelationEvent = (options: { const cells = response.data.rows.values as IAVCellValue[] || []; let html = ""; let selectHTML = ""; - const hasIds: string[] = [] + const hasIds: string[] = []; options.cellElements[0].querySelectorAll("span").forEach((item) => { hasIds.push(item.dataset.id); selectHTML += ``; - }) + }); cells.forEach((item) => { if (!hasIds.includes(item.block.id)) { html += genSelectItemHTML("unselect", item.block.id, item.isDetached, item.block.content || "Untitled"); diff --git a/app/src/protyle/render/av/render.ts b/app/src/protyle/render/av/render.ts index 94d481e6d..4ebc80f12 100644 --- a/app/src/protyle/render/av/render.ts +++ b/app/src/protyle/render/av/render.ts @@ -79,10 +79,10 @@ export const avRender = (element: Element, protyle: IProtyle, cb?: () => void, v if (!hasFilter) { data.filters.find(filterItem => { if (filterItem.value.type === item.type && item.id === filterItem.column) { - hasFilter = true - return true + hasFilter = true; + return true; } - }) + }); } if (!item.hidden) { if (item.pin) { diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts index 374a53b0b..89aee5717 100644 --- a/app/src/protyle/wysiwyg/keydown.ts +++ b/app/src/protyle/wysiwyg/keydown.ts @@ -1412,7 +1412,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => { if (selectsElement.length === 0) { selectsElement = [nodeElement]; } - AIActions(selectsElement, protyle) + AIActions(selectsElement, protyle); return; }