mirror of
https://git.freesoftwareextremist.com/bloat
synced 2024-12-22 09:10:42 +00:00
fluoride: Allow submitting the form with Ctrl+Enter
This commit is contained in:
parent
60392e61c7
commit
60ccc9686a
1 changed files with 9 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue