keybinds: h/l - scroll left/right, H/L - move pages
This commit is contained in:
parent
304c518a68
commit
c498abc486
@ -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()
|
||||
|
||||
28
4chan_x.js
28
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":
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user