浏览代码

https://ld246.com/article/1714662110914 (#11228)

Jeffrey Chen 1 年之前
父节点
当前提交
b4d3180507
共有 1 个文件被更改,包括 11 次插入1 次删除
  1. 11 1
      app/src/history/history.ts

+ 11 - 1
app/src/history/history.ts

@@ -569,6 +569,7 @@ const bindEvent = (app: App, element: Element, dialog?: Dialog) => {
                         }, (response) => {
                         }, (response) => {
                             iconElement.classList.add("b3-list-item__arrow--open");
                             iconElement.classList.add("b3-list-item__arrow--open");
                             let html = "";
                             let html = "";
+                            let ariaLabel = "";
                             response.data.items.forEach((docItem: {
                             response.data.items.forEach((docItem: {
                                 title: string,
                                 title: string,
                                 path: string,
                                 path: string,
@@ -578,19 +579,28 @@ const bindEvent = (app: App, element: Element, dialog?: Dialog) => {
                                 let chipClass = " b3-chip b3-chip--list ";
                                 let chipClass = " b3-chip b3-chip--list ";
                                 if (docItem.op === "clean") {
                                 if (docItem.op === "clean") {
                                     chipClass += "b3-chip--primary ";
                                     chipClass += "b3-chip--primary ";
+                                    ariaLabel = window.siyuan.languages.historyClean;
                                 } else if (docItem.op === "update") {
                                 } else if (docItem.op === "update") {
                                     chipClass += "b3-chip--info ";
                                     chipClass += "b3-chip--info ";
+                                    ariaLabel = window.siyuan.languages.historyUpdate;
                                 } else if (docItem.op === "delete") {
                                 } else if (docItem.op === "delete") {
                                     chipClass += "b3-chip--error ";
                                     chipClass += "b3-chip--error ";
+                                    ariaLabel = window.siyuan.languages.historyDelete;
                                 } else if (docItem.op === "format") {
                                 } else if (docItem.op === "format") {
                                     chipClass += "b3-chip--pink ";
                                     chipClass += "b3-chip--pink ";
+                                    ariaLabel = window.siyuan.languages.historyFormat;
                                 } else if (docItem.op === "sync") {
                                 } else if (docItem.op === "sync") {
                                     chipClass += "b3-chip--success ";
                                     chipClass += "b3-chip--success ";
+                                    ariaLabel = window.siyuan.languages.historySync;
                                 } else if (docItem.op === "replace") {
                                 } else if (docItem.op === "replace") {
                                     chipClass += "b3-chip--secondary ";
                                     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">
                                 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="b3-list-item__text">${escapeHtml(docItem.title)}</span>
     <span class="fn__space"></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}">
     <span class="b3-list-item__action b3-tooltips b3-tooltips__n" data-type="rollback" aria-label="${window.siyuan.languages.rollback}">