mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Added quick Regenerate and Impersonate buttons
Additional buttons mimic the behavior of the continue button.
This commit is contained in:
@ -5610,6 +5610,8 @@ export function activateSendButtons() {
|
||||
is_send_press = false;
|
||||
$('#send_but').removeClass('displayNone');
|
||||
$('#mes_continue').removeClass('displayNone');
|
||||
$('#mes_regenerate').removeClass('displayNone');
|
||||
$('#mes_impersonate').removeClass('displayNone');
|
||||
$('.mes_buttons:last').show();
|
||||
hideStopButton();
|
||||
}
|
||||
@ -5617,6 +5619,8 @@ export function activateSendButtons() {
|
||||
export function deactivateSendButtons() {
|
||||
$('#send_but').addClass('displayNone');
|
||||
$('#mes_continue').addClass('displayNone');
|
||||
$('#mes_regenerate').addClass('displayNone');
|
||||
$('#mes_impersonate').addClass('displayNone');
|
||||
showStopButton();
|
||||
}
|
||||
|
||||
@ -9095,14 +9099,14 @@ jQuery(async function () {
|
||||
$('#send_textarea').on('focusin focus click', () => {
|
||||
S_TAPreviouslyFocused = true;
|
||||
});
|
||||
$('#send_but, #option_regenerate, #option_continue, #mes_continue').on('click', () => {
|
||||
$('#send_but, #option_regenerate, #option_continue, #mes_continue, #mes_regenerate, #mes_impersonate').on('click', () => {
|
||||
if (S_TAPreviouslyFocused) {
|
||||
$('#send_textarea').focus();
|
||||
}
|
||||
});
|
||||
$(document).click(event => {
|
||||
if ($(':focus').attr('id') !== 'send_textarea') {
|
||||
var validIDs = ['options_button', 'send_but', 'mes_continue', 'send_textarea', 'option_regenerate', 'option_continue'];
|
||||
var validIDs = ['options_button', 'send_but', 'mes_regenerate', 'mes_impersonate', 'mes_continue', 'send_textarea', 'option_regenerate', 'option_continue'];
|
||||
if (!validIDs.includes($(event.target).attr('id'))) {
|
||||
S_TAPreviouslyFocused = false;
|
||||
}
|
||||
@ -9139,6 +9143,14 @@ jQuery(async function () {
|
||||
});
|
||||
|
||||
|
||||
$('#mes_regenerate').on('click', function () {
|
||||
$('#option_regenerate').trigger('click');
|
||||
});
|
||||
|
||||
$('#mes_impersonate').on('click', function () {
|
||||
$('#option_impersonate').trigger('click');
|
||||
});
|
||||
|
||||
$('#mes_continue').on('click', function () {
|
||||
$('#option_continue').trigger('click');
|
||||
});
|
||||
|
Reference in New Issue
Block a user