Abstract bindings for site help and add for keyboard
Committed a34464
--- a/canopy/templates/template.html
+++ b/canopy/templates/template.html
cookies.set('rhythm', 'on')
}
} else if (ev.key == 'f') showKeyboardFollowLinks() // f show "follow links"
+ else if (ev.key == '?') goHelp() // ? show help
else if (ev.key == 'h') goBack() // h go back
else if (ev.key == 'j') scrollDown() // j scroll down 3 EMs
else if (ev.key == 'k') scrollUp() // k scroll up 3 EMs
const em = parseFloat(getComputedStyle(document.documentElement).fontSize)
+const goHelp = () => { go('/help') }
const goHome = () => { go(document.querySelector("a[rel=home]").href) }
const goUp = () => { go(document.querySelector("a[rel=up]").href) }
const goPrevious = () => { go(document.querySelector("a[rel=prev]").href) }
partialContainer.innerHTML = ''
return
}
- if (input == 'help') { // help
- go('/help')
- } else if (input.startsWith('query for')) { // query for
+ if (input == 'help') goHelp() // help
+ else if (input.startsWith('query for')) { // query for
const query = input.slice(10)
go(`/search?q=$${query}`)
} else if (input.startsWith('go')) { // go