mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-02 20:36:49 +01:00
Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging
This commit is contained in:
commit
4189da19b1
@ -159,7 +159,7 @@
|
||||
|
||||
#world_info_search,
|
||||
#world_info_sort_order {
|
||||
width: 8em;
|
||||
width: 7em;
|
||||
}
|
||||
|
||||
.wi-card-entry {
|
||||
|
@ -2746,6 +2746,7 @@
|
||||
<div id="OpenAllWIEntries" class="menu_button fa-solid fa-expand" title="Open all Entries" data-i18n="[title]Open all Entries"></div>
|
||||
<div id="CloseAllWIEntries" class="menu_button fa-solid fa-compress" title="Close all Entries" data-i18n="[title]Close all Entries"></div>
|
||||
<div id="world_popup_new" class="menu_button fa-solid fa-plus" title="New Entry" data-i18n="[title]New Entry"></div>
|
||||
<div id="world_backfill_memos" class="menu_button fa-solid fa-notes-medical" title="Auto-Generate Memo/Title from Keywords" data-i18n="[title]Auto-Generate Memo/Title from Keywords"></div>
|
||||
<div id="world_import_button" class="menu_button fa-solid fa-file-import" title="Import World Info" data-i18n="[title]Import World Info"></div>
|
||||
<div id="world_popup_export" class="menu_button fa-solid fa-file-export" title="Export World Info" data-i18n="[title]Export World Info"></div>
|
||||
<div id="world_popup_delete" class="menu_button fa-solid fa-trash-can redWarningBG" title="Delete World Info" data-i18n="[title]Delete World Info"></div>
|
||||
|
@ -400,6 +400,23 @@ function displayWorldEntries(name, data, navigation = navigation_option.none) {
|
||||
await renameWorldInfo(name, data);
|
||||
});
|
||||
|
||||
$("#world_backfill_memos").off('click').on('click', async () => {
|
||||
let counter = 0;
|
||||
for (const entry of Object.values(data.entries)) {
|
||||
if (!entry.comment && Array.isArray(entry.key) && entry.key.length > 0) {
|
||||
entry.comment = entry.key[0];
|
||||
setOriginalDataValue(data, entry.uid, "comment", entry.comment);
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
|
||||
if (counter > 0) {
|
||||
toastr.info(`Backfilled ${counter} titles`);
|
||||
await saveWorldInfo(name, data, true);
|
||||
updateEditor(navigation_option.previous);
|
||||
}
|
||||
});
|
||||
|
||||
$("#world_popup_export").off('click').on('click', () => {
|
||||
if (name && data) {
|
||||
const jsonValue = JSON.stringify(data);
|
||||
|
Loading…
x
Reference in New Issue
Block a user