diff --git a/app/src/history/history.ts b/app/src/history/history.ts
index 2295eaa6f..c5850ec92 100644
--- a/app/src/history/history.ts
+++ b/app/src/history/history.ts
@@ -579,6 +579,12 @@ const bindEvent = (app: App, element: Element, dialog?: Dialog) => {
notebook: target.parentElement.getAttribute("data-notebook-id"),
historyPath: target.parentElement.getAttribute("data-path")
});
+ } else if (dataType === "av") {
+ // TODO
+ fetchPost("/api/history/rollbackDocHistory", {
+ notebook: target.parentElement.getAttribute("data-notebook-id"),
+ historyPath: target.parentElement.getAttribute("data-path")
+ });
} else if (dataType === "notebook") {
fetchPost("/api/history/rollbackNotebookHistory", {
historyPath: target.parentElement.getAttribute("data-path")
@@ -653,7 +659,7 @@ const bindEvent = (app: App, element: Element, dialog?: Dialog) => {
chipClass += "b3-chip--warning ";
ariaLabel = window.siyuan.languages.historyOutline;
}
- html += `
+ html += `
${docItem.op.substring(0, 1).toUpperCase()}
${escapeHtml(docItem.title)}
@@ -709,7 +715,7 @@ const bindEvent = (app: App, element: Element, dialog?: Dialog) => {
event.stopPropagation();
event.preventDefault();
break;
- } else if (target.classList.contains("b3-list-item") && (type === "assets" || type === "doc")) {
+ } else if (target.classList.contains("b3-list-item") && ["assets", "doc", "av"].includes(type)) {
const dataPath = target.getAttribute("data-path");
if (type === "assets") {
assetElement.classList.remove("fn__none");
@@ -737,6 +743,21 @@ const bindEvent = (app: App, element: Element, dialog?: Dialog) => {
searchMarkRender(historyEditor.protyle, k.split(" "));
}
});
+ } else if (type === "av") {
+ mdElement.classList.add("fn__none");
+ docElement.classList.remove("fn__none");
+ historyEditor.protyle.options.history.created = target.dataset.created;
+ onGet({
+ data: {
+ data: {
+ content: ``,
+ id: Lute.NewNodeID(),
+ rootID: Lute.NewNodeID(),
+ }
+ },
+ protyle: historyEditor.protyle,
+ action: [Constants.CB_GET_HISTORY, Constants.CB_GET_HTML],
+ });
}
titleElement.classList.remove("fn__none");
titleElement.textContent = target.querySelector(".b3-list-item__text").textContent;