keynav: m for (book)mark thread

This commit is contained in:
James Campos 2010-11-14 01:53:40 -08:00
parent 0af8cd6b3e
commit 16b6931afe
2 changed files with 10 additions and 3 deletions

View File

@ -370,7 +370,7 @@ iframeLoad = ->
keyboardNav = (e) -> keyboardNav = (e) ->
char = String.fromCharCode e.keyCode char = String.fromCharCode e.keyCode
unless char in '1234567890GHJKLOT' unless char in '1234567890GHJKLMOT'
return return
e.preventDefault() e.preventDefault()
hash = location.hash hash = location.hash
@ -413,6 +413,9 @@ keyboardNav = (e) ->
temp = g.PAGENUM + count temp = g.PAGENUM + count
if temp > 15 then temp = 15 if temp > 15 then temp = 15
location.pathname = "/#{g.BOARD}/#{temp}#1" location.pathname = "/#{g.BOARD}/#{temp}#1"
when "M"
img = $("#{hash} ~ img")
watch.call img
when "O" when "O"
qrLink = $ "#{hash} ~ span[id] a:not(:first-child)" qrLink = $ "#{hash} ~ span[id] a:not(:first-child)"
quickReply.call qrLink quickReply.call qrLink

View File

@ -456,9 +456,9 @@
return recaptchaReload(); return recaptchaReload();
}; };
keyboardNav = function(e) { keyboardNav = function(e) {
var _i, _len, char, count, hash, href, position, qrLink, temp; var _i, _len, char, count, hash, href, img, position, qrLink, temp;
char = String.fromCharCode(e.keyCode); char = String.fromCharCode(e.keyCode);
if (!((function(){ for (var _i=0, _len='1234567890GHJKLOT'.length; _i<_len; _i++) { if ('1234567890GHJKLOT'[_i] === char) return true; } return false; }).call(this))) { if (!((function(){ for (var _i=0, _len='1234567890GHJKLMOT'.length; _i<_len; _i++) { if ('1234567890GHJKLMOT'[_i] === char) return true; } return false; }).call(this))) {
return null; return null;
} }
e.preventDefault(); e.preventDefault();
@ -522,6 +522,10 @@
} }
location.pathname = ("/" + (g.BOARD) + "/" + (temp) + "#1"); location.pathname = ("/" + (g.BOARD) + "/" + (temp) + "#1");
break; break;
case "M":
img = $("" + (hash) + " ~ img");
watch.call(img);
break;
case "O": case "O":
qrLink = $("" + (hash) + " ~ span[id] a:not(:first-child)"); qrLink = $("" + (hash) + " ~ span[id] a:not(:first-child)");
quickReply.call(qrLink); quickReply.call(qrLink);