mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
- escape from edit message now focuses on send_textarea
- allow swipes to happen when send_textarea is focused but empty
This commit is contained in:
@ -3500,8 +3500,8 @@ $(document).ready(function () {
|
|||||||
}
|
}
|
||||||
chat[chat.length - 1]['swipe_id']++; //make new slot in array
|
chat[chat.length - 1]['swipe_id']++; //make new slot in array
|
||||||
// if message has memory attached - remove it to allow regen
|
// if message has memory attached - remove it to allow regen
|
||||||
if (chat[chat.length -1].extra && chat[chat.length -1].extra.memory) {
|
if (chat[chat.length - 1].extra && chat[chat.length - 1].extra.memory) {
|
||||||
delete chat[chat.length -1].extra.memory;
|
delete chat[chat.length - 1].extra.memory;
|
||||||
}
|
}
|
||||||
//console.log(chat[chat.length-1]['swipes']);
|
//console.log(chat[chat.length-1]['swipes']);
|
||||||
if (parseInt(chat[chat.length - 1]['swipe_id']) === chat[chat.length - 1]['swipes'].length) { //if swipe id of last message is the same as the length of the 'swipes' array
|
if (parseInt(chat[chat.length - 1]['swipe_id']) === chat[chat.length - 1]['swipes'].length) { //if swipe id of last message is the same as the length of the 'swipes' array
|
||||||
@ -5073,12 +5073,13 @@ $(document).ready(function () {
|
|||||||
$(document).keyup(function (e) {
|
$(document).keyup(function (e) {
|
||||||
if (e.key === "Escape") {
|
if (e.key === "Escape") {
|
||||||
closeMessageEditor();
|
closeMessageEditor();
|
||||||
|
$("#send_textarea").focus();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#bg-filter").on("input", function() {
|
$("#bg-filter").on("input", function () {
|
||||||
const filterValue = $(this).val().toLowerCase();
|
const filterValue = $(this).val().toLowerCase();
|
||||||
$("#bg_menu_content > div").each(function() {
|
$("#bg_menu_content > div").each(function () {
|
||||||
const $bgContent = $(this);
|
const $bgContent = $(this);
|
||||||
if ($bgContent.attr("title").toLowerCase().includes(filterValue)) {
|
if ($bgContent.attr("title").toLowerCase().includes(filterValue)) {
|
||||||
$bgContent.show();
|
$bgContent.show();
|
||||||
|
@ -655,9 +655,21 @@ $("document").ready(function () {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function isInputElementInFocus() {
|
function isInputElementInFocus() {
|
||||||
return $(document.activeElement).is(":input");
|
//return $(document.activeElement).is(":input");
|
||||||
|
var focused = $(':focus');
|
||||||
|
if (focused.is('input') || focused.is('textarea')) {
|
||||||
|
if (focused.attr('id') === 'send_textarea') {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Additional hotkeys CTRL+ENTER and CTRL+UPARROW
|
//Additional hotkeys CTRL+ENTER and CTRL+UPARROW
|
||||||
|
Reference in New Issue
Block a user