aboutsummaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
Diffstat (limited to 'static')
-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