aboutsummaryrefslogtreecommitdiff
path: root/static/js
diff options
context:
space:
mode:
authorBen Beltran <ben@nsovocal.com>2017-07-03 00:55:32 -0500
committerBen Beltran <ben@nsovocal.com>2017-07-03 00:55:32 -0500
commit5e265f9d81bcce30949e88850892ea5dacec7386 (patch)
tree056dfe345174027335cc033359dfbe14a8d53250 /static/js
parent4ae55e0673a61c50f1f7f378f6461d0388f66bd5 (diff)
parentbe33bb82f6276b05a3861df8a7c5138ac320a00b (diff)
Merge branch 'release/1.0.0'
Diffstat (limited to 'static/js')
-rw-r--r--static/js/blog.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/static/js/blog.js b/static/js/blog.js
new file mode 100644
index 0000000..a49a72f
--- /dev/null
+++ b/static/js/blog.js
@@ -0,0 +1,28 @@
+'use strict';
+
+/* globals window */
+
+((window) => {
+
+ const internals = {
+ kEntryPoint: '.event-details',
+
+ // Application entry point, for now just band to keyboard
+
+ main() {
+
+ window.document.addEventListener('keydown', internals._onKeyDown);
+ },
+
+ // Handles key events to point to the correct blog post.
+
+ _onKeyDown(event) {
+
+ if (['1','2','3'].indexOf(event.key) > -1) {
+ window.location.hash = event.key;
+ }
+ }
+ };
+
+ window.addEventListener('load', internals.main);
+})(window);