Move total token counter. Tighten the UI

This commit is contained in:
Cohee
2023-08-21 17:00:28 +03:00
parent c735bf546a
commit 05d719107f
4 changed files with 17 additions and 44 deletions

View File

@@ -195,7 +195,6 @@ export {
setEditedMessageId,
setSendButtonState,
selectRightMenuWithAnimation,
setRightTabSelectedClass,
openCharacterChat,
saveChat,
messageFormatting,
@@ -5819,7 +5818,7 @@ function selectRightMenuWithAnimation(selectedMenuId) {
'rm_api_block': 'grid',
'rm_characters_block': 'flex',
};
$('#hideCharPanelAvatarButton').toggle(selectedMenuId === 'rm_ch_create_block');
$('#result_info').toggle(selectedMenuId === 'rm_ch_create_block');
document.querySelectorAll('#right-nav-panel .right_menu').forEach((menu) => {
$(menu).css('display', 'none');
@@ -5837,16 +5836,6 @@ function selectRightMenuWithAnimation(selectedMenuId) {
})
}
function setRightTabSelectedClass(selectedButtonId) {
document.querySelectorAll('#right-nav-panel-tabs .right_menu_button').forEach((button) => {
button.classList.remove('selected-right-tab');
if (selectedButtonId && selectedButtonId.replace('#', '') === button.id) {
button.classList.add('selected-right-tab');
}
});
}
function select_rm_info(type, charId, previousCharId = null) {
if (!type) {
toastr.error(`Invalid process (no 'type')`);
@@ -5909,7 +5898,6 @@ function select_rm_info(type, charId, previousCharId = null) {
}
}
}, 100);
setRightTabSelectedClass();
if (previousCharId) {
const newId = characters.findIndex((x) => x.avatar == previousCharId);
@@ -5926,7 +5914,6 @@ export function select_selected_character(chid) {
menu_type = "character_edit";
$("#delete_button").css("display", "flex");
$("#export_button").css("display", "flex");
setRightTabSelectedClass('rm_button_selected_ch');
var display_name = characters[chid].name;
//create text poles
@@ -6001,8 +5988,6 @@ function select_rm_create() {
}
selectRightMenuWithAnimation('rm_ch_create_block');
setRightTabSelectedClass();
$('#set_chat_scenario').hide();
$("#delete_button_div").css("display", "none");
@@ -6049,7 +6034,6 @@ function select_rm_create() {
function select_rm_characters() {
menu_type = "characters";
selectRightMenuWithAnimation('rm_characters_block');
setRightTabSelectedClass('rm_button_characters');
printCharacters(false); // Do a quick refresh of the characters list
}
@@ -7369,7 +7353,6 @@ export async function deleteCharacter(name, avatar) {
name2 = systemUserName;
chat = [...safetychat];
chat_metadata = {};
setRightTabSelectedClass();
$(document.getElementById("rm_button_selected_ch")).children("h2").text("");
clearChat();
this_chid = undefined;
@@ -7485,7 +7468,6 @@ $(document).ready(function () {
selected_button = "settings";
menu_type = "settings";
selectRightMenuWithAnimation('rm_api_block');
setRightTabSelectedClass('rm_button_settings');
});
$("#rm_button_characters").click(function () {
selected_button = "characters";
@@ -9242,7 +9224,7 @@ $(document).ready(function () {
doCharListDisplaySwitch();
});
$("#hideCharPanelAvatarButton").hide().on('click', () => {
$("#hideCharPanelAvatarButton").on('click', () => {
$('#avatar-and-name-block').slideToggle()
});
});