mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge pull request #2598 from NearEDGE/quick-impersonate-regenerate-buttons
Added quick Regenerate and Impersonate buttons
This commit is contained in:
@ -4161,6 +4161,12 @@
|
|||||||
Quick "Continue" button
|
Quick "Continue" button
|
||||||
</small>
|
</small>
|
||||||
</label>
|
</label>
|
||||||
|
<label class="checkbox_label" for="quick_impersonate" title="Show a button in the input area to ask the AI to impersonate your character for a single message." data-i18n="[title]Show a button in the input area to ask the AI to impersonate your character for a single message">
|
||||||
|
<input id="quick_impersonate" type="checkbox" />
|
||||||
|
<small data-i18n="Quick 'Impersonate' button">
|
||||||
|
Quick "Impersonate" button
|
||||||
|
</small>
|
||||||
|
</label>
|
||||||
<div class="checkbox-container flex-container">
|
<div class="checkbox-container flex-container">
|
||||||
<label data-newbie-hidden class="checkbox_label" for="swipes-checkbox" title="Show arrow buttons on the last in-chat message to generate alternative AI responses. Both PC and mobile." data-i18n="[title]Show arrow buttons on the last in-chat message to generate alternative AI responses. Both PC and mobile">
|
<label data-newbie-hidden class="checkbox_label" for="swipes-checkbox" title="Show arrow buttons on the last in-chat message to generate alternative AI responses. Both PC and mobile." data-i18n="[title]Show arrow buttons on the last in-chat message to generate alternative AI responses. Both PC and mobile">
|
||||||
<input id="swipes-checkbox" type="checkbox" />
|
<input id="swipes-checkbox" type="checkbox" />
|
||||||
@ -6371,6 +6377,7 @@
|
|||||||
<div id="mes_stop" title="Abort request" class="mes_stop" data-i18n="[title]Abort request">
|
<div id="mes_stop" title="Abort request" class="mes_stop" data-i18n="[title]Abort request">
|
||||||
<i class="fa-solid fa-circle-stop"></i>
|
<i class="fa-solid fa-circle-stop"></i>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="mes_impersonate" class="fa-solid fa-user-secret interactable displayNone" title="Ask AI to write your message for you" data-i18n="[title]Ask AI to write your message for you" tabindex="0"></div>
|
||||||
<div id="mes_continue" class="fa-fw fa-solid fa-arrow-right interactable displayNone" title="Continue the last message" data-i18n="[title]Continue the last message"></div>
|
<div id="mes_continue" class="fa-fw fa-solid fa-arrow-right interactable displayNone" title="Continue the last message" data-i18n="[title]Continue the last message"></div>
|
||||||
<div id="send_but" class="fa-solid fa-paper-plane interactable displayNone" title="Send a message" data-i18n="[title]Send a message"></div>
|
<div id="send_but" class="fa-solid fa-paper-plane interactable displayNone" title="Send a message" data-i18n="[title]Send a message"></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -5625,6 +5625,7 @@ export function activateSendButtons() {
|
|||||||
is_send_press = false;
|
is_send_press = false;
|
||||||
$('#send_but').removeClass('displayNone');
|
$('#send_but').removeClass('displayNone');
|
||||||
$('#mes_continue').removeClass('displayNone');
|
$('#mes_continue').removeClass('displayNone');
|
||||||
|
$('#mes_impersonate').removeClass('displayNone');
|
||||||
$('.mes_buttons:last').show();
|
$('.mes_buttons:last').show();
|
||||||
hideStopButton();
|
hideStopButton();
|
||||||
}
|
}
|
||||||
@ -5632,6 +5633,7 @@ export function activateSendButtons() {
|
|||||||
export function deactivateSendButtons() {
|
export function deactivateSendButtons() {
|
||||||
$('#send_but').addClass('displayNone');
|
$('#send_but').addClass('displayNone');
|
||||||
$('#mes_continue').addClass('displayNone');
|
$('#mes_continue').addClass('displayNone');
|
||||||
|
$('#mes_impersonate').addClass('displayNone');
|
||||||
showStopButton();
|
showStopButton();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -9112,14 +9114,14 @@ jQuery(async function () {
|
|||||||
$('#send_textarea').on('focusin focus click', () => {
|
$('#send_textarea').on('focusin focus click', () => {
|
||||||
S_TAPreviouslyFocused = true;
|
S_TAPreviouslyFocused = true;
|
||||||
});
|
});
|
||||||
$('#send_but, #option_regenerate, #option_continue, #mes_continue').on('click', () => {
|
$('#send_but, #option_regenerate, #option_continue, #mes_continue, #mes_impersonate').on('click', () => {
|
||||||
if (S_TAPreviouslyFocused) {
|
if (S_TAPreviouslyFocused) {
|
||||||
$('#send_textarea').focus();
|
$('#send_textarea').focus();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$(document).click(event => {
|
$(document).click(event => {
|
||||||
if ($(':focus').attr('id') !== 'send_textarea') {
|
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_impersonate', 'mes_continue', 'send_textarea', 'option_regenerate', 'option_continue'];
|
||||||
if (!validIDs.includes($(event.target).attr('id'))) {
|
if (!validIDs.includes($(event.target).attr('id'))) {
|
||||||
S_TAPreviouslyFocused = false;
|
S_TAPreviouslyFocused = false;
|
||||||
}
|
}
|
||||||
@ -9155,6 +9157,9 @@ jQuery(async function () {
|
|||||||
debouncedCharacterSearch(searchQuery);
|
debouncedCharacterSearch(searchQuery);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#mes_impersonate').on('click', function () {
|
||||||
|
$('#option_impersonate').trigger('click');
|
||||||
|
});
|
||||||
|
|
||||||
$('#mes_continue').on('click', function () {
|
$('#mes_continue').on('click', function () {
|
||||||
$('#option_continue').trigger('click');
|
$('#option_continue').trigger('click');
|
||||||
|
@ -311,6 +311,7 @@ function RA_checkOnlineStatus() {
|
|||||||
$('#send_form').addClass('no-connection'); //entire input form area is red when not connected
|
$('#send_form').addClass('no-connection'); //entire input form area is red when not connected
|
||||||
$('#send_but').addClass('displayNone'); //send button is hidden when not connected;
|
$('#send_but').addClass('displayNone'); //send button is hidden when not connected;
|
||||||
$('#mes_continue').addClass('displayNone'); //continue button is hidden when not connected;
|
$('#mes_continue').addClass('displayNone'); //continue button is hidden when not connected;
|
||||||
|
$('#mes_impersonate').addClass('displayNone'); //continue button is hidden when not connected;
|
||||||
$('#API-status-top').removeClass('fa-plug');
|
$('#API-status-top').removeClass('fa-plug');
|
||||||
$('#API-status-top').addClass('fa-plug-circle-exclamation redOverlayGlow');
|
$('#API-status-top').addClass('fa-plug-circle-exclamation redOverlayGlow');
|
||||||
connection_made = false;
|
connection_made = false;
|
||||||
@ -327,6 +328,7 @@ function RA_checkOnlineStatus() {
|
|||||||
if (!is_send_press && !(selected_group && is_group_generating)) {
|
if (!is_send_press && !(selected_group && is_group_generating)) {
|
||||||
$('#send_but').removeClass('displayNone'); //on connect, send button shows
|
$('#send_but').removeClass('displayNone'); //on connect, send button shows
|
||||||
$('#mes_continue').removeClass('displayNone'); //continue button is shown when connected
|
$('#mes_continue').removeClass('displayNone'); //continue button is shown when connected
|
||||||
|
$('#mes_impersonate').removeClass('displayNone'); //continue button is shown when connected
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -197,6 +197,7 @@ let power_user = {
|
|||||||
prefer_character_prompt: true,
|
prefer_character_prompt: true,
|
||||||
prefer_character_jailbreak: true,
|
prefer_character_jailbreak: true,
|
||||||
quick_continue: false,
|
quick_continue: false,
|
||||||
|
quick_impersonate: false,
|
||||||
continue_on_send: false,
|
continue_on_send: false,
|
||||||
trim_spaces: true,
|
trim_spaces: true,
|
||||||
relaxed_api_urls: false,
|
relaxed_api_urls: false,
|
||||||
@ -1592,7 +1593,9 @@ function loadPowerUserSettings(settings, data) {
|
|||||||
$('#trim_spaces').prop('checked', power_user.trim_spaces);
|
$('#trim_spaces').prop('checked', power_user.trim_spaces);
|
||||||
$('#continue_on_send').prop('checked', power_user.continue_on_send);
|
$('#continue_on_send').prop('checked', power_user.continue_on_send);
|
||||||
$('#quick_continue').prop('checked', power_user.quick_continue);
|
$('#quick_continue').prop('checked', power_user.quick_continue);
|
||||||
|
$('#quick_impersonate').prop('checked', power_user.quick_continue);
|
||||||
$('#mes_continue').css('display', power_user.quick_continue ? '' : 'none');
|
$('#mes_continue').css('display', power_user.quick_continue ? '' : 'none');
|
||||||
|
$('#mes_impersonate').css('display', power_user.quick_impersonate ? '' : 'none');
|
||||||
$('#gestures-checkbox').prop('checked', power_user.gestures);
|
$('#gestures-checkbox').prop('checked', power_user.gestures);
|
||||||
$('#auto_swipe').prop('checked', power_user.auto_swipe);
|
$('#auto_swipe').prop('checked', power_user.auto_swipe);
|
||||||
$('#auto_swipe_minimum_length').val(power_user.auto_swipe_minimum_length);
|
$('#auto_swipe_minimum_length').val(power_user.auto_swipe_minimum_length);
|
||||||
@ -3739,6 +3742,13 @@ $(document).ready(() => {
|
|||||||
saveSettingsDebounced();
|
saveSettingsDebounced();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#quick_impersonate').on('input', function () {
|
||||||
|
const value = !!$(this).prop('checked');
|
||||||
|
power_user.quick_impersonate = value;
|
||||||
|
$('#mes_impersonate').css('display', value ? '' : 'none');
|
||||||
|
saveSettingsDebounced();
|
||||||
|
});
|
||||||
|
|
||||||
$('#trim_spaces').on('input', function () {
|
$('#trim_spaces').on('input', function () {
|
||||||
const value = !!$(this).prop('checked');
|
const value = !!$(this).prop('checked');
|
||||||
power_user.trim_spaces = value;
|
power_user.trim_spaces = value;
|
||||||
|
@ -723,6 +723,10 @@ body .panelControlBar {
|
|||||||
order: 1;
|
order: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#mes_impersonate {
|
||||||
|
order: 1;
|
||||||
|
}
|
||||||
|
|
||||||
#send_form .mes_stop {
|
#send_form .mes_stop {
|
||||||
display: none;
|
display: none;
|
||||||
order: 2;
|
order: 2;
|
||||||
|
Reference in New Issue
Block a user