This commit is contained in:
Daniel 2024-10-20 23:05:27 +08:00
parent 9c159ae637
commit b80b063dbb
No known key found for this signature in database
GPG Key ID: 86211BA83DF03017
13 changed files with 58 additions and 33 deletions

View File

@ -1,4 +1,5 @@
{ {
"workspaceData": "Arbeitsbereichsdaten",
"confirmRemoveRelationField": "Sind Sie sicher, dass Sie das Feld, das mit <b>${x}</b> verknüpft ist, löschen möchten?", "confirmRemoveRelationField": "Sind Sie sicher, dass Sie das Feld, das mit <b>${x}</b> verknüpft ist, löschen möchten?",
"removeButKeepRelationField": "Entfernen, aber verknüpftes Feld behalten", "removeButKeepRelationField": "Entfernen, aber verknüpftes Feld behalten",
"exportPDFLowMemory": "Nicht genügend verfügbarer Speicher, um dieses PDF zu exportieren, bitte reduzieren Sie den Inhalt oder erhöhen Sie den verfügbaren Speicher und versuchen Sie es erneut", "exportPDFLowMemory": "Nicht genügend verfügbarer Speicher, um dieses PDF zu exportieren, bitte reduzieren Sie den Inhalt oder erhöhen Sie den verfügbaren Speicher und versuchen Sie es erneut",
@ -855,7 +856,7 @@
"moveToBottomRight": "In die untere rechte Ecke verschieben", "moveToBottomRight": "In die untere rechte Ecke verschieben",
"accountDisplayTitle": "Das Titelsymbol anzeigen", "accountDisplayTitle": "Das Titelsymbol anzeigen",
"accountDisplayVIP": "Das VIP-Symbol anzeigen", "accountDisplayVIP": "Das VIP-Symbol anzeigen",
"rollbackConfirm": "Rollback-Operation kann nicht rückgängig gemacht werden, sind Sie sicher, dass Sie <b>${date}</b> zurückrollen möchten?", "rollbackConfirm": "Der Rollback-Vorgang kann nicht rückgängig gemacht werden, bitte gehen Sie vorsichtig vor. Sind Sie sicher, dass Sie <b>${name}</b> auf <b>${time}</b> zurücksetzen möchten?",
"pdfTip": "PDF-Export unterstützt kein Dunkelthema", "pdfTip": "PDF-Export unterstützt kein Dunkelthema",
"pdfConfirm": "Möchten Sie mit dem ausgewählten Lichtthema weiter exportieren?", "pdfConfirm": "Möchten Sie mit dem ausgewählten Lichtthema weiter exportieren?",
"import": "Importieren", "import": "Importieren",

View File

@ -1,4 +1,5 @@
{ {
"workspaceData": "Workspace data",
"confirmRemoveRelationField": "Are you sure you want to delete the field associated with <b>${x}</b>?", "confirmRemoveRelationField": "Are you sure you want to delete the field associated with <b>${x}</b>?",
"removeButKeepRelationField": "Remove, but keep related field", "removeButKeepRelationField": "Remove, but keep related field",
"exportPDFLowMemory": "Insufficient available memory to export this PDF, please reduce the content or increase available memory and try exporting again", "exportPDFLowMemory": "Insufficient available memory to export this PDF, please reduce the content or increase available memory and try exporting again",
@ -855,7 +856,7 @@
"moveToBottomRight": "Move to the Bottom Right", "moveToBottomRight": "Move to the Bottom Right",
"accountDisplayTitle": "Display the title icon", "accountDisplayTitle": "Display the title icon",
"accountDisplayVIP": "Display the VIP icon", "accountDisplayVIP": "Display the VIP icon",
"rollbackConfirm": "Rollback operation cannot be undone, are you sure you want to rollback <b>${date}</b> ?", "rollbackConfirm": "The rollback operation cannot be undone, please proceed with caution. Are you sure you want to roll back <b>${name}</b> to <b>${time}</b>?",
"pdfTip": "PDF export does not support Dark theme", "pdfTip": "PDF export does not support Dark theme",
"pdfConfirm": "Do you want to continue exporting with the selected Light theme?", "pdfConfirm": "Do you want to continue exporting with the selected Light theme?",
"import": "Import", "import": "Import",

View File

@ -1,4 +1,5 @@
{ {
"workspaceData": "Datos del espacio de trabajo",
"confirmRemoveRelationField": "¿Está seguro de que desea eliminar el campo asociado a <b>${x}</b>?", "confirmRemoveRelationField": "¿Está seguro de que desea eliminar el campo asociado a <b>${x}</b>?",
"removeButKeepRelationField": "Eliminar, pero mantener el campo relacionado", "removeButKeepRelationField": "Eliminar, pero mantener el campo relacionado",
"exportPDFLowMemory": "Memoria disponible insuficiente para exportar este PDF, por favor reduzca el contenido o aumente la memoria disponible y vuelva a intentar exportar", "exportPDFLowMemory": "Memoria disponible insuficiente para exportar este PDF, por favor reduzca el contenido o aumente la memoria disponible y vuelva a intentar exportar",
@ -855,7 +856,7 @@
"moveToBottomRight": "Mover a la parte inferior derecha", "moveToBottomRight": "Mover a la parte inferior derecha",
"accountDisplayTitle": "Mostrar el icono del título", "accountDisplayTitle": "Mostrar el icono del título",
"accountDisplayVIP": "Mostrar el icono VIP", "accountDisplayVIP": "Mostrar el icono VIP",
"rollbackConfirm": "La operación de retroceso no se puede deshacer, ¿estás seguro de que quieres revertir <b>${date}</b> ?", "rollbackConfirm": "La operación de reversión no se puede deshacer, por favor proceda con precaución. ¿Está seguro de que desea revertir <b>${name}</b> a <b>${time}</b>?",
"pdfTip": "La exportación de PDF no es compatible con el tema oscuro", "pdfTip": "La exportación de PDF no es compatible con el tema oscuro",
"pdfConfirm": "¿Desea seguir exportando con el tema Claro seleccionado?", "pdfConfirm": "¿Desea seguir exportando con el tema Claro seleccionado?",
"import": "Importar", "import": "Importar",

View File

@ -1,4 +1,5 @@
{ {
"workspaceData": "Données de l'espace de travail",
"confirmRemoveRelationField": "Êtes-vous sûr de vouloir supprimer le champ associé à <b>${x}</b>?", "confirmRemoveRelationField": "Êtes-vous sûr de vouloir supprimer le champ associé à <b>${x}</b>?",
"removeButKeepRelationField": "Supprimer, mais conserver le champ associé", "removeButKeepRelationField": "Supprimer, mais conserver le champ associé",
"exportPDFLowMemory": "Mémoire disponible insuffisante pour exporter ce PDF, veuillez réduire le contenu ou augmenter la mémoire disponible et réessayer d'exporter", "exportPDFLowMemory": "Mémoire disponible insuffisante pour exporter ce PDF, veuillez réduire le contenu ou augmenter la mémoire disponible et réessayer d'exporter",
@ -855,7 +856,7 @@
"moveToBottomRight": "Déplacer vers la Bas à Droit", "moveToBottomRight": "Déplacer vers la Bas à Droit",
"accountDisplayTitle": "Afficher l'icône du titre", "accountDisplayTitle": "Afficher l'icône du titre",
"accountDisplayVIP": "Afficher l'icône VIP", "accountDisplayVIP": "Afficher l'icône VIP",
"rollbackConfirm": "L'opération de retour en arrière est irréversible. Êtes-vous sûr de vouloir revenir en arrière à la date <b>${date}</b> ?", "rollbackConfirm": "L'opération de restauration ne peut pas être annulée, veuillez procéder avec prudence. Êtes-vous sûr de vouloir restaurer <b>${name}</b> à <b>${time}</b>?",
"pdfTip": "L'exportation de PDF ne supporte pas le thème Dark", "pdfTip": "L'exportation de PDF ne supporte pas le thème Dark",
"pdfConfirm": "Voulez-vous continuer à exporter avec le thème clear sélectionné ?", "pdfConfirm": "Voulez-vous continuer à exporter avec le thème clear sélectionné ?",
"import": "Importer", "import": "Importer",

View File

@ -1,4 +1,5 @@
{ {
"workspaceData": "נתוני סביבת עבודה",
"confirmRemoveRelationField": "האם אתה בטוח שברצונך למחוק את השדה המשויך ל-<b>${x}</b>?", "confirmRemoveRelationField": "האם אתה בטוח שברצונך למחוק את השדה המשויך ל-<b>${x}</b>?",
"removeButKeepRelationField": "מחק, אך שמור על שדה הקשר", "removeButKeepRelationField": "מחק, אך שמור על שדה הקשר",
"exportPDFLowMemory": "אין מספיק זיכרון זמין במערכת כדי לייצא את ה-PDF הזה, נא לצמצם את התוכן או להגדיל את הזיכרון הזמין ולנסות שוב לייצא", "exportPDFLowMemory": "אין מספיק זיכרון זמין במערכת כדי לייצא את ה-PDF הזה, נא לצמצם את התוכן או להגדיל את הזיכרון הזמין ולנסות שוב לייצא",
@ -855,7 +856,7 @@
"moveToBottomRight": "העבר לפינה התחתונה הימנית", "moveToBottomRight": "העבר לפינה התחתונה הימנית",
"accountDisplayTitle": "הצג את האייקון בכותרת", "accountDisplayTitle": "הצג את האייקון בכותרת",
"accountDisplayVIP": "הצג את אייקון ה-VIP", "accountDisplayVIP": "הצג את אייקון ה-VIP",
"rollbackConfirm": "פעולת החזרה לא ניתנת לביטול, האם אתה בטוח שברצונך לחזור ל<b>${date}</b>?", "rollbackConfirm": "לא ניתן לבטל את פעולת השחזור, אנא היזהר בהחלטתך. האם אתה בטוח שברצונך לשחזר את <b>${name}</b> ל-<b>${time}</b>?",
"pdfTip": "ייצוא PDF אינו תומך בנושא כהה", "pdfTip": "ייצוא PDF אינו תומך בנושא כהה",
"pdfConfirm": "האם תרצה להמשיך לייצא עם הנושא הנבחר האור?", "pdfConfirm": "האם תרצה להמשיך לייצא עם הנושא הנבחר האור?",
"import": "ייבוא", "import": "ייבוא",

View File

@ -1,4 +1,5 @@
{ {
"workspaceData": "Dati dello spazio di lavoro",
"confirmRemoveRelationField": "Sei sicuro di voler eliminare il campo associato a <b>${x}</b>?", "confirmRemoveRelationField": "Sei sicuro di voler eliminare il campo associato a <b>${x}</b>?",
"removeButKeepRelationField": "Rimuovi, ma mantieni il campo correlato", "removeButKeepRelationField": "Rimuovi, ma mantieni il campo correlato",
"exportPDFLowMemory": "Memoria disponibile insufficiente per esportare questo PDF, riduci il contenuto o aumenta la memoria disponibile e riprova a esportare", "exportPDFLowMemory": "Memoria disponibile insufficiente per esportare questo PDF, riduci il contenuto o aumenta la memoria disponibile e riprova a esportare",
@ -855,7 +856,7 @@
"moveToBottomRight": "Sposta in basso a destra", "moveToBottomRight": "Sposta in basso a destra",
"accountDisplayTitle": "Mostra l'icona del titolo", "accountDisplayTitle": "Mostra l'icona del titolo",
"accountDisplayVIP": "Mostra l'icona VIP", "accountDisplayVIP": "Mostra l'icona VIP",
"rollbackConfirm": "L'operazione di rollback non può essere annullata, sei sicuro di voler ripristinare a <b>${date}</b>?", "rollbackConfirm": "L'operazione di rollback non può essere annullata, si prega di procedere con cautela. Sei sicuro di voler ripristinare <b>${name}</b> a <b>${time}</b>?",
"pdfTip": "L'esportazione PDF non supporta il tema scuro", "pdfTip": "L'esportazione PDF non supporta il tema scuro",
"pdfConfirm": "Vuoi continuare l'esportazione con il tema chiaro selezionato?", "pdfConfirm": "Vuoi continuare l'esportazione con il tema chiaro selezionato?",
"import": "Importa", "import": "Importa",

View File

@ -1,4 +1,5 @@
{ {
"workspaceData": "ワークスペースデータ",
"confirmRemoveRelationField": "<b>${x}</b> に関連するフィールドを同時に削除してもよろしいですか?", "confirmRemoveRelationField": "<b>${x}</b> に関連するフィールドを同時に削除してもよろしいですか?",
"removeButKeepRelationField": "削除して関連フィールドを保持", "removeButKeepRelationField": "削除して関連フィールドを保持",
"exportPDFLowMemory": "システムの利用可能なメモリが不足しているため、この PDF をエクスポートできません。内容を減らすか、利用可能なメモリを増やしてから再試行してください", "exportPDFLowMemory": "システムの利用可能なメモリが不足しているため、この PDF をエクスポートできません。内容を減らすか、利用可能なメモリを増やしてから再試行してください",
@ -855,7 +856,7 @@
"moveToBottomRight": "右底", "moveToBottomRight": "右底",
"accountDisplayTitle": "タイトルアイコンを表示", "accountDisplayTitle": "タイトルアイコンを表示",
"accountDisplayVIP": "VIP アイコンを表示", "accountDisplayVIP": "VIP アイコンを表示",
"rollbackConfirm": "ロールバック操作を取り消すことはできません。本当に <b>${date}</b> をロールバックしてもよろしいですか?", "rollbackConfirm": "ロールバック操作は元に戻せません。慎重に決定してください。<b>${name}</b> を <b>${time}</b> にロールバックしてもよろしいですか?",
"pdfTip": "PDF エクスポートはダークテーマに対応していません", "pdfTip": "PDF エクスポートはダークテーマに対応していません",
"pdfConfirm": "選択したライトテーマでエクスポートを続行しますか?", "pdfConfirm": "選択したライトテーマでエクスポートを続行しますか?",
"import": "インポート", "import": "インポート",

View File

@ -1,4 +1,5 @@
{ {
"workspaceData": "Dane przestrzeni roboczej",
"confirmRemoveRelationField": "Czy na pewno chcesz usunąć pole powiązane z <b>${x}</b>?", "confirmRemoveRelationField": "Czy na pewno chcesz usunąć pole powiązane z <b>${x}</b>?",
"removeButKeepRelationField": "Usuń, ale zachowaj powiązane pole", "removeButKeepRelationField": "Usuń, ale zachowaj powiązane pole",
"exportPDFLowMemory": "Za mało dostępnej pamięci, aby wyeksportować ten PDF, proszę zmniejszyć zawartość lub zwiększyć dostępną pamięć i spróbować ponownie", "exportPDFLowMemory": "Za mało dostępnej pamięci, aby wyeksportować ten PDF, proszę zmniejszyć zawartość lub zwiększyć dostępną pamięć i spróbować ponownie",
@ -855,7 +856,7 @@
"moveToBottomRight": "Przenieś do dolnego prawego rogu", "moveToBottomRight": "Przenieś do dolnego prawego rogu",
"accountDisplayTitle": "Wyświetl ikonę tytułu", "accountDisplayTitle": "Wyświetl ikonę tytułu",
"accountDisplayVIP": "Wyświetl ikonę VIP", "accountDisplayVIP": "Wyświetl ikonę VIP",
"rollbackConfirm": "Operacja wycofania nie może być cofnieta, czy na pewno chcesz cofnąć <b>${date}</b>?", "rollbackConfirm": "Operacja cofania nie może zostać anulowana, proszę zachować ostrożność. Czy na pewno chcesz cofnąć <b>${name}</b> do <b>${time}</b>?",
"pdfTip": "Eksport PDF nie wspiera ciemnego motywu", "pdfTip": "Eksport PDF nie wspiera ciemnego motywu",
"pdfConfirm": "Czy chcesz kontynuować eksport z wybranym jasnym motywem?", "pdfConfirm": "Czy chcesz kontynuować eksport z wybranym jasnym motywem?",
"import": "Importuj", "import": "Importuj",

View File

@ -1,4 +1,5 @@
{ {
"workspaceData": "Данные рабочей области",
"confirmRemoveRelationField": "Вы уверены, что хотите удалить поле, связанное с <b>${x}</b>?", "confirmRemoveRelationField": "Вы уверены, что хотите удалить поле, связанное с <b>${x}</b>?",
"removeButKeepRelationField": "Удалить, но сохранить связанное поле", "removeButKeepRelationField": "Удалить, но сохранить связанное поле",
"exportPDFLowMemory": "Недостаточно доступной памяти для экспорта этого PDF, пожалуйста, уменьшите содержимое или увеличьте доступную память и повторите попытку экспорта", "exportPDFLowMemory": "Недостаточно доступной памяти для экспорта этого PDF, пожалуйста, уменьшите содержимое или увеличьте доступную память и повторите попытку экспорта",
@ -855,7 +856,7 @@
"moveToBottomRight": "Переместить в нижний правый угол", "moveToBottomRight": "Переместить в нижний правый угол",
"accountDisplayTitle": "Отобразить значок заголовка", "accountDisplayTitle": "Отобразить значок заголовка",
"accountDisplayVIP": "Отобразить VIP-значок", "accountDisplayVIP": "Отобразить VIP-значок",
"rollbackConfirm": "Операция отката не может быть отменена, вы уверены, что хотите откатить <b>${date}</b>?", "rollbackConfirm": "Операция отката не может быть отменена, пожалуйста, будьте осторожны. Вы уверены, что хотите откатить <b>${name}</b> к <b>${time}</b>?",
"pdfTip": "Экспорт PDF не поддерживает темную тему", "pdfTip": "Экспорт PDF не поддерживает темную тему",
"pdfConfirm": "Вы хотите продолжить экспорт с выбранной светлой темой?", "pdfConfirm": "Вы хотите продолжить экспорт с выбранной светлой темой?",
"import": "Импортировать", "import": "Импортировать",

View File

@ -1,4 +1,5 @@
{ {
"workspaceData": "工作空間數據",
"confirmRemoveRelationField": "確定同時刪除關聯至 <b>${x}</b> 中的字段嗎?", "confirmRemoveRelationField": "確定同時刪除關聯至 <b>${x}</b> 中的字段嗎?",
"removeButKeepRelationField": "刪除,但保留關聯字段", "removeButKeepRelationField": "刪除,但保留關聯字段",
"exportPDFLowMemory": "系統可用記憶體不足,無法導出該 PDF請減少內容或者增加可用記憶體後再嘗試導出", "exportPDFLowMemory": "系統可用記憶體不足,無法導出該 PDF請減少內容或者增加可用記憶體後再嘗試導出",
@ -855,7 +856,7 @@
"moveToBottomRight": "移動到下側右方", "moveToBottomRight": "移動到下側右方",
"accountDisplayTitle": "首欄顯示頭銜", "accountDisplayTitle": "首欄顯示頭銜",
"accountDisplayVIP": "首欄顯示 VIP", "accountDisplayVIP": "首欄顯示 VIP",
"rollbackConfirm": "回復操作無法撤銷,確定要將 <b>${date}</b> 回復嗎?", "rollbackConfirm": "回滾操作無法撤銷,請謹慎決定。確定要將 <b>${name}</b> 回滾到 <b>${time}</b> 嗎?",
"pdfTip": "PDF 匯出不支援深色主題", "pdfTip": "PDF 匯出不支援深色主題",
"pdfConfirm": "是否使用已選擇的淺色主題繼續匯出?", "pdfConfirm": "是否使用已選擇的淺色主題繼續匯出?",
"import": "導入", "import": "導入",

View File

@ -1,4 +1,5 @@
{ {
"workspaceData": "工作空间数据",
"confirmRemoveRelationField": "确定同时删除关联至 <b>${x}</b> 中的字段吗?", "confirmRemoveRelationField": "确定同时删除关联至 <b>${x}</b> 中的字段吗?",
"removeButKeepRelationField": "删除,但保留关联字段", "removeButKeepRelationField": "删除,但保留关联字段",
"exportPDFLowMemory": "系统可用内存不足,无法导出该 PDF请减少内容或者增加可用内存后再尝试导出", "exportPDFLowMemory": "系统可用内存不足,无法导出该 PDF请减少内容或者增加可用内存后再尝试导出",
@ -855,7 +856,7 @@
"moveToBottomRight": "移动到下侧右方", "moveToBottomRight": "移动到下侧右方",
"accountDisplayTitle": "顶栏显示头衔", "accountDisplayTitle": "顶栏显示头衔",
"accountDisplayVIP": "顶栏显示 VIP", "accountDisplayVIP": "顶栏显示 VIP",
"rollbackConfirm": "回滚操作无法撤销,确定要将 <b>${date}</b> 回滚吗?", "rollbackConfirm": "回滚操作无法撤销,请谨慎决定。确定要将 <b>${name}</b> 回滚到 <b>${time}</b> 吗?",
"pdfTip": "PDF 导出不支持深色主题", "pdfTip": "PDF 导出不支持深色主题",
"pdfConfirm": "是否使用已选择的浅色主题继续导出?", "pdfConfirm": "是否使用已选择的浅色主题继续导出?",
"import": "导入", "import": "导入",

View File

@ -130,9 +130,12 @@ export const openDocHistory = (options: {
if (type === "close") { if (type === "close") {
dialog.destroy(); dialog.destroy();
} else if (type === "rollback" && !isLoading) { } else if (type === "rollback" && !isLoading) {
getHistoryPath(target.parentElement, opElement.value, options.id, (dataPath) => { getHistoryPath(target.parentElement, opElement.value, options.id, (item) => {
let dataPath = item.path;
isLoading = false; isLoading = false;
confirmDialog("⚠️ " + window.siyuan.languages.rollback, `${window.siyuan.languages.rollbackConfirm.replace("${date}", target.parentElement.textContent.trim())}`, () => { let confirmTip = window.siyuan.languages.rollbackConfirm.replace("${name}", item.title)
.replace("${time}", target.previousElementSibling.previousElementSibling.textContent.trim());
confirmDialog("⚠️ " + window.siyuan.languages.rollback, confirmTip, () => {
fetchPost("/api/history/rollbackDocHistory", { fetchPost("/api/history/rollbackDocHistory", {
notebook: options.notebookId, notebook: options.notebookId,
historyPath: dataPath historyPath: dataPath
@ -143,7 +146,8 @@ export const openDocHistory = (options: {
event.preventDefault(); event.preventDefault();
break; break;
} else if (target.classList.contains("b3-list-item") && !isLoading) { } else if (target.classList.contains("b3-list-item") && !isLoading) {
getHistoryPath(target, opElement.value, options.id, (dataPath) => { getHistoryPath(target, opElement.value, options.id, (item) => {
let dataPath = item.path;
fetchPost("/api/history/getDocHistoryContent", { fetchPost("/api/history/getDocHistoryContent", {
historyPath: dataPath, historyPath: dataPath,
}, (response) => { }, (response) => {
@ -180,7 +184,7 @@ export const openDocHistory = (options: {
}); });
}; };
const getHistoryPath = (target: Element, op: string, id: string, cb: (path: string) => void) => { const getHistoryPath = (target: Element, op: string, id: string, cb: (item: any) => void) => {
isLoading = true; isLoading = true;
const path = target.getAttribute("data-path"); const path = target.getAttribute("data-path");
if (path) { if (path) {
@ -194,6 +198,6 @@ const getHistoryPath = (target: Element, op: string, id: string, cb: (path: stri
type: 3, type: 3,
created created
}, (response) => { }, (response) => {
cb(response.data.items[0].path); cb(response.data.items[0]);
}); });
}; };

View File

@ -1,19 +1,19 @@
import { Dialog } from "../dialog"; import {Dialog} from "../dialog";
import { confirmDialog } from "../dialog/confirmDialog"; import {confirmDialog} from "../dialog/confirmDialog";
import { Constants } from "../constants"; import {Constants} from "../constants";
import { hasClosestByClassName } from "../protyle/util/hasClosest"; import {hasClosestByClassName} from "../protyle/util/hasClosest";
import { renderAssetsPreview } from "../asset/renderAssets"; import {renderAssetsPreview} from "../asset/renderAssets";
import { Protyle } from "../protyle"; import {Protyle} from "../protyle";
import { disabledProtyle, onGet } from "../protyle/util/onGet"; import {disabledProtyle, onGet} from "../protyle/util/onGet";
import * as dayjs from "dayjs"; import * as dayjs from "dayjs";
import { fetchPost } from "../util/fetch"; import {fetchPost} from "../util/fetch";
import { escapeAttr, escapeHtml } from "../util/escape"; import {escapeAttr, escapeHtml} from "../util/escape";
import { isMobile } from "../util/functions"; import {isMobile} from "../util/functions";
import { showDiff } from "./diff"; import {showDiff} from "./diff";
import { setStorageVal } from "../protyle/util/compatibility"; import {setStorageVal} from "../protyle/util/compatibility";
import { openModel } from "../mobile/menu/model"; import {openModel} from "../mobile/menu/model";
import { closeModel } from "../mobile/util/closePanel"; import {closeModel} from "../mobile/util/closePanel";
import { App } from "../index"; import {App} from "../index";
let historyEditor: Protyle; let historyEditor: Protyle;
@ -530,8 +530,18 @@ const bindEvent = (app: App, element: Element, dialog?: Dialog) => {
event.preventDefault(); event.preventDefault();
break; break;
} else if (target.classList.contains("b3-list-item__action") && type === "rollback" && !window.siyuan.config.readonly) { } else if (target.classList.contains("b3-list-item__action") && type === "rollback" && !window.siyuan.config.readonly) {
confirmDialog("⚠️ " + window.siyuan.languages.rollback, `${window.siyuan.languages.rollbackConfirm.replace("${date}", target.parentElement.textContent.trim())}`, () => { const dataType = target.parentElement.getAttribute("data-type");
const dataType = target.parentElement.getAttribute("data-type"); let name = target.previousElementSibling.previousElementSibling.textContent.trim();
let time = dayjs(parseInt(target.parentElement.getAttribute("data-created")) * 1000).format("YYYY-MM-DD HH:mm:ss");
if (dataType === "notebook") {
time = target.parentElement.parentElement.previousElementSibling.textContent.trim();
} else if (dataType === "repoitem") {
name = window.siyuan.languages.workspaceData;
time = target.parentElement.querySelector("span[data-type='hCreated']").textContent.trim();
}
let confirmTip = window.siyuan.languages.rollbackConfirm.replace("${name}", name)
.replace("${time}", time);
confirmDialog("⚠️ " + window.siyuan.languages.rollback, confirmTip, () => {
if (dataType === "assets") { if (dataType === "assets") {
fetchPost("/api/history/rollbackAssetsHistory", { fetchPost("/api/history/rollbackAssetsHistory", {
historyPath: target.parentElement.getAttribute("data-path") historyPath: target.parentElement.getAttribute("data-path")