mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
char panel buttons into dropdown; sheld width fix
This commit is contained in:
@ -2381,23 +2381,48 @@
|
|||||||
<img id="avatar_load_preview" src="img/ai4.png" alt="avatar">
|
<img id="avatar_load_preview" src="img/ai4.png" alt="avatar">
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-container flexFlowColumn">
|
<div class="flex-container flexFlowColumn">
|
||||||
|
<label for="char-management-dropdown">
|
||||||
|
<select id="char-management-dropdown">
|
||||||
|
<option value="default" disabled selected>Options</option>
|
||||||
|
<option id="set_character_world">
|
||||||
|
<i class="fa-solid fa-globe"></i> Link to World Info
|
||||||
|
</option>
|
||||||
|
<option id="set_chat_scenario">
|
||||||
|
Scenario Override
|
||||||
|
</option>
|
||||||
|
<option id="renameCharButton">
|
||||||
|
Rename
|
||||||
|
</option>
|
||||||
|
<option id="dupe_button">
|
||||||
|
Duplicate
|
||||||
|
</option>
|
||||||
|
<option id="export_button">
|
||||||
|
Export
|
||||||
|
</option>
|
||||||
|
<option id="delete_button">
|
||||||
|
Delete
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
|
||||||
<div class="form_create_bottom_buttons_block">
|
<div class="form_create_bottom_buttons_block">
|
||||||
<label for="add_avatar_button" class="menu_button fa-solid fa-file-image " title="Click to select a new avatar for this character">
|
<label for="add_avatar_button" class="menu_button fa-solid fa-file-image " title="Click to select a new avatar for this character">
|
||||||
<input type="file" id="add_avatar_button" name="avatar" accept="image/png, image/jpeg, image/jpg, image/gif, image/bmp">
|
<input type="file" id="add_avatar_button" name="avatar" accept="image/png, image/jpeg, image/jpg, image/gif, image/bmp">
|
||||||
</label>
|
</label>
|
||||||
<div id="rm_button_back" class="menu_button fa-solid fa-left-long "></div>
|
<div id="rm_button_back" class="menu_button fa-solid fa-left-long "></div>
|
||||||
<div id="renameCharButton" class="menu_button fa-solid fa-user-pen" title="Rename Character"></div>
|
|
||||||
|
<!-- <div id="renameCharButton" class="menu_button fa-solid fa-user-pen" title="Rename Character"></div> -->
|
||||||
<div id="favorite_button" class="menu_button fa-solid fa-star" title="Add to Favorites"></div>
|
<div id="favorite_button" class="menu_button fa-solid fa-star" title="Add to Favorites"></div>
|
||||||
<input type="hidden" id="fav_checkbox" name="fav" />
|
<input type="hidden" id="fav_checkbox" name="fav" />
|
||||||
<div id="advanced_div" class="menu_button fa-solid fa-book " title="Advanced Definitions"></div>
|
<div id="advanced_div" class="menu_button fa-solid fa-book " title="Advanced Definitions"></div>
|
||||||
<div id="export_button" class="menu_button fa-solid fa-file-export " title="Export and Download"></div>
|
<!-- <div id="export_button" class="menu_button fa-solid fa-file-export " title="Export and Download"></div> -->
|
||||||
<div id="set_chat_scenario" class="menu_button fa-solid fa-scroll" title="Set a chat scenario override"></div>
|
<!-- <div id="set_chat_scenario" class="menu_button fa-solid fa-scroll" title="Set a chat scenario override"></div> -->
|
||||||
<div id="set_character_world" class="menu_button fa-solid fa-globe" title="Set a character World Info / Lorebook"></div>
|
<!-- <div id="set_character_world" class="menu_button fa-solid fa-globe" title="Set a character World Info / Lorebook"></div> -->
|
||||||
<div id="dupe_button" class="menu_button fa-solid fa-clone " title="Duplicate Character"></div>
|
<!-- <div id="dupe_button" class="menu_button fa-solid fa-clone " title="Duplicate Character"></div> -->
|
||||||
<label for="create_button" id="create_button_label" class="menu_button fa-solid fa-user-check" title="Create Character">
|
<label for="create_button" id="create_button_label" class="menu_button fa-solid fa-user-check" title="Create Character">
|
||||||
<input type="submit" id="create_button" name="create_button">
|
<input type="submit" id="create_button" name="create_button">
|
||||||
</label>
|
</label>
|
||||||
<div id="delete_button" class="menu_button fa-solid fa-skull " title="Delete Character"></div>
|
<!-- <div id="delete_button" class="menu_button fa-solid fa-skull " title="Delete Character"></div> -->
|
||||||
</div>
|
</div>
|
||||||
<div id="result_info" class="justifyCenter flex-container" title="Token counts may be inaccurate and provided just for reference."> </div>
|
<div id="result_info" class="justifyCenter flex-container" title="Token counts may be inaccurate and provided just for reference."> </div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -273,7 +273,7 @@ let is_mes_reload_avatar = false;
|
|||||||
let optionsPopper = Popper.createPopper(document.getElementById('options_button'), document.getElementById('options'), {
|
let optionsPopper = Popper.createPopper(document.getElementById('options_button'), document.getElementById('options'), {
|
||||||
placement: 'top-start'
|
placement: 'top-start'
|
||||||
});
|
});
|
||||||
let exportPopper = Popper.createPopper(document.getElementById('export_button'), document.getElementById('export_format_popup'), {
|
let exportPopper = Popper.createPopper(document.getElementById('char-management-dropdown'), document.getElementById('export_format_popup'), {
|
||||||
placement: 'left'
|
placement: 'left'
|
||||||
});
|
});
|
||||||
let rawPromptPopper = Popper.createPopper(document.getElementById('dialogue_popup'), document.getElementById('rawPromptPopup'), {
|
let rawPromptPopper = Popper.createPopper(document.getElementById('dialogue_popup'), document.getElementById('rawPromptPopup'), {
|
||||||
@ -2776,6 +2776,19 @@ function getMultigenAmount() {
|
|||||||
return this_amount_gen;
|
return this_amount_gen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function DupeChar() {
|
||||||
|
const body = { avatar_url: characters[this_chid].avatar };
|
||||||
|
const response = await fetch('/dupecharacter', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: getRequestHeaders(),
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
});
|
||||||
|
if (response.ok) {
|
||||||
|
toastr.success("Character Duplicated");
|
||||||
|
getCharacters();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function promptItemize(itemizedPrompts, requestedMesId) {
|
function promptItemize(itemizedPrompts, requestedMesId) {
|
||||||
console.log('PROMPT ITEMIZE ENTERED');
|
console.log('PROMPT ITEMIZE ENTERED');
|
||||||
var incomingMesId = Number(requestedMesId);
|
var incomingMesId = Number(requestedMesId);
|
||||||
@ -6405,7 +6418,7 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
$("#form_create").submit(createOrEditCharacter);
|
$("#form_create").submit(createOrEditCharacter);
|
||||||
|
|
||||||
$("#delete_button").click(function () {
|
/* $("#delete_button").click(function () {
|
||||||
popup_type = "del_ch";
|
popup_type = "del_ch";
|
||||||
callPopup(`
|
callPopup(`
|
||||||
<h3>Delete the character?</h3>
|
<h3>Delete the character?</h3>
|
||||||
@ -6413,7 +6426,7 @@ $(document).ready(function () {
|
|||||||
THIS WILL ALSO DELETE ALL<br>
|
THIS WILL ALSO DELETE ALL<br>
|
||||||
OF THE CHARACTER'S CHAT FILES.<br><br></b>`
|
OF THE CHARACTER'S CHAT FILES.<br><br></b>`
|
||||||
);
|
);
|
||||||
});
|
}); */
|
||||||
|
|
||||||
$("#rm_info_button").click(function () {
|
$("#rm_info_button").click(function () {
|
||||||
$("#rm_info_avatar").html("");
|
$("#rm_info_avatar").html("");
|
||||||
@ -6460,7 +6473,7 @@ $(document).ready(function () {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#renameCharButton").on('click', renameCharacter);
|
/* $("#renameCharButton").on('click', renameCharacter); */
|
||||||
|
|
||||||
$(document).on("click", ".renameChatButton", async function () {
|
$(document).on("click", ".renameChatButton", async function () {
|
||||||
const old_filenamefull = $(this).closest('.select_chat_block_wrapper').find('.select_chat_block_filename').text();
|
const old_filenamefull = $(this).closest('.select_chat_block_wrapper').find('.select_chat_block_filename').text();
|
||||||
@ -6644,7 +6657,7 @@ $(document).ready(function () {
|
|||||||
if (!isMouseOverButtonOrMenu() && menu.is(':visible')) { hideMenu(); }
|
if (!isMouseOverButtonOrMenu() && menu.is(':visible')) { hideMenu(); }
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#set_chat_scenario').on('click', setScenarioOverride);
|
/* $('#set_chat_scenario').on('click', setScenarioOverride); */
|
||||||
|
|
||||||
///////////// OPTIMIZED LISTENERS FOR LEFT SIDE OPTIONS POPUP MENU //////////////////////
|
///////////// OPTIMIZED LISTENERS FOR LEFT SIDE OPTIONS POPUP MENU //////////////////////
|
||||||
|
|
||||||
@ -7183,10 +7196,10 @@ $(document).ready(function () {
|
|||||||
importCharacter(file);
|
importCharacter(file);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$("#export_button").click(function (e) {
|
/* $("#export_button").click(function (e) {
|
||||||
$('#export_format_popup').toggle();
|
$('#export_format_popup').toggle();
|
||||||
exportPopper.update();
|
exportPopper.update();
|
||||||
});
|
}); */
|
||||||
$(document).on('click', '.export_format', async function () {
|
$(document).on('click', '.export_format', async function () {
|
||||||
const format = $(this).data('format');
|
const format = $(this).data('format');
|
||||||
|
|
||||||
@ -7266,7 +7279,7 @@ $(document).ready(function () {
|
|||||||
select_rm_characters();
|
select_rm_characters();
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#dupe_button").click(async function () {
|
/* $("#dupe_button").click(async function () {
|
||||||
|
|
||||||
const body = { avatar_url: characters[this_chid].avatar };
|
const body = { avatar_url: characters[this_chid].avatar };
|
||||||
const response = await fetch('/dupecharacter', {
|
const response = await fetch('/dupecharacter', {
|
||||||
@ -7278,7 +7291,7 @@ $(document).ready(function () {
|
|||||||
toastr.success("Character Duplicated");
|
toastr.success("Character Duplicated");
|
||||||
getCharacters();
|
getCharacters();
|
||||||
}
|
}
|
||||||
});
|
}); */
|
||||||
|
|
||||||
$(document).on("click", ".select_chat_block, .bookmark_link, .mes_bookmark", async function () {
|
$(document).on("click", ".select_chat_block, .bookmark_link, .mes_bookmark", async function () {
|
||||||
let file_name = $(this).hasClass('mes_bookmark')
|
let file_name = $(this).hasClass('mes_bookmark')
|
||||||
@ -7431,7 +7444,7 @@ $(document).ready(function () {
|
|||||||
$("#world_popup_entries_list").children().find('.up').click()
|
$("#world_popup_entries_list").children().find('.up').click()
|
||||||
});
|
});
|
||||||
$(document).on('click', '.open_alternate_greetings', openAlternateGreetings);
|
$(document).on('click', '.open_alternate_greetings', openAlternateGreetings);
|
||||||
$('#set_character_world').on('click', openCharacterWorldPopup);
|
/* $('#set_character_world').on('click', openCharacterWorldPopup); */
|
||||||
|
|
||||||
$(document).keyup(function (e) {
|
$(document).keyup(function (e) {
|
||||||
if (e.key === "Escape") {
|
if (e.key === "Escape") {
|
||||||
@ -7464,6 +7477,39 @@ $(document).ready(function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#char-management-dropdown").on('change', (e) => {
|
||||||
|
let target = $(e.target.selectedOptions).attr('id');
|
||||||
|
switch (target) {
|
||||||
|
case 'set_character_world':
|
||||||
|
openCharacterWorldPopup();
|
||||||
|
break;
|
||||||
|
case 'set_chat_scenario':
|
||||||
|
setScenarioOverride();
|
||||||
|
break;
|
||||||
|
case 'renameCharButton':
|
||||||
|
renameCharacter();
|
||||||
|
break;
|
||||||
|
case 'dupe_button':
|
||||||
|
DupeChar();
|
||||||
|
break;
|
||||||
|
case 'export_button':
|
||||||
|
$('#export_format_popup').toggle();
|
||||||
|
exportPopper.update();
|
||||||
|
break;
|
||||||
|
case 'delete_button':
|
||||||
|
popup_type = "del_ch";
|
||||||
|
callPopup(`
|
||||||
|
<h3>Delete the character?</h3>
|
||||||
|
<b>THIS IS PERMANENT!<br><br>
|
||||||
|
THIS WILL ALSO DELETE ALL<br>
|
||||||
|
OF THE CHARACTER'S CHAT FILES.<br><br></b>`
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$("#char-management-dropdown").prop('selectedIndex', 0);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
$(document).on('click', '.mes_img_enlarge', enlargeMessageImage);
|
$(document).on('click', '.mes_img_enlarge', enlargeMessageImage);
|
||||||
$(document).on('click', '.mes_img_delete', deleteMessageImage);
|
$(document).on('click', '.mes_img_delete', deleteMessageImage);
|
||||||
|
|
||||||
|
@ -10,6 +10,8 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: none;
|
display: none;
|
||||||
|
max-width: 100%;
|
||||||
|
overflow-x: scroll;
|
||||||
}
|
}
|
||||||
|
|
||||||
#quickReplies {
|
#quickReplies {
|
||||||
|
@ -4431,6 +4431,7 @@ body.waifuMode #avatar_zoom_popup {
|
|||||||
#send_form {
|
#send_form {
|
||||||
border: 1px solid var(--grey30);
|
border: 1px solid var(--grey30);
|
||||||
backdrop-filter: blur(calc(var(--SmartThemeBlurStrength) * 2));
|
backdrop-filter: blur(calc(var(--SmartThemeBlurStrength) * 2));
|
||||||
|
max-width: 100dvw;
|
||||||
}
|
}
|
||||||
|
|
||||||
#chat {
|
#chat {
|
||||||
|
Reference in New Issue
Block a user