From 72c70cff6b2c88a6e6bb71d26efc10d0494c8898 Mon Sep 17 00:00:00 2001 From: James Campos Date: Tue, 26 Apr 2011 06:17:28 -0700 Subject: [PATCH] keybinds: 0 --- 4chan_x.js | 4 ++++ script.coffee | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/4chan_x.js b/4chan_x.js index 1fd572de5..b8b50cc10 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -624,6 +624,8 @@ } else { if (kc === 27) { key = ''; + } else if ((48 <= kc && kc <= 57)) { + key = String.fromCharCode(kc); } } return keybinds.key = key; @@ -659,6 +661,8 @@ var thread; thread = nav.getThread(); switch (keybinds.key) { + case '0': + return window.location = "/" + g.BOARD + "/#0"; case 'I': return keybinds.qr(thread); case 'J': diff --git a/script.coffee b/script.coffee index ddec01074..7aefecad0 100644 --- a/script.coffee +++ b/script.coffee @@ -440,6 +440,8 @@ keybinds = else if kc is 27 key = '' + else if 48 <= kc <= 57 #0-9 + key = String.fromCharCode kc keybinds.key = key keypress: (e) -> @@ -471,6 +473,8 @@ keybinds = normal: (e) -> thread = nav.getThread() switch keybinds.key + when '0' + window.location = "/#{g.BOARD}/#0" when 'I' keybinds.qr thread when 'J'