mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge branch 'dev' into feature/tags
This commit is contained in:
@ -142,12 +142,13 @@ import {
|
||||
tag_map,
|
||||
tags,
|
||||
loadTagsSettings,
|
||||
printTags,
|
||||
printTagFilters,
|
||||
getTagsList,
|
||||
appendTagToList,
|
||||
createTagMapFromList,
|
||||
renameTagKey,
|
||||
importTags,
|
||||
tag_filter_types,
|
||||
} from "./scripts/tags.js";
|
||||
import {
|
||||
SECRET_KEYS,
|
||||
@ -833,7 +834,8 @@ async function printCharacters() {
|
||||
$("#rm_print_characters_block").append(template);
|
||||
});
|
||||
|
||||
printTags();
|
||||
printTagFilters(tag_filter_types.character);
|
||||
printTagFilters(tag_filter_types.group_member);
|
||||
printGroups();
|
||||
sortCharactersList();
|
||||
favsToHotswap();
|
||||
@ -4651,7 +4653,7 @@ function selectKoboldGuiPreset() {
|
||||
|
||||
async function saveSettings(type) {
|
||||
//console.log('Entering settings with name1 = '+name1);
|
||||
eventSource.emit(event_types.SETTINGS_UPDATED);
|
||||
|
||||
return jQuery.ajax({
|
||||
type: "POST",
|
||||
url: "/savesettings",
|
||||
@ -4699,6 +4701,7 @@ async function saveSettings(type) {
|
||||
//processData: false,
|
||||
success: function (data) {
|
||||
//online_status = data.result;
|
||||
eventSource.emit(event_types.SETTINGS_UPDATED);
|
||||
if (type == "change_name") {
|
||||
clearChat();
|
||||
printMessages();
|
||||
@ -5519,11 +5522,12 @@ function openCharacterWorldPopup() {
|
||||
return;
|
||||
}
|
||||
|
||||
function onSelectCharacterWorld() {
|
||||
async function onSelectCharacterWorld() {
|
||||
const value = $('.character_world_info_selector').find('option:selected').val();
|
||||
const worldIndex = value !== '' ? Number(value) : NaN;
|
||||
const name = !isNaN(worldIndex) ? world_names[worldIndex] : '';
|
||||
|
||||
const previousValue = $('#character_world').val();
|
||||
$('#character_world').val(name);
|
||||
|
||||
console.debug('Character world selected:', name);
|
||||
@ -5531,7 +5535,23 @@ function openCharacterWorldPopup() {
|
||||
if (menu_type == 'create') {
|
||||
create_save.world = name;
|
||||
} else {
|
||||
createOrEditCharacter();
|
||||
if (previousValue && !name) {
|
||||
try {
|
||||
// Dirty hack to remove embedded lorebook from character JSON data.
|
||||
const data = JSON.parse($('#character_json_data').val());
|
||||
|
||||
if (data?.data?.character_book) {
|
||||
data.data.character_book = undefined;
|
||||
}
|
||||
|
||||
$('#character_json_data').val(JSON.stringify(data));
|
||||
toastr.info('Embedded lorebook will be removed from this character.');
|
||||
} catch {
|
||||
console.error('Failed to parse character JSON data.');
|
||||
}
|
||||
}
|
||||
|
||||
await createOrEditCharacter();
|
||||
}
|
||||
|
||||
setWorldInfoButtonClass(undefined, !!value);
|
||||
@ -6301,6 +6321,7 @@ function importCharacter(file) {
|
||||
processData: false,
|
||||
success: async function (data) {
|
||||
if (data.file_name !== undefined) {
|
||||
$('#character_search_bar').val('').trigger('input');
|
||||
$("#rm_info_block").transition({ opacity: 0, duration: 0 });
|
||||
var $prev_img = $("#avatar_div_div").clone();
|
||||
$prev_img
|
||||
|
Reference in New Issue
Block a user