keybinds: h/l - scroll left/right, H/L - move pages

This commit is contained in:
James Campos 2010-12-19 08:25:39 -08:00
parent 304c518a68
commit c498abc486
2 changed files with 32 additions and 18 deletions

View File

@ -468,10 +468,13 @@ keyModeNormal = (e) ->
count or= 1 count or= 1
switch char switch char
when "H" when "H"
if e.shiftKey
unless g.REPLY unless g.REPLY
temp = g.PAGENUM - count temp = g.PAGENUM - count
if temp < 0 then temp = 0 if temp < 0 then temp = 0
location.pathname = "/#{g.BOARD}/#{temp}#1" location.pathname = "/#{g.BOARD}/#{temp}#1"
else
window.scrollBy -20 * count, 0
when "I" when "I"
if g.reply if g.reply
unless qrLink = $ 'td.replyhl span[id] a:not(:first-child)' unless qrLink = $ 'td.replyhl span[id] a:not(:first-child)'
@ -527,10 +530,13 @@ keyModeNormal = (e) ->
else else
window.scrollBy 0, -20 * count window.scrollBy 0, -20 * count
when "L" when "L"
if e.shiftKey
unless g.REPLY unless g.REPLY
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}#0" location.pathname = "/#{g.BOARD}/#{temp}#0"
else
window.scrollBy 20 * count, 0
when "M" when "M"
if e.shiftKey if e.shiftKey
$("#imageExpand").click() $("#imageExpand").click()

View File

@ -593,6 +593,7 @@
count || (count = 1); count || (count = 1);
switch (char) { switch (char) {
case "H": case "H":
if (e.shiftKey) {
if (!g.REPLY) { if (!g.REPLY) {
temp = g.PAGENUM - count; temp = g.PAGENUM - count;
if (temp < 0) { if (temp < 0) {
@ -600,6 +601,9 @@
} }
return location.pathname = "/" + g.BOARD + "/" + temp + "#1"; return location.pathname = "/" + g.BOARD + "/" + temp + "#1";
} }
} else {
return window.scrollBy(-20 * count, 0);
}
break; break;
case "I": case "I":
if (g.reply) { if (g.reply) {
@ -681,6 +685,7 @@
} }
break; break;
case "L": case "L":
if (e.shiftKey) {
if (!g.REPLY) { if (!g.REPLY) {
temp = g.PAGENUM + count; temp = g.PAGENUM + count;
if (temp > 15) { if (temp > 15) {
@ -688,6 +693,9 @@
} }
return location.pathname = "/" + g.BOARD + "/" + temp + "#0"; return location.pathname = "/" + g.BOARD + "/" + temp + "#0";
} }
} else {
return window.scrollBy(20 * count, 0);
}
break; break;
case "M": case "M":
if (e.shiftKey) { if (e.shiftKey) {