hotkey / to focus search

This commit is contained in:
Ted Unangst 2023-08-26 14:56:28 -04:00
parent 2c5a051376
commit 0ba146c00c
2 changed files with 6 additions and 1 deletions

View File

@ -52,7 +52,7 @@
<li><a href="/help/honk.1.html">help</a> <li><a href="/help/honk.1.html">help</a>
<li> <li>
<form action="/q" method="GET"> <form action="/q" method="GET">
<input type="text" name="q" autocomplete=off size=10 placeholder="search"> <input type="text" name="q" autocomplete=off size=10 id="searchbox" placeholder="search">
</form> </form>
</ul> </ul>
</details> </details>

View File

@ -457,6 +457,11 @@ document.addEventListener("keydown", function(e) {
case "KeyK": case "KeyK":
scrollprevioushonk(); scrollprevioushonk();
break; break;
case "Slash":
document.getElementById("topmenu").open = true
document.getElementById("searchbox").focus()
e.preventDefault()
break
} }
}) })