diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json index 4a5b278c3..b340411be 100644 --- a/app/appearance/langs/zh_CN.json +++ b/app/appearance/langs/zh_CN.json @@ -1,4 +1,5 @@ { + "compare": "比较", "switchTab": "页签切换", "recentDocs": "最近打开的文档", "autoLaunch": "开机自动启动", diff --git a/app/src/history/diff.ts b/app/src/history/diff.ts new file mode 100644 index 000000000..517a880ac --- /dev/null +++ b/app/src/history/diff.ts @@ -0,0 +1,3 @@ +export const showDiff = () => { + +} diff --git a/app/src/util/history.ts b/app/src/history/history.ts similarity index 93% rename from app/src/util/history.ts rename to app/src/history/history.ts index 6081350da..06ba0231b 100644 --- a/app/src/util/history.ts +++ b/app/src/history/history.ts @@ -1,14 +1,14 @@ import {Dialog} from "../dialog"; import {confirmDialog} from "../dialog/confirmDialog"; -import {fetchPost} from "./fetch"; import {Constants} from "../constants"; -import {escapeHtml} from "./escape"; -import {isMobile} from "./functions"; import {hasClosestByClassName} from "../protyle/util/hasClosest"; import {renderAssetsPreview} from "../asset/renderAssets"; import {Protyle} from "../protyle"; import {disabledProtyle, onGet} from "../protyle/util/onGet"; import * as dayjs from "dayjs"; +import {fetchPost} from "../util/fetch"; +import {escapeHtml} from "../util/escape"; +import {isMobile} from "../util/functions"; let historyEditor: Protyle; const renderDoc = (element: HTMLElement, currentPage: number) => { @@ -88,7 +88,7 @@ const renderRepoItem = (response: IWebSocketData, element: Element, type: string let repoHTML = ""; response.data.snapshots.forEach((item: { memo: string, id: string, hCreated: string, count: number, hSize: string, tag: string, typesCount: { type: string, count: number }[] }) => { if (isMobile()) { - repoHTML += `
  • + repoHTML += `
  • ${escapeHtml(item.memo)} ${item.tag} @@ -101,7 +101,7 @@ const renderRepoItem = (response: IWebSocketData, element: Element, type: string
    ${actionHTML}
  • `; } else { - repoHTML += `
  • + repoHTML += `
  • ${escapeHtml(item.memo)} @@ -111,15 +111,15 @@ const renderRepoItem = (response: IWebSocketData, element: Element, type: string ${item.hCreated} ${window.siyuan.languages.fileSize} ${item.hSize} ${window.siyuan.languages.fileCount} ${item.count}`; - let statHTML = ""; - if (item.typesCount && 0 < item.typesCount.length) { - statHTML += ` + let statHTML = ""; + if (item.typesCount && 0 < item.typesCount.length) { + statHTML += ` ${item.typesCount.map((type: { type: string, count: number }) => { - return `${type.type} ${type.count}`; - }).join("  ")}`; - } - repoHTML += `${statHTML} + return `${type.type} ${type.count}`; + }).join("  ")}`; + } + repoHTML += `${statHTML}
    @@ -284,6 +284,8 @@ export const openHistory = () => { + +