- made right swipe highlight when next swipe will generate

- added a swipe counter below right swipe
(could add a toggle for displaying it later)
- removed spammy console.logs from expressions index.js
- swipes no longer trigger under the following conditions:
- - when an input it focused
- - when character_popup or history popup are visible
- - when send_textarea has something typed into it
(I think this a bit too restrictive, may seek a smarter way to handle it)

ISSUE: Pyg repeating gens cause swipes animation to lag/freeze
not sure what is the cause, but should seek to remedy somehow.
This commit is contained in:
RossAsscends
2023-03-18 12:34:18 +09:00
parent 07c6f09be2
commit de27382e50
4 changed files with 116 additions and 40 deletions

View File

@@ -294,6 +294,10 @@ $("document").ready(function () {
}
});
function isInputElementInFocus() {
return $(document.activeElement).is(":input");
}
//Additional hotkeys CTRL+ENTER and CTRL+UPARROW
document.addEventListener("keydown", (event) => {
if (event.ctrlKey && event.key == "Enter") {
@@ -316,11 +320,36 @@ $("document").ready(function () {
ClearLocal();
}
if (event.key == "ArrowLeft") { //swipes left
$('.swipe_left:last').click();
}
if (event.key == "ArrowRight") { //swipes right
$('.swipe_right:last').click();
}
});
/* console.log('SWIPE FILTER -- ' +
$("#send_textarea").val() + ' ' +
$("#character_popup").css("display") + ' ' +
$("#shadow_select_chat_popup").css("display") + ' ' +
isInputElementInFocus()); */
})
if (
$("#send_textarea").val() === '' &&
$("#character_popup").css("display") === "none" &&
$("#shadow_select_chat_popup").css("display") === "none" &&
!isInputElementInFocus()
) {
$('.swipe_left:last').click();
}
}
if (event.key == "ArrowRight") { //swipes right
/* console.log('SWIPE FILTER -- ' +
$("#send_textarea").val() + ' ' +
$("#character_popup").css("display") + ' ' +
$("#shadow_select_chat_popup").css("display") + ' ' +
isInputElementInFocus()); */
if (
$("#send_textarea").val() === '' &&
$("#character_popup").css("display") === "none" &&
$("#shadow_select_chat_popup").css("display") === "none" &&
!isInputElementInFocus()
) {
$('.swipe_right:last').click();
}
};
})
});