diff --git a/4chan_x.coffee b/4chan_x.coffee index b15aa2d3b..b088b3a57 100644 --- a/4chan_x.coffee +++ b/4chan_x.coffee @@ -468,10 +468,13 @@ keyModeNormal = (e) -> count or= 1 switch char when "H" - unless g.REPLY - temp = g.PAGENUM - count - if temp < 0 then temp = 0 - location.pathname = "/#{g.BOARD}/#{temp}#1" + if e.shiftKey + unless g.REPLY + temp = g.PAGENUM - count + if temp < 0 then temp = 0 + location.pathname = "/#{g.BOARD}/#{temp}#1" + else + window.scrollBy -20 * count, 0 when "I" if g.reply unless qrLink = $ 'td.replyhl span[id] a:not(:first-child)' @@ -527,10 +530,13 @@ keyModeNormal = (e) -> else window.scrollBy 0, -20 * count when "L" - unless g.REPLY - temp = g.PAGENUM + count - if temp > 15 then temp = 15 - location.pathname = "/#{g.BOARD}/#{temp}#0" + if e.shiftKey + unless g.REPLY + temp = g.PAGENUM + count + if temp > 15 then temp = 15 + location.pathname = "/#{g.BOARD}/#{temp}#0" + else + window.scrollBy 20 * count, 0 when "M" if e.shiftKey $("#imageExpand").click() diff --git a/4chan_x.js b/4chan_x.js index 8b1f3d3bb..29a6df295 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -593,12 +593,16 @@ count || (count = 1); switch (char) { case "H": - if (!g.REPLY) { - temp = g.PAGENUM - count; - if (temp < 0) { - temp = 0; + if (e.shiftKey) { + if (!g.REPLY) { + temp = g.PAGENUM - count; + if (temp < 0) { + temp = 0; + } + return location.pathname = "/" + g.BOARD + "/" + temp + "#1"; } - return location.pathname = "/" + g.BOARD + "/" + temp + "#1"; + } else { + return window.scrollBy(-20 * count, 0); } break; case "I": @@ -681,12 +685,16 @@ } break; case "L": - if (!g.REPLY) { - temp = g.PAGENUM + count; - if (temp > 15) { - temp = 15; + if (e.shiftKey) { + if (!g.REPLY) { + temp = g.PAGENUM + count; + if (temp > 15) { + temp = 15; + } + return location.pathname = "/" + g.BOARD + "/" + temp + "#0"; } - return location.pathname = "/" + g.BOARD + "/" + temp + "#0"; + } else { + return window.scrollBy(20 * count, 0); } break; case "M":