From 2a8f8abc8dfcfbe7e4300e33a904adb241374b2b Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 29 Jan 2024 15:44:18 +0800 Subject: [PATCH] :rotating_light: --- app/src/config/bazaar.ts | 4 ++-- app/src/protyle/export/util.ts | 2 +- app/src/protyle/gutter/index.ts | 2 +- app/src/protyle/render/av/cell.ts | 2 +- app/src/protyle/render/av/relation.ts | 18 +++++++++--------- app/src/protyle/render/av/render.ts | 2 +- app/src/protyle/util/insertHTML.ts | 6 +++--- app/src/protyle/util/resize.ts | 2 +- app/src/protyle/wysiwyg/index.ts | 2 +- app/src/util/assets.ts | 2 +- app/src/util/upDownHint.ts | 4 ++-- 11 files changed, 23 insertions(+), 23 deletions(-) diff --git a/app/src/config/bazaar.ts b/app/src/config/bazaar.ts index d0bf02ed9..f968cac41 100644 --- a/app/src/config/bazaar.ts +++ b/app/src/config/bazaar.ts @@ -634,7 +634,7 @@ export const bazaar = { } catch (e) { console.error("destroyTheme error: " + e); } - window.siyuan.config.appearance = response.data.appearance + window.siyuan.config.appearance = response.data.appearance; loadAssets(window.siyuan.config.appearance); } else { exportLayout({ @@ -796,7 +796,7 @@ export const bazaar = { } catch (e) { console.error("destroyTheme error: " + e); } - window.siyuan.config.appearance = appearanceResponse.data + window.siyuan.config.appearance = appearanceResponse.data; loadAssets(window.siyuan.config.appearance); } else { exportLayout({ diff --git a/app/src/protyle/export/util.ts b/app/src/protyle/export/util.ts index 3697c4544..d9a963b9f 100644 --- a/app/src/protyle/export/util.ts +++ b/app/src/protyle/export/util.ts @@ -188,7 +188,7 @@ export const exportImage = (id: string) => { item.innerHTML = symbolElements[symbolElements.length - 1].innerHTML; }); previewElement.querySelectorAll(".img img").forEach((item: HTMLImageElement) => { - const imgSrc = item.getAttribute("src") + const imgSrc = item.getAttribute("src"); if (imgSrc.endsWith(".svg")) { fetchGet(item.src, (response: string) => { item.src = `data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(response)))}`; diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.ts index 06f450596..44fd266be 100644 --- a/app/src/protyle/gutter/index.ts +++ b/app/src/protyle/gutter/index.ts @@ -791,7 +791,7 @@ export class Gutter { icon: "iconDatabase", click: () => { openSearchAV("", this.element, (listItemElement) => { - const sourceIds: string[] = [] + const sourceIds: string[] = []; selectsElement.forEach(item => { sourceIds.push(item.getAttribute("data-node-id")); }); diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts index ff81ae6c3..212ae968e 100644 --- a/app/src/protyle/render/av/cell.ts +++ b/app/src/protyle/render/av/cell.ts @@ -549,7 +549,7 @@ export const renderCellAttr = (cellElement: Element, value: IAVCellValue) => { cellElement.setAttribute("data-detached", "true"); } } -} +}; export const renderCell = (cellValue: IAVCellValue) => { let text = ""; diff --git a/app/src/protyle/render/av/relation.ts b/app/src/protyle/render/av/relation.ts index a9accd722..95f7719df 100644 --- a/app/src/protyle/render/av/relation.ts +++ b/app/src/protyle/render/av/relation.ts @@ -235,11 +235,11 @@ const filterItem = (listElement: Element, key: string) => { if (item.textContent.includes(key)) { item.classList.remove("fn__none"); } else { - item.classList.add("fn__none") + item.classList.add("fn__none"); } } - }) -} + }); +}; export const bindRelationEvent = (options: { menuElement: HTMLElement, @@ -290,9 +290,9 @@ export const bindRelationEvent = (options: { const cellRect = options.cellElements[options.cellElements.length - 1].getBoundingClientRect(); setPosition(options.menuElement, cellRect.left, cellRect.bottom, cellRect.height); options.menuElement.querySelector(".b3-menu__items .b3-menu__item").classList.add("b3-menu__item--current"); - const inputElement = options.menuElement.querySelector("input") + const inputElement = options.menuElement.querySelector("input"); inputElement.focus(); - const listElement = options.menuElement.querySelector(".b3-menu__items") + const listElement = options.menuElement.querySelector(".b3-menu__items"); inputElement.addEventListener("keydown", (event) => { event.stopPropagation(); if (event.isComposing) { @@ -309,18 +309,18 @@ export const bindRelationEvent = (options: { event.preventDefault(); event.stopPropagation(); } - }) + }); inputElement.addEventListener("input", (event: InputEvent) => { if (event.isComposing) { return; } filterItem(listElement, inputElement.value); event.stopPropagation(); - }) + }); inputElement.addEventListener("compositionend", (event) => { event.stopPropagation(); filterItem(listElement, inputElement.value); - }) + }); }); }; @@ -397,7 +397,7 @@ export const setRelationCell = (protyle: IProtyle, nodeElement: HTMLElement, tar separatorElement.insertAdjacentHTML("afterend", genSelectItemHTML("empty")); } } - menuElement.firstElementChild.classList.add("b3-menu__item--current") + menuElement.firstElementChild.classList.add("b3-menu__item--current"); } updateCellsValue(protyle, nodeElement, newValue, cellElements); }; diff --git a/app/src/protyle/render/av/render.ts b/app/src/protyle/render/av/render.ts index f934febe8..9e6ca1f14 100644 --- a/app/src/protyle/render/av/render.ts +++ b/app/src/protyle/render/av/render.ts @@ -131,7 +131,7 @@ style="width: ${index === 0 ? ((parseInt(column.width || "200") + 24) + "px") : return; } // https://github.com/siyuan-note/siyuan/issues/10262 - let checkClass = "" + let checkClass = ""; if (cell.valueType === "checkbox") { checkClass = cell.value?.checkbox?.checked ? " av__cell-check" : " av__cell-uncheck"; } diff --git a/app/src/protyle/util/insertHTML.ts b/app/src/protyle/util/insertHTML.ts index f8fc576fe..4f879bb0d 100644 --- a/app/src/protyle/util/insertHTML.ts +++ b/app/src/protyle/util/insertHTML.ts @@ -34,7 +34,7 @@ const processAV = (range: Range, html: string, protyle: IProtyle, blockElement: const avID = blockElement.dataset.avId; const id = blockElement.dataset.nodeId; cellElements.forEach((item: HTMLElement, elementIndex) => { - let cellValue: IAVCellValue = values[elementIndex] + let cellValue: IAVCellValue = values[elementIndex]; if (!cellValue) { return; } @@ -60,7 +60,7 @@ const processAV = (range: Range, html: string, protyle: IProtyle, blockElement: // 类型不能转换时就不进行替换 return; } - const content = cellValue[cellValue.type as "text"].content + const content = cellValue[cellValue.type as "text"].content; if (!content) { return; } @@ -110,7 +110,7 @@ const processAV = (range: Range, html: string, protyle: IProtyle, blockElement: } return; } catch (e) { - console.warn("insert cell: JSON.parse error") + console.warn("insert cell: JSON.parse error"); } } const text = protyle.lute.BlockDOM2EscapeMarkerContent(html); diff --git a/app/src/protyle/util/resize.ts b/app/src/protyle/util/resize.ts index ec352afc6..c7678238b 100644 --- a/app/src/protyle/util/resize.ts +++ b/app/src/protyle/util/resize.ts @@ -6,7 +6,7 @@ import {lineNumberRender} from "../render/highlightRender"; import {stickyRow} from "../render/av/row"; export const resize = (protyle: IProtyle) => { - hideElements(["gutterOnly"], protyle) + hideElements(["gutterOnly"], protyle); const abs = setPadding(protyle); const MIN_ABS = 4; // 不能 clearTimeout,否则 split 时左侧无法 resize diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index 926ce2dd3..0531dca70 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -1301,7 +1301,7 @@ export class WYSIWYG { } } else if (selectAVElement) { const cellsValue = updateCellsValue(protyle, nodeElement); - html = JSON.stringify(cellsValue.json) + html = JSON.stringify(cellsValue.json); textPlain = cellsValue.text; } else { const id = nodeElement.getAttribute("data-node-id"); diff --git a/app/src/util/assets.ts b/app/src/util/assets.ts index 61befc1db..563e32794 100644 --- a/app/src/util/assets.ts +++ b/app/src/util/assets.ts @@ -315,7 +315,7 @@ export const setMode = (modeElementValue: number) => { const updateMobileTheme = (OSTheme: string) => { if (isInIOS() || isInAndroid()) { setTimeout(() => { - const backgroundColor = getComputedStyle(document.body).getPropertyValue("--b3-theme-background").trim(); + const backgroundColor = getComputedStyle(document.body).getPropertyValue("--b3-theme-background").trim().replace(" ", ""); let mode = window.siyuan.config.appearance.mode; if (window.siyuan.config.appearance.modeOS) { if (OSTheme === "dark") { diff --git a/app/src/util/upDownHint.ts b/app/src/util/upDownHint.ts index 2e2d364fe..83e613376 100644 --- a/app/src/util/upDownHint.ts +++ b/app/src/util/upDownHint.ts @@ -1,6 +1,6 @@ const isNormalItem = (currentHintElement: HTMLElement, className: string) => { - return currentHintElement.classList.contains("fn__none") || !currentHintElement.classList.contains(className) -} + return currentHintElement.classList.contains("fn__none") || !currentHintElement.classList.contains(className); +}; export const upDownHint = (listElement: Element, event: KeyboardEvent, classActiveName = "b3-list-item--focus") => { let currentHintElement: HTMLElement = listElement.querySelector("." + classActiveName);