fluoride: Allow submitting the form with Ctrl+Enter

This commit is contained in:
r 2023-09-09 08:12:56 +00:00
parent 60392e61c7
commit 60ccc9686a

View File

@ -285,6 +285,12 @@ function onPaste(e) {
fp.files = dt.files; fp.files = dt.files;
} }
function onKeydown(e) {
if (e.key == 'Enter' && e.ctrlKey) {
document.querySelector(".post-form").submit();
}
}
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", function() {
checkCSRFToken(); checkCSRFToken();
checkAntiDopamineMode(); checkAntiDopamineMode();
@ -325,8 +331,10 @@ document.addEventListener("DOMContentLoaded", function() {
} }
var pf = document.querySelector(".post-form") var pf = document.querySelector(".post-form")
if (pf) if (pf) {
pf.addEventListener("paste", onPaste); pf.addEventListener("paste", onPaste);
pf.addEventListener("keydown", onKeydown);
}
}); });
// @license-end // @license-end