diff --git a/app/src/card/openCard.ts b/app/src/card/openCard.ts index acc42cb00..0b98bcd42 100644 --- a/app/src/card/openCard.ts +++ b/app/src/card/openCard.ts @@ -12,7 +12,6 @@ import {MenuItem} from "../menus/Menu"; import {escapeHtml} from "../util/escape"; /// #if !MOBILE import {openFile} from "../editor/util"; -import {newCardModel} from "./newCardTab"; /// #endif import {getDisplayName, movePathTo} from "../util/pathName"; import {App} from "../index"; diff --git a/app/src/editor/util.ts b/app/src/editor/util.ts index ad67a3dec..0db465187 100644 --- a/app/src/editor/util.ts +++ b/app/src/editor/util.ts @@ -15,6 +15,7 @@ import {onGet} from "../protyle/util/onGet"; /// #if !BROWSER import {shell} from "electron"; import {BrowserWindow, getCurrentWindow} from "@electron/remote"; +import {newCardModel} from "../card/newCardTab"; /// #endif import {pushBack} from "../util/backForward"; import {Asset} from "../asset"; @@ -28,7 +29,6 @@ import {objEquals} from "../util/functions"; import {resize} from "../protyle/util/resize"; import {Search} from "../search"; import {App} from "../index"; -import {newCardModel} from "../card/newCardTab"; export const openFileById = async (options: { app: App, @@ -444,7 +444,7 @@ const newTab = (options: IOpenFileOptions) => { })); return true; } - }) + }); } } else { // plugin 0.8.3 历史兼容 diff --git a/app/src/layout/dock/util.ts b/app/src/layout/dock/util.ts index 25eb0d0a6..4cb2bfc31 100644 --- a/app/src/layout/dock/util.ts +++ b/app/src/layout/dock/util.ts @@ -118,4 +118,4 @@ export const toggleDockBar = (useElement:Element)=> { }); resizeTabs(); resetFloatDockSize(); -} +}; diff --git a/app/src/layout/status.ts b/app/src/layout/status.ts index df03ea8fb..ac1dd1d9e 100644 --- a/app/src/layout/status.ts +++ b/app/src/layout/status.ts @@ -1,5 +1,5 @@ /// #if !MOBILE -import {getDockByType, resizeTabs} from "./util"; +import {getDockByType} from "./util"; import {hasClosestByClassName} from "../protyle/util/hasClosest"; import {fetchPost} from "../util/fetch"; import {mountHelp} from "../util/mount"; diff --git a/app/src/menus/Menu.ts b/app/src/menus/Menu.ts index 3afe8a298..c72e0509e 100644 --- a/app/src/menus/Menu.ts +++ b/app/src/menus/Menu.ts @@ -308,7 +308,7 @@ export const bindMenuKeydown = (event: KeyboardEvent) => { if (!currentElement) { return true; } - const parentItemElement = hasClosestByClassName(currentElement, "b3-menu__item--show") + const parentItemElement = hasClosestByClassName(currentElement, "b3-menu__item--show"); if (parentItemElement) { parentItemElement.classList.remove("b3-menu__item--show"); parentItemElement.classList.add("b3-menu__item--current"); diff --git a/app/src/plugin/index.ts b/app/src/plugin/index.ts index 08ddc8264..b289b5ac2 100644 --- a/app/src/plugin/index.ts +++ b/app/src/plugin/index.ts @@ -4,13 +4,13 @@ import {fetchPost} from "../util/fetch"; import {isMobile, isWindow} from "../util/functions"; /// #if !MOBILE import {Custom} from "../layout/dock/Custom"; +import {getAllModels} from "../layout/getAll"; /// #endif import {Tab} from "../layout/Tab"; import {getDockByType, setPanelFocus} from "../layout/util"; import {hasClosestByAttribute} from "../protyle/util/hasClosest"; import {BlockPanel} from "../block/Panel"; import {Setting} from "./Setting"; -import {getAllModels} from "../layout/getAll"; export class Plugin { private app: App; @@ -182,16 +182,18 @@ export class Plugin { } public getOpenedTab() { - const tabs: { [key: string]: Custom[] } = {} - const modelKeys = Object.keys(this.models) + const tabs: { [key: string]: Custom[] } = {}; + const modelKeys = Object.keys(this.models); modelKeys.forEach(item => { - tabs[item.replace(this.name, "")] = [] - }) + tabs[item.replace(this.name, "")] = []; + }); + /// #if !MOBILE getAllModels().custom.find(item => { if (modelKeys.includes(item.type)) { tabs[item.type.replace(this.name, "")].push(item); } - }) + }); + /// #endif return tabs; } diff --git a/app/src/protyle/util/compatibility.ts b/app/src/protyle/util/compatibility.ts index 38be59ba7..5ff3c40c2 100644 --- a/app/src/protyle/util/compatibility.ts +++ b/app/src/protyle/util/compatibility.ts @@ -159,8 +159,8 @@ export const getLocalStorage = (cb: () => void) => { k: "", }; Constants.SIYUAN_ASSETS_SEARCH.forEach(type => { - defaultStorage[Constants.LOCAL_SEARCHASSET].types[type] = true - }) + defaultStorage[Constants.LOCAL_SEARCHASSET].types[type] = true; + }); defaultStorage[Constants.LOCAL_SEARCHKEYS] = { keys: [], replaceKeys: [], diff --git a/app/src/search/assets.ts b/app/src/search/assets.ts index 1892d8ee0..c4be087f6 100644 --- a/app/src/search/assets.ts +++ b/app/src/search/assets.ts @@ -407,7 +407,7 @@ export const assetMoreMenu = (target: Element, element: Element, cb: () => void) } window.siyuan.menus.menu.remove(); window.siyuan.menus.menu.element.setAttribute("data-name", "searchAssetMore"); - const localData = window.siyuan.storage[Constants.LOCAL_SEARCHASSET] + const localData = window.siyuan.storage[Constants.LOCAL_SEARCHASSET]; const sortMenu = [{ iconHTML: Constants.ZWSP, label: window.siyuan.languages.sortByRankAsc, @@ -457,7 +457,7 @@ export const assetMoreMenu = (target: Element, element: Element, cb: () => void) current: localData.layout === 0, click() { element.querySelector(".search__layout").classList.remove("search__layout--row"); - const previewElement = element.querySelector("#searchAssetPreview") as HTMLElement + const previewElement = element.querySelector("#searchAssetPreview") as HTMLElement; previewElement.style.width = ""; if (localData.row) { previewElement.style.height = localData.row; @@ -473,11 +473,11 @@ export const assetMoreMenu = (target: Element, element: Element, cb: () => void) label: window.siyuan.languages.leftRightLayout, current: localData.layout === 1, click() { - const previewElement = element.querySelector("#searchAssetPreview") as HTMLElement + const previewElement = element.querySelector("#searchAssetPreview") as HTMLElement; element.querySelector(".search__layout").classList.add("search__layout--row"); previewElement.style.height = ""; if (localData.col) { - previewElement.style.width = localData.col + previewElement.style.width = localData.col; previewElement.classList.remove("fn__flex-1"); } else { previewElement.classList.add("fn__flex-1"); @@ -493,10 +493,10 @@ export const assetMoreMenu = (target: Element, element: Element, cb: () => void) click() { element.nextElementSibling.classList.remove("fn__none"); fetchPost("/api/asset/fullReindexAssetContent", {}, () => { - assetInputEvent(element, localData) + assetInputEvent(element, localData); }); }, }).element); const rect = target.getBoundingClientRect(); window.siyuan.menus.menu.popup({x: rect.right, y: rect.bottom}, true); -} +}; diff --git a/app/src/search/util.ts b/app/src/search/util.ts index 6f4725918..011bec46b 100644 --- a/app/src/search/util.ts +++ b/app/src/search/util.ts @@ -640,7 +640,7 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo assetMoreMenu(target, assetsElement, () => { assetInputEvent(assetsElement); setStorageVal(Constants.LOCAL_SEARCHASSET, window.siyuan.storage[Constants.LOCAL_SEARCHASSET]); - }) + }); event.stopPropagation(); event.preventDefault(); break;