mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge branch 'staging' into anachronous/release
This commit is contained in:
@ -18,6 +18,7 @@ import {
|
||||
eventSource,
|
||||
menu_type,
|
||||
substituteParams,
|
||||
callPopup,
|
||||
} from '../script.js';
|
||||
|
||||
import {
|
||||
@ -996,9 +997,31 @@ export function initRossMods() {
|
||||
console.debug('Accepting edits with Ctrl+Enter');
|
||||
editMesDone.trigger('click');
|
||||
} else if (is_send_press == false) {
|
||||
console.debug('Regenerating with Ctrl+Enter');
|
||||
$('#option_regenerate').click();
|
||||
$('#options').hide();
|
||||
const skipConfirmKey = 'RegenerateWithCtrlEnter';
|
||||
const skipConfirm = LoadLocalBool(skipConfirmKey);
|
||||
function doRegenerate() {
|
||||
console.debug('Regenerating with Ctrl+Enter');
|
||||
$('#option_regenerate').trigger('click');
|
||||
$('#options').hide();
|
||||
}
|
||||
if (skipConfirm) {
|
||||
doRegenerate();
|
||||
} else {
|
||||
const popupText = `
|
||||
<div class="marginBot10">Are you sure you want to regenerate the latest message?</div>
|
||||
<label class="checkbox_label justifyCenter" for="regenerateWithCtrlEnter">
|
||||
<input type="checkbox" id="regenerateWithCtrlEnter">
|
||||
Don't ask again
|
||||
</label>`;
|
||||
callPopup(popupText, 'confirm').then(result =>{
|
||||
if (!result) {
|
||||
return;
|
||||
}
|
||||
const regenerateWithCtrlEnter = $('#regenerateWithCtrlEnter').prop('checked');
|
||||
SaveLocal(skipConfirmKey, regenerateWithCtrlEnter);
|
||||
doRegenerate();
|
||||
});
|
||||
}
|
||||
} else {
|
||||
console.debug('Ctrl+Enter ignored');
|
||||
}
|
||||
@ -1054,11 +1077,12 @@ export function initRossMods() {
|
||||
}
|
||||
|
||||
if (event.key == 'ArrowUp') { //edits last message if chatbar is empty and focused
|
||||
//console.log('got uparrow input');
|
||||
console.log('got uparrow input');
|
||||
if (
|
||||
$('#send_textarea').val() === '' &&
|
||||
chatbarInFocus === true &&
|
||||
$('.swipe_right:last').css('display') === 'flex' &&
|
||||
//$('.swipe_right:last').css('display') === 'flex' &&
|
||||
$('.last_mes .mes_buttons').is(':visible') &&
|
||||
$('#character_popup').css('display') === 'none' &&
|
||||
$('#shadow_select_chat_popup').css('display') === 'none'
|
||||
) {
|
||||
|
Reference in New Issue
Block a user