diff options
Diffstat (limited to '')
-rw-r--r-- | static/script.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/static/script.js b/static/script.js index 7d3d2c29..a0d58c27 100644 --- a/static/script.js +++ b/static/script.js @@ -404,5 +404,14 @@ window.onload = function () { init_input_list(); + + document.addEventListener('keydown', function (event) { + if (event.key == '/') { + let searchbox = document.querySelector('.simplesearch [name=q]') + // focuses the input, and selects all the text in it + searchbox.select(); + event.preventDefault(); + } + }); } |