my eye

Bind q to focus query input

Committed 8e415e

--- a/canopy/static/enliven.js
+++ b/canopy/static/enliven.js

     } else {
       switch (ev.key) {
         case '?': goHelp(); break                    // ?   show help
+        case 'q': focusQuery(ev); break              // q   focus query input
         case 'f': showKeyboardFollowLinks(); break   // f   show "follow links"
         case 'm': goHome(); break                    // m   go home
         case 'd': close(); break                     // d   close page
 const em = parseFloat(getComputedStyle(document.documentElement).fontSize)
 
 const goHelp = () => { go('/help') }
+const focusQuery = ev => {
+  document.querySelector('input[name=q]').focus()
+  ev.preventDefault()
+}
 const goHome = () => { go(document.querySelector("a[rel=home]").href) }
 const close = () => { window.close() }
 const reload = () => { window.location.reload() }