aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2023-09-09 08:12:56 +0000
committerr <r@freesoftwareextremist.com>2023-09-09 08:14:16 +0000
commit60ccc9686a39ff67d3cf361c4e6848d79877b18b (patch)
tree73c06bff6b3d2b8211641f323eceb98a80038faf
parent60392e61c714ad16c9b292180e447dac8f28fd59 (diff)
downloadbloat-60ccc9686a39ff67d3cf361c4e6848d79877b18b.tar.gz
bloat-60ccc9686a39ff67d3cf361c4e6848d79877b18b.zip
fluoride: Allow submitting the form with Ctrl+Enter
-rw-r--r--static/fluoride.js10
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