Jeffrey Chen 2024-05-03 10:13:34 +08:00 committed by GitHub
parent 157a25857c
commit b4d3180507
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -569,6 +569,7 @@ const bindEvent = (app: App, element: Element, dialog?: Dialog) => {
}, (response) => {
iconElement.classList.add("b3-list-item__arrow--open");
let html = "";
let ariaLabel = "";
response.data.items.forEach((docItem: {
title: string,
path: string,
@ -578,19 +579,28 @@ const bindEvent = (app: App, element: Element, dialog?: Dialog) => {
let chipClass = " b3-chip b3-chip--list ";
if (docItem.op === "clean") {
chipClass += "b3-chip--primary ";
ariaLabel = window.siyuan.languages.historyClean;
} else if (docItem.op === "update") {
chipClass += "b3-chip--info ";
ariaLabel = window.siyuan.languages.historyUpdate;
} else if (docItem.op === "delete") {
chipClass += "b3-chip--error ";
ariaLabel = window.siyuan.languages.historyDelete;
} else if (docItem.op === "format") {
chipClass += "b3-chip--pink ";
ariaLabel = window.siyuan.languages.historyFormat;
} else if (docItem.op === "sync") {
chipClass += "b3-chip--success ";
ariaLabel = window.siyuan.languages.historySync;
} else if (docItem.op === "replace") {
chipClass += "b3-chip--secondary ";
ariaLabel = window.siyuan.languages.historyReplace;
} else if (docItem.op === "outline") {
chipClass += "b3-chip--warning ";
ariaLabel = window.siyuan.languages.historyOutline;
}
html += `<li data-notebook-id="${docItem.notebook}" title="${escapeAttr(docItem.title)}" data-created="${created}" data-type="${typeElement.value === "2" ? "assets" : "doc"}" data-path="${docItem.path}" class="b3-list-item b3-list-item--hide-action" style="padding-left: 22px">
<span class="${opElement.value === "all" ? "" : "fn__none"}${chipClass}b3-tooltips b3-tooltips__n" aria-label="${docItem.op}">${docItem.op.substring(0, 1).toUpperCase()}</span>
<span class="${opElement.value === "all" ? "" : "fn__none"}${chipClass}b3-tooltips b3-tooltips__n" aria-label="${ariaLabel}">${docItem.op.substring(0, 1).toUpperCase()}</span>
<span class="b3-list-item__text">${escapeHtml(docItem.title)}</span>
<span class="fn__space"></span>
<span class="b3-list-item__action b3-tooltips b3-tooltips__n" data-type="rollback" aria-label="${window.siyuan.languages.rollback}">