diff options
author | r <r@freesoftwareextremist.com> | 2023-09-09 08:12:56 +0000 |
---|---|---|
committer | r <r@freesoftwareextremist.com> | 2023-09-09 08:14:16 +0000 |
commit | 60ccc9686a39ff67d3cf361c4e6848d79877b18b (patch) | |
tree | 73c06bff6b3d2b8211641f323eceb98a80038faf | |
parent | 60392e61c714ad16c9b292180e447dac8f28fd59 (diff) | |
download | bloat-60ccc9686a39ff67d3cf361c4e6848d79877b18b.tar.gz bloat-60ccc9686a39ff67d3cf361c4e6848d79877b18b.zip |
fluoride: Allow submitting the form with Ctrl+Enter
-rw-r--r-- | static/fluoride.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/static/fluoride.js b/static/fluoride.js index e6a63ef..abeed21 100644 --- a/static/fluoride.js +++ b/static/fluoride.js @@ -285,6 +285,12 @@ function onPaste(e) { fp.files = dt.files; } +function onKeydown(e) { + if (e.key == 'Enter' && e.ctrlKey) { + document.querySelector(".post-form").submit(); + } +} + document.addEventListener("DOMContentLoaded", function() { checkCSRFToken(); checkAntiDopamineMode(); @@ -325,8 +331,10 @@ document.addEventListener("DOMContentLoaded", function() { } var pf = document.querySelector(".post-form") - if (pf) + if (pf) { pf.addEventListener("paste", onPaste); + pf.addEventListener("keydown", onKeydown); + } }); // @license-end |