diff --git a/app/src/config/appearance.ts b/app/src/config/appearance.ts index b9964f8af..5720ef0bd 100644 --- a/app/src/config/appearance.ts +++ b/app/src/config/appearance.ts @@ -344,14 +344,14 @@ export const appearance = { ipcRenderer.send(Constants.SIYUAN_CONFIG_CLOSE, data.closeButtonBehavior); /// #endif loadAssets(data); - const modeElement = document.getElementById("barThemeMode") + const modeElement = document.getElementById("barThemeMode"); if (modeElement) { if (data.mode === 1) { modeElement.classList.add("toolbar__item--active"); - modeElement.setAttribute("aria-label", window.siyuan.languages.themeLight) + modeElement.setAttribute("aria-label", window.siyuan.languages.themeLight); } else { modeElement.classList.remove("toolbar__item--active"); - modeElement.setAttribute("aria-label", window.siyuan.languages.themeDark) + modeElement.setAttribute("aria-label", window.siyuan.languages.themeDark); } } } diff --git a/app/src/layout/dock/Files.ts b/app/src/layout/dock/Files.ts index c187c647b..4be42750e 100644 --- a/app/src/layout/dock/Files.ts +++ b/app/src/layout/dock/Files.ts @@ -552,7 +552,7 @@ export class Files extends Model { targetElement.querySelector(".b3-list-item__toggle").classList.remove("fn__hidden"); const emojiElement = targetElement.querySelector(".b3-list-item__icon"); if (emojiElement.innerHTML === unicode2Emoji(Constants.SIYUAN_IMAGE_FILE)) { - emojiElement.innerHTML = unicode2Emoji(Constants.SIYUAN_IMAGE_FOLDER) + emojiElement.innerHTML = unicode2Emoji(Constants.SIYUAN_IMAGE_FOLDER); } if (targetElement.nextElementSibling && targetElement.nextElementSibling.tagName === "UL") { targetElement.nextElementSibling.remove(); diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts index 03fe68dc3..795780879 100644 --- a/app/src/menus/protyle.ts +++ b/app/src/menus/protyle.ts @@ -400,7 +400,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme } else if (window.siyuan.config.editor.displayNetImgMark) { assetElement.querySelector(".protyle-action__drag").insertAdjacentHTML("afterend", ''); } - nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss")) + nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss")); updateTransaction(protyle, id, nodeElement.outerHTML, html); html = nodeElement.outerHTML; }); @@ -419,7 +419,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme assetElement.style.maxWidth = (imgElement.clientWidth + 10) + "px"; }); inputElement.addEventListener("change", () => { - nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss")) + nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss")); updateTransaction(protyle, id, nodeElement.outerHTML, html); html = nodeElement.outerHTML; }); @@ -432,7 +432,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme inputElement.value = imgElement.getAttribute("alt") || ""; inputElement.addEventListener("change", (event) => { imgElement.setAttribute("alt", (event.target as HTMLInputElement).value); - nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss")) + nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss")); updateTransaction(protyle, id, nodeElement.outerHTML, html); html = nodeElement.outerHTML; }); @@ -476,7 +476,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme click() { writeText(protyle.lute.BlockDOM2Md(assetElement.outerHTML)); (assetElement as HTMLElement).outerHTML = ""; - nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss")) + nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss")); updateTransaction(protyle, id, nodeElement.outerHTML, html); focusByWbr(protyle.wysiwyg.element, range); } @@ -487,7 +487,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme label: window.siyuan.languages.delete, click: function () { (assetElement as HTMLElement).outerHTML = ""; - nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss")) + nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss")); updateTransaction(protyle, id, nodeElement.outerHTML, html); focusByWbr(protyle.wysiwyg.element, range); } @@ -498,7 +498,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme label: window.siyuan.languages.alignCenter, accelerator: window.siyuan.config.keymap.editor.general.alignCenter.custom, click() { - nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss")) + nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss")); assetElement.style.display = "block"; updateTransaction(protyle, id, nodeElement.outerHTML, html); } @@ -508,7 +508,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme label: window.siyuan.languages.alignLeft, accelerator: window.siyuan.config.keymap.editor.general.alignLeft.custom, click() { - nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss")) + nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss")); assetElement.style.display = ""; updateTransaction(protyle, id, nodeElement.outerHTML, html); } @@ -536,7 +536,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme rangeElement.parentElement.setAttribute("aria-label", `${rangeElement.value}%`); }); rangeElement.addEventListener("change", () => { - nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss")) + nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss")); updateTransaction(protyle, id, nodeElement.outerHTML, html); window.siyuan.menus.menu.remove(); focusBlock(nodeElement); @@ -685,7 +685,7 @@ const genImageWidthMenu = (label: string, assetElement: HTMLElement, imgElement: return { label, click() { - nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss")) + nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss")); assetElement.style.width = label === window.siyuan.languages.default ? "" : label; imgElement.style.width = label === window.siyuan.languages.default ? "" : "10000px"; assetElement.style.maxWidth = label === window.siyuan.languages.default ? (imgElement.clientWidth + 10) + "px" : ""; diff --git a/app/src/mobile/util/MobileFiles.ts b/app/src/mobile/util/MobileFiles.ts index e1cf297a4..5d523576c 100644 --- a/app/src/mobile/util/MobileFiles.ts +++ b/app/src/mobile/util/MobileFiles.ts @@ -438,7 +438,7 @@ export class MobileFiles extends Model { targetElement.querySelector(".b3-list-item__toggle").classList.remove("fn__hidden"); const emojiElement = targetElement.querySelector(".b3-list-item__icon"); if (emojiElement.innerHTML === unicode2Emoji(Constants.SIYUAN_IMAGE_FILE)) { - emojiElement.innerHTML = unicode2Emoji(Constants.SIYUAN_IMAGE_FOLDER) + emojiElement.innerHTML = unicode2Emoji(Constants.SIYUAN_IMAGE_FOLDER); } if (targetElement.nextElementSibling && targetElement.nextElementSibling.tagName === "UL") { targetElement.nextElementSibling.remove(); diff --git a/app/src/protyle/header/Title.ts b/app/src/protyle/header/Title.ts index c28819bb9..d2193f480 100644 --- a/app/src/protyle/header/Title.ts +++ b/app/src/protyle/header/Title.ts @@ -1,9 +1,7 @@ import { focusBlock, - focusByOffset, focusByRange, getEditorRange, - getSelectionOffset, } from "../util/selection"; import {fetchPost} from "../../util/fetch"; import {replaceFileName, validateName} from "../../editor/rename"; diff --git a/app/src/protyle/wysiwyg/commonHotkey.ts b/app/src/protyle/wysiwyg/commonHotkey.ts index 300750a5b..e1c268d5b 100644 --- a/app/src/protyle/wysiwyg/commonHotkey.ts +++ b/app/src/protyle/wysiwyg/commonHotkey.ts @@ -9,7 +9,7 @@ import {Constants} from "../../constants"; import {onGet} from "../util/onGet"; export const commonHotkey = (protyle: IProtyle, event: KeyboardEvent) => { - const target = event.target as HTMLElement + const target = event.target as HTMLElement; if (matchHotKey(window.siyuan.config.keymap.editor.general.copyHPath.custom, event)) { fetchPost("/api/filetree/getHPathByID", { id: protyle.block.rootID @@ -65,4 +65,4 @@ export const commonHotkey = (protyle: IProtyle, event: KeyboardEvent) => { return true; } } -} +}; diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts index 7dd8852c4..4144a6cb4 100644 --- a/app/src/protyle/wysiwyg/keydown.ts +++ b/app/src/protyle/wysiwyg/keydown.ts @@ -21,7 +21,6 @@ import { isNotEditBlock, } from "./getBlock"; import {matchHotKey} from "../util/hotKey"; -import {fullscreen} from "../breadcrumb/action"; import {enter} from "./enter"; import {fixTable} from "../util/table"; import {phTransaction, transaction, turnsIntoTransaction, updateTransaction} from "./transaction"; @@ -39,7 +38,6 @@ import {setPosition} from "../../util/setPosition"; import {removeEmbed} from "./removeEmbed"; import {openAttr} from "../../menus/commonMenuItem"; import {Constants} from "../../constants"; -import {addLoading, setPadding} from "../ui/initUI"; import {preventScroll} from "../scroll/preventScroll"; import {bindMenuKeydown} from "../../menus/Menu"; import {fetchPost} from "../../util/fetch"; diff --git a/app/src/util/newFile.ts b/app/src/util/newFile.ts index e1455a1aa..633404b06 100644 --- a/app/src/util/newFile.ts +++ b/app/src/util/newFile.ts @@ -8,7 +8,6 @@ import {getDisplayName, getOpenNotebookCount, pathPosix} from "./pathName"; import {openFileById} from "../editor/util"; import {Constants} from "../constants"; import {isMobile} from "./functions"; -import {openMobileFileById} from "../mobile/editor"; export const newFile = (notebookId?: string, currentPath?: string, open?: boolean) => { if (getOpenNotebookCount() === 0) { diff --git a/app/src/util/onGetConfig.ts b/app/src/util/onGetConfig.ts index 5a67ebaae..f1b2b5035 100644 --- a/app/src/util/onGetConfig.ts +++ b/app/src/util/onGetConfig.ts @@ -224,10 +224,10 @@ const initBar = () => { } if (barThemeModeElement.classList.contains("toolbar__item--active")) { barThemeModeElement.classList.remove("toolbar__item--active"); - barThemeModeElement.setAttribute("aria-label", window.siyuan.languages.themeDark) + barThemeModeElement.setAttribute("aria-label", window.siyuan.languages.themeDark); } else { barThemeModeElement.classList.add("toolbar__item--active"); - barThemeModeElement.setAttribute("aria-label", window.siyuan.languages.themeLight) + barThemeModeElement.setAttribute("aria-label", window.siyuan.languages.themeLight); } barThemeModeElement.setAttribute("disabled", "disabled"); fetchPost("/api/system/setAppearanceMode", {