From da24409e9683455e467e47d729304d275fd51992 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Fri, 28 Apr 2023 22:13:55 +0800 Subject: [PATCH] :rotating_light: --- app/src/card/newCardTab.ts | 4 ++-- app/src/card/openCard.ts | 2 +- app/src/editor/util.ts | 2 +- app/src/layout/util.ts | 22 ++++++++++++---------- app/src/mobile/util/setEmpty.ts | 15 ++++++++------- app/src/protyle/hint/extend.ts | 6 +++--- app/src/protyle/hint/index.ts | 2 +- app/src/util/functions.ts | 2 +- 8 files changed, 29 insertions(+), 26 deletions(-) diff --git a/app/src/card/newCardTab.ts b/app/src/card/newCardTab.ts index 246ee7505..1ee21a27f 100644 --- a/app/src/card/newCardTab.ts +++ b/app/src/card/newCardTab.ts @@ -66,5 +66,5 @@ export const newCardModel = (options: { }); } }); - return custom -} + return custom; +}; diff --git a/app/src/card/openCard.ts b/app/src/card/openCard.ts index 1270708e9..53d7f1753 100644 --- a/app/src/card/openCard.ts +++ b/app/src/card/openCard.ts @@ -21,7 +21,7 @@ export const genCardHTML = (options: { blocks: ICard[], isTab: boolean }) => { - let iconsHTML:string + let iconsHTML:string; /// #if MOBILE iconsHTML=`
diff --git a/app/src/editor/util.ts b/app/src/editor/util.ts index f981970f1..9e8840fa9 100644 --- a/app/src/editor/util.ts +++ b/app/src/editor/util.ts @@ -1,7 +1,7 @@ import {Tab} from "../layout/Tab"; import {Editor} from "./index"; import {Wnd} from "../layout/Wnd"; -import {getDockByType, getInstanceById, getWndByLayout, pdfIsLoading, resizeTabs, setPanelFocus} from "../layout/util"; +import {getDockByType, getInstanceById, getWndByLayout, pdfIsLoading, setPanelFocus} from "../layout/util"; import {getAllModels, getAllTabs} from "../layout/getAll"; import {highlightById, scrollCenter} from "../util/highlightById"; import {getDisplayName, pathPosix} from "../util/pathName"; diff --git a/app/src/layout/util.ts b/app/src/layout/util.ts index 1831ce13c..453c946cb 100644 --- a/app/src/layout/util.ts +++ b/app/src/layout/util.ts @@ -35,7 +35,7 @@ import {getIdZoomInByPath} from "../util/pathName"; import {openHistory} from "../history/history"; import {Custom} from "./dock/Custom"; import {newCardModel} from "../card/newCardTab"; -import {openRecentDocs} from "../business/openRecentDocs"; +import { openRecentDocs } from "../business/openRecentDocs"; export const setPanelFocus = (element: Element) => { if (element.classList.contains("layout__tab--active") || element.classList.contains("layout__wnd--active")) { @@ -799,6 +799,8 @@ export const newCenterEmptyTab = () => {
${window.siyuan.languages.slogan}
+

${window.siyuan.languages.noOpenFile}

+
@@ -836,7 +838,7 @@ export const newCenterEmptyTab = () => { if (target.id === "editorEmptySearch") { openSearch(window.siyuan.config.keymap.general.globalSearch.custom); event.stopPropagation(); - event.preventDefault() + event.preventDefault(); break; } else if (target.id === "editorEmptyRecent") { const openRecentDocsDialog = window.siyuan.dialogs.find(item => { @@ -850,32 +852,32 @@ export const newCenterEmptyTab = () => { } openRecentDocs(); event.stopPropagation(); - event.preventDefault() + event.preventDefault(); break; }else if (target.id === "editorEmptyHistory") { openHistory(); event.stopPropagation(); - event.preventDefault() + event.preventDefault(); break; }else if (target.id === "editorEmptyFile") { newFile(undefined, undefined, undefined, true); event.stopPropagation(); - event.preventDefault() + event.preventDefault(); break; }else if (target.id === "editorEmptyNewNotebook") { newNotebook(); event.stopPropagation(); - event.preventDefault() + event.preventDefault(); break; }else if (target.id === "editorEmptyHelp") { - mountHelp() + mountHelp(); event.stopPropagation(); - event.preventDefault() + event.preventDefault(); break; } - target = target.parentElement + target = target.parentElement; } - }) + }); } }); }; diff --git a/app/src/mobile/util/setEmpty.ts b/app/src/mobile/util/setEmpty.ts index 7fa95fb2f..d96c4ee5e 100644 --- a/app/src/mobile/util/setEmpty.ts +++ b/app/src/mobile/util/setEmpty.ts @@ -14,7 +14,8 @@ export const setEmpty = () => { if (emptyElement.innerHTML !== "") { return; } - emptyElement.innerHTML = ` + emptyElement.innerHTML = `

${window.siyuan.languages.noOpenFile}

+
${window.siyuan.languages.search}
@@ -39,17 +40,17 @@ export const setEmpty = () => { if (target.id === "emptySearch") { popSearch(); event.stopPropagation(); - event.preventDefault() + event.preventDefault(); break; } else if (target.id === "emptyRecent") { getRecentDocs(); event.stopPropagation(); - event.preventDefault() + event.preventDefault(); break; } else if (target.id === "emptyHistory") { openHistory(); event.stopPropagation(); - event.preventDefault() + event.preventDefault(); break; } else if (target.id === "emptyNewFile") { if (window.siyuan.mobile.editor) { @@ -63,17 +64,17 @@ export const setEmpty = () => { }); } event.stopPropagation(); - event.preventDefault() + event.preventDefault(); break; } else if (target.id === "emptyNewNotebook") { newNotebook(); event.stopPropagation(); - event.preventDefault() + event.preventDefault(); break; } else if (target.id === "emptyHelp") { mountHelp(); event.stopPropagation(); - event.preventDefault() + event.preventDefault(); break; } target = target.parentElement; diff --git a/app/src/protyle/hint/extend.ts b/app/src/protyle/hint/extend.ts index 661d59f8c..6b0a345d2 100644 --- a/app/src/protyle/hint/extend.ts +++ b/app/src/protyle/hint/extend.ts @@ -36,7 +36,7 @@ export const hintSlash = (key: string, protyle: IProtyle) => { }, { filter: ["引用块", "yinyong", "yy", "block reference"], value: "((", - html: `
${window.siyuan.languages.ref}((
`, + html: `
${window.siyuan.languages.blockRef}((
`, }, { filter: ["嵌入块", "qianrukuai", "qrk", "embed block"], value: "{{", @@ -323,7 +323,7 @@ export const hintRef = (key: string, protyle: IProtyle, isQuick = false): IHintD let iconHTML; if (item.type === "NodeDocument" && item.ial.icon){ iconHTML = unicode2Emoji(item.ial.icon, false, "b3-list-item__graphic popover__block", true); - iconHTML = iconHTML.replace('popover__block"', `popover__block" data-id="${item.id}"`) + iconHTML = iconHTML.replace('popover__block"', `popover__block" data-id="${item.id}"`); } else { iconHTML = ``; } @@ -387,7 +387,7 @@ export const hintEmbed = (key: string, protyle: IProtyle): IHintData[] => { let iconHTML; if (item.type === "NodeDocument" && item.ial.icon){ iconHTML = unicode2Emoji(item.ial.icon, false, "b3-list-item__graphic popover__block", true); - iconHTML = iconHTML.replace('popover__block"', `popover__block" data-id="${item.id}"`) + iconHTML = iconHTML.replace('popover__block"', `popover__block" data-id="${item.id}"`); } else { iconHTML = ``; } diff --git a/app/src/protyle/hint/index.ts b/app/src/protyle/hint/index.ts index e8efff8e7..06eff5de7 100644 --- a/app/src/protyle/hint/index.ts +++ b/app/src/protyle/hint/index.ts @@ -340,7 +340,7 @@ ${unicode2Emoji(emoji.unicode, true)}`; let iconHTML; if (item.type === "NodeDocument" && item.ial.icon) { iconHTML = unicode2Emoji(item.ial.icon, false, "b3-list-item__graphic popover__block", true); - iconHTML = iconHTML.replace('popover__block"', `popover__block" data-id="${item.id}"`) + iconHTML = iconHTML.replace('popover__block"', `popover__block" data-id="${item.id}"`); } else { iconHTML = ``; } diff --git a/app/src/util/functions.ts b/app/src/util/functions.ts index 158a83886..3e5c6a440 100644 --- a/app/src/util/functions.ts +++ b/app/src/util/functions.ts @@ -50,7 +50,7 @@ export const looseJsonParse = (text: string) => { export const objEquals = (a: any, b: any): boolean => { if (a === b) return true; if (a instanceof Date && b instanceof Date) return a.getTime() === b.getTime(); - if (!a || !b || (typeof a !== 'object' && typeof b !== 'object')) return a === b; + if (!a || !b || (typeof a !== "object" && typeof b !== "object")) return a === b; if (a.prototype !== b.prototype) return false; const keys = Object.keys(a); if (keys.length !== Object.keys(b).length) return false;