Update cwb_uiManager.js

This commit is contained in:
2025-09-08 03:34:49 +08:00
committed by GitHub
parent 0a57c42edc
commit 4bcf82a51f

View File

@@ -219,6 +219,7 @@ function bindCharCardViewerPopupEvents($popup) {
$popup.find('.cwb-cyber-tab__delete').on('click', async function(e) {
e.stopPropagation();
if (confirm('您确定要删除这个角色条目吗?此操作不可撤销。')) {
const uidToDelete = $(this).data('char-uid');
await deleteLorebookEntries([uidToDelete]);
const $wrapper = $(this).closest('.cwb-cyber-tab');
@@ -231,9 +232,11 @@ function bindCharCardViewerPopupEvents($popup) {
} else if ($popup.find('.cwb-cyber-tab').length === 0) {
showCharCardViewerPopup();
}
}
});
$popup.find('#cwb-viewer-delete-all').on('click', async function() {
if (confirm('您确定要清除当前聊天中的所有角色卡和总览吗?此操作将删除所有相关条目,且不可撤销。')) {
const allUids = $popup.find('.cwb-cyber-tab__button').map(function() {
return $(this).data('char-uid');
}).get();
@@ -241,6 +244,7 @@ function bindCharCardViewerPopupEvents($popup) {
await deleteLorebookEntries(allUids);
}
showCharCardViewerPopup();
}
});
$popup.find('.cwb-save-button').on('click', async function () {