From cbdc10a2cae9de141a348edcbc0d558e82e2b765 Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Wed, 28 Aug 2024 13:22:22 +0200 Subject: [PATCH] Add CTRL+S save shortcut --- templates/index.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/templates/index.html b/templates/index.html index 00d31f4..1f20417 100644 --- a/templates/index.html +++ b/templates/index.html @@ -23,6 +23,15 @@ ev.preventDefault(); } + function keyDownHandler(ev) { + if (ev.ctrlKey && ev.key == 's') { + ev.preventDefault(); + + let textarea = document.getElementById('text'); + textarea.form.submit(); + } + } + function openFile() { let input = document.createElement("input"); input.type = "file"; @@ -61,7 +70,7 @@
- +