mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge branch 'dev' of https://github.com/SillyLossy/TavernAI into dev
This commit is contained in:
@@ -1795,12 +1795,23 @@
|
|||||||
<div class="avatar">
|
<div class="avatar">
|
||||||
<img src="">
|
<img src="">
|
||||||
</div>
|
</div>
|
||||||
<div class="select_chat_block_filename"></div>
|
<div id="select_chat_name_wrapper">
|
||||||
|
<div class="select_chat_block_filename select_chat_block_filename_item"></div>
|
||||||
|
|
||||||
|
<div class="select_chat_info">
|
||||||
|
<div class="chat_messages_num select_chat_block_filename_item"></div>
|
||||||
|
<div class="chat_file_size select_chat_block_filename_item"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="select_chat_block_mes"></div>
|
<div class="select_chat_block_mes"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="flex-container">
|
||||||
|
<div class="renameChatButton fa-solid fa-pen"></div>
|
||||||
<div file_name="" class="PastChat_cross fa-solid fa-circle-xmark"></div>
|
<div file_name="" class="PastChat_cross fa-solid fa-circle-xmark"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="tag_view_template" class="template_element">
|
<div id="tag_view_template" class="template_element">
|
||||||
<div class="tag_view_item">
|
<div class="tag_view_item">
|
||||||
|
@@ -3269,7 +3269,9 @@ async function displayPastChats() {
|
|||||||
const template = $('#past_chat_template .select_chat_block_wrapper').clone();
|
const template = $('#past_chat_template .select_chat_block_wrapper').clone();
|
||||||
template.find('.select_chat_block').attr('file_name', fileName);
|
template.find('.select_chat_block').attr('file_name', fileName);
|
||||||
template.find('.avatar img').attr('src', avatarImg);
|
template.find('.avatar img').attr('src', avatarImg);
|
||||||
template.find('.select_chat_block_filename').text(fileName + " (" + file_size + ") (" + chat_items + " messages)");
|
template.find('.select_chat_block_filename').text(fileName);
|
||||||
|
template.find('.chat_file_size').text(" (" + file_size + ")");
|
||||||
|
template.find('.chat_messages_num').text(" (" + chat_items + " messages)");
|
||||||
template.find('.select_chat_block_mes').text(mes);
|
template.find('.select_chat_block_mes').text(mes);
|
||||||
template.find('.PastChat_cross').attr('file_name', fileName);
|
template.find('.PastChat_cross').attr('file_name', fileName);
|
||||||
|
|
||||||
@@ -3524,6 +3526,7 @@ function callPopup(text, type, inputValue = '') {
|
|||||||
break;
|
break;
|
||||||
case "del_world":
|
case "del_world":
|
||||||
case "del_group":
|
case "del_group":
|
||||||
|
case "rename_chat":
|
||||||
case "del_chat":
|
case "del_chat":
|
||||||
default:
|
default:
|
||||||
$("#dialogue_popup_ok").text("Delete");
|
$("#dialogue_popup_ok").text("Delete");
|
||||||
@@ -3731,6 +3734,8 @@ function isHordeGenerationNotAllowed() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
window["SillyTavern"].getContext = function () {
|
window["SillyTavern"].getContext = function () {
|
||||||
return {
|
return {
|
||||||
chat: chat,
|
chat: chat,
|
||||||
@@ -4327,9 +4332,10 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
//open the history view again after 100ms
|
//open the history view again after 100ms
|
||||||
//hide option popup menu
|
//hide option popup menu
|
||||||
await delay(100);
|
setTimeout(function () {
|
||||||
$("#option_select_chat").click();
|
$("#option_select_chat").click();
|
||||||
$("#options").hide();
|
$("#options").hide();
|
||||||
|
}, 200);
|
||||||
}
|
}
|
||||||
if (popup_type == "del_ch") {
|
if (popup_type == "del_ch") {
|
||||||
console.log(
|
console.log(
|
||||||
@@ -4641,6 +4647,37 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
$("#renameCharButton").on('click', renameCharacter);
|
$("#renameCharButton").on('click', renameCharacter);
|
||||||
|
|
||||||
|
$(document).on("click", ".renameChatButton", async function () {
|
||||||
|
var old_filenamefull = $(this).closest('.select_chat_block_wrapper').find('.select_chat_block_filename').text();
|
||||||
|
|
||||||
|
var old_filename = old_filenamefull.substring(0, old_filenamefull.length - 6);
|
||||||
|
|
||||||
|
const popupText = `<h3>Enter the new name for the chat:<h3>
|
||||||
|
<small>!!Using an existing filename will overwrite that file!!<br>
|
||||||
|
No need to add '.jsonl' at the end.<br>
|
||||||
|
</small>`;
|
||||||
|
let newName = await callPopup(popupText, 'input', old_filename);
|
||||||
|
|
||||||
|
if (!newName) {
|
||||||
|
console.log('no new name found, aborting');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const newMetadata = { main_chat: characters[this_chid].chat };
|
||||||
|
await saveChat(newName, newMetadata);
|
||||||
|
await saveChat(); //is this second save needed?
|
||||||
|
chat_file_for_del = old_filenamefull;
|
||||||
|
popup_type = 'del_chat';
|
||||||
|
|
||||||
|
setTimeout(function () {
|
||||||
|
callPopup('Confirm Delete of Old File After Rename');
|
||||||
|
}, 200);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
$("#talkativeness_slider").on("input", function () {
|
$("#talkativeness_slider").on("input", function () {
|
||||||
if (menu_type == "create") {
|
if (menu_type == "create") {
|
||||||
create_save_talkativeness = $("#talkativeness_slider").val();
|
create_save_talkativeness = $("#talkativeness_slider").val();
|
||||||
@@ -5476,7 +5513,7 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
$(document).on('click', '.mes .avatar', function () {
|
$(document).on('click', '.mes .avatar', function () {
|
||||||
|
|
||||||
if (window.innerWidth > 1000 || $('body').hasClass('waifuMode')) {
|
//if (window.innerWidth > 1000 || $('body').hasClass('waifuMode')) {
|
||||||
|
|
||||||
let thumbURL = $(this).children('img').attr('src');
|
let thumbURL = $(this).children('img').attr('src');
|
||||||
let charsPath = '/characters/'
|
let charsPath = '/characters/'
|
||||||
@@ -5491,7 +5528,7 @@ $(document).ready(function () {
|
|||||||
}
|
}
|
||||||
$('#avatar_zoom_popup').toggle();
|
$('#avatar_zoom_popup').toggle();
|
||||||
|
|
||||||
} else { return; }
|
//} else { return; }
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('click', '#OpenAllWIEntries', function () {
|
$(document).on('click', '#OpenAllWIEntries', function () {
|
||||||
|
@@ -1451,7 +1451,7 @@ input[type=search]:focus::-webkit-search-cancel-button {
|
|||||||
|
|
||||||
.avatar_div .menu_button,
|
.avatar_div .menu_button,
|
||||||
.form_create_bottom_buttons_block .menu_button,
|
.form_create_bottom_buttons_block .menu_button,
|
||||||
#select_chat_popup .menu_button {
|
#select_chat_import .menu_button {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@@ -1647,11 +1647,21 @@ input[type=search]:focus::-webkit-search-cancel-button {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#form_rename_world {
|
#form_rename_world,
|
||||||
|
#form_rename_chat {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-right: 50px;
|
|
||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
|
gap: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#form_rename_world {
|
||||||
|
margin-right: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#form_rename_chat {
|
||||||
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#form_rename_world input[type="submit"] {
|
#form_rename_world input[type="submit"] {
|
||||||
@@ -2351,12 +2361,26 @@ h5 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.select_chat_block .avatar {
|
.select_chat_block .avatar {
|
||||||
|
|
||||||
grid-row: span 2;
|
grid-row: span 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.select_chat_block_filename {
|
#select_chat_name_wrapper {
|
||||||
|
display: flex;
|
||||||
|
gap: 5px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select_chat_block_filename_item {
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
|
width: fit-content;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select_chat_block_filename {
|
||||||
|
flex: 1
|
||||||
|
}
|
||||||
|
|
||||||
|
.renameChatButton {
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.select_chat_block_mes {
|
.select_chat_block_mes {
|
||||||
@@ -3951,6 +3975,12 @@ body.waifuMode #avatar_zoom_popup {
|
|||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body:not(.waifuMode) #avatar_zoom_popup {
|
||||||
|
z-index: 999;
|
||||||
|
width: fit-content;
|
||||||
|
max-height: calc(60svh - 60px);
|
||||||
|
}
|
||||||
|
|
||||||
body.waifuMode #avatar_zoom_popup {
|
body.waifuMode #avatar_zoom_popup {
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
max-height: calc(60svh - 60px);
|
max-height: calc(60svh - 60px);
|
||||||
|
Reference in New Issue
Block a user