]>
Commit | Line | Data |
---|---|---|
39744467 BB |
1 | 'use strict'; |
2 | ||
3 | /* globals window */ | |
4 | ||
467390bc | 5 | ((w) => { |
39744467 BB |
6 | |
7 | const internals = { | |
39744467 BB |
8 | // Application entry point, for now just band to keyboard |
9 | ||
10 | main() { | |
11 | ||
467390bc | 12 | w.document.addEventListener('keydown', internals._onKeyDown); |
39744467 BB |
13 | }, |
14 | ||
15 | // Handles key events to point to the correct blog post. | |
16 | ||
467390bc | 17 | _onKeyDown(e) { |
39744467 | 18 | |
467390bc RBR |
19 | if (['1','2','3'].indexOf(e.key) > -1) { |
20 | w.location.hash = e.key; | |
39744467 BB |
21 | } |
22 | } | |
23 | }; | |
24 | ||
467390bc | 25 | w.addEventListener('load', internals.main); |
39744467 | 26 | })(window); |