diff --git a/app/src/emoji/index.ts b/app/src/emoji/index.ts index 232fdf3da..d072c83e3 100644 --- a/app/src/emoji/index.ts +++ b/app/src/emoji/index.ts @@ -201,7 +201,7 @@ export const openEmojiPanel = (id: string, type: "doc" | "notebook" | "av", posi window.siyuan.menus.menu.removeScrollEvent(); } - const dynamicURL = 'api/icon/getDynamicIcon?' + const dynamicURL = "api/icon/getDynamicIcon?"; const dialog = new Dialog({ disableAnimation: true, transparent: true, @@ -555,35 +555,35 @@ ${unicode2Emoji(emoji.unicode)}`; } else { avCB(unicode); } - break + break; } else if (target.getAttribute("data-type")?.startsWith("tab-")) { dialogElement.querySelectorAll('.emojis__tabheader [data-type|="tab"]').forEach((item: HTMLElement) => { if (item.dataset.type === target.dataset.type) { - item.classList.add("block__icon--active") + item.classList.add("block__icon--active"); } else { - item.classList.remove("block__icon--active") + item.classList.remove("block__icon--active"); } - }) - dialogElement.querySelectorAll('.emojis__tabbody > div').forEach((item: HTMLElement) => { + }); + dialogElement.querySelectorAll(".emojis__tabbody > div").forEach((item: HTMLElement) => { if (item.dataset.type === target.dataset.type) { - item.classList.remove("fn__none") + item.classList.remove("fn__none"); } else { - item.classList.add("fn__none") + item.classList.add("fn__none"); } - }) + }); window.siyuan.storage[Constants.LOCAL_EMOJIS].currentTab = target.dataset.type.replace("tab-", ""); setStorageVal(Constants.LOCAL_EMOJIS, window.siyuan.storage[Constants.LOCAL_EMOJIS]); - break + break; } else if (target.classList.contains("color__square")) { dynamicTextElements[0].value = target.getAttribute("style").replace("background-color:", ""); dynamicTextElements[0].style.backgroundColor = dynamicTextElements[0].value; - dynamicTextElements[0].dispatchEvent(new CustomEvent("input")) + dynamicTextElements[0].dispatchEvent(new CustomEvent("input")); break; } target = target.parentElement; } }); - const dynamicLangElements: NodeListOf = dialog.element.querySelectorAll('[data-type="tab-dynamic"] .b3-select') + const dynamicLangElements: NodeListOf = dialog.element.querySelectorAll('[data-type="tab-dynamic"] .b3-select'); dynamicLangElements[0].addEventListener("change", () => { dialog.element.querySelectorAll(".fn__flex-wrap .emoji__dynamic-item").forEach(item => { const url = new URLSearchParams(item.getAttribute("src").replace(dynamicURL, "")); @@ -593,32 +593,32 @@ ${unicode2Emoji(emoji.unicode)}`; url.delete("lang"); } item.setAttribute("src", dynamicURL + url.toString()); - }) + }); }); dynamicLangElements[1].addEventListener("change", () => { dialog.element.querySelectorAll(".fn__flex-wrap .emoji__dynamic-item").forEach(item => { const url = new URLSearchParams(item.getAttribute("src").replace(dynamicURL, "")); url.set("weekdayType", dynamicLangElements[1].value); item.setAttribute("src", dynamicURL + url.toString()); - }) + }); }); - const dynamicDateElement = dialog.element.querySelector('[data-type="tab-dynamic"] [type="date"]') as HTMLInputElement + const dynamicDateElement = dialog.element.querySelector('[data-type="tab-dynamic"] [type="date"]') as HTMLInputElement; dynamicDateElement.addEventListener("change", () => { dialog.element.querySelectorAll(".fn__flex-wrap .emoji__dynamic-item").forEach(item => { const url = new URLSearchParams(item.getAttribute("src").replace(dynamicURL, "")); url.set("date", dynamicDateElement.value ? dayjs(dynamicDateElement.value).format("YYYY-MM-DD") : ""); item.setAttribute("src", dynamicURL + url.toString()); - }) + }); }); - const dynamicTextElements: NodeListOf = dialog.element.querySelectorAll('[data-type="tab-dynamic"] [type="text"]') - const dynamicTextImgElement = dialog.element.querySelector('.emoji__dynamic-item[data-type="text"]') + const dynamicTextElements: NodeListOf = dialog.element.querySelectorAll('[data-type="tab-dynamic"] [type="text"]'); + const dynamicTextImgElement = dialog.element.querySelector('.emoji__dynamic-item[data-type="text"]'); dynamicTextElements[0].addEventListener("input", () => { dialog.element.querySelectorAll(".emoji__dynamic-item").forEach(item => { const url = new URLSearchParams(item.getAttribute("src").replace(dynamicURL, "")); url.set("color", dynamicTextElements[0].value); item.setAttribute("src", dynamicURL + url.toString()); dynamicTextElements[0].style.backgroundColor = dynamicTextElements[0].value; - }) + }); }); dynamicTextElements[1].addEventListener("input", () => { const url = new URLSearchParams(dynamicTextImgElement.getAttribute("src").replace(dynamicURL, "")); diff --git a/app/src/protyle/render/av/render.ts b/app/src/protyle/render/av/render.ts index 1a9f45f7c..d0cd05cd2 100644 --- a/app/src/protyle/render/av/render.ts +++ b/app/src/protyle/render/av/render.ts @@ -4,7 +4,7 @@ import {Constants} from "../../../constants"; import {addDragFill, renderCell} from "./cell"; import {unicode2Emoji} from "../../../emoji"; import {focusBlock} from "../../util/selection"; -import {hasClosestBlock, hasClosestByClassName, isInEmbedBlock} from "../../util/hasClosest"; +import {hasClosestBlock, hasClosestByClassName} from "../../util/hasClosest"; import {stickyRow, updateHeader} from "./row"; import {getCalcValue} from "./calc"; import {renderAVAttribute} from "./blockAttr"; diff --git a/app/src/protyle/toolbar/Font.ts b/app/src/protyle/toolbar/Font.ts index d4471239b..52d4561a8 100644 --- a/app/src/protyle/toolbar/Font.ts +++ b/app/src/protyle/toolbar/Font.ts @@ -223,12 +223,12 @@ export const fontEvent = (protyle: IProtyle, nodeElements: Element[], type?: str e.style.textShadow = ""; e.style.backgroundColor = ""; e.style.fontSize = ""; - e.style.removeProperty("--b3-parent-background") + e.style.removeProperty("--b3-parent-background"); } else if (type === "style1") { const colorList = color.split(Constants.ZWSP); e.style.backgroundColor = colorList[0]; e.style.color = colorList[1]; - e.style.setProperty('--b3-parent-background', colorList[0]); + e.style.setProperty("--b3-parent-background", colorList[0]); } else if (type === "style2") { e.style.webkitTextStroke = "0.2px var(--b3-theme-on-background)"; e.style.webkitTextFillColor = "transparent"; @@ -238,7 +238,7 @@ export const fontEvent = (protyle: IProtyle, nodeElements: Element[], type?: str e.style.color = color; } else if (type === "backgroundColor") { e.style.backgroundColor = color; - e.style.setProperty('--b3-parent-background', color); + e.style.setProperty("--b3-parent-background", color); } else if (type === "fontSize") { e.style.fontSize = color; } diff --git a/app/src/protyle/toolbar/util.ts b/app/src/protyle/toolbar/util.ts index 0df245c89..840b85f08 100644 --- a/app/src/protyle/toolbar/util.ts +++ b/app/src/protyle/toolbar/util.ts @@ -212,4 +212,4 @@ export const toolbarKeyToMenu = (toolbar: Array) => { toolbarResult.push(currentMenuItem); }); return toolbarResult; -} +}; diff --git a/app/src/protyle/util/compatibility.ts b/app/src/protyle/util/compatibility.ts index e11871d61..7d6ae41d9 100644 --- a/app/src/protyle/util/compatibility.ts +++ b/app/src/protyle/util/compatibility.ts @@ -112,7 +112,7 @@ export const isHuawei = () => { export const isDisabledFeature = (feature: string): boolean => { return window.siyuan.config.system.disabledFeatures.indexOf(feature) > -1; -} +}; export const isIPhone = () => { return navigator.userAgent.indexOf("iPhone") > -1;