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
|
count or= 1
|
||||||
switch char
|
switch char
|
||||||
when "H"
|
when "H"
|
||||||
unless g.REPLY
|
if e.shiftKey
|
||||||
temp = g.PAGENUM - count
|
unless g.REPLY
|
||||||
if temp < 0 then temp = 0
|
temp = g.PAGENUM - count
|
||||||
location.pathname = "/#{g.BOARD}/#{temp}#1"
|
if temp < 0 then temp = 0
|
||||||
|
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"
|
||||||
unless g.REPLY
|
if e.shiftKey
|
||||||
temp = g.PAGENUM + count
|
unless g.REPLY
|
||||||
if temp > 15 then temp = 15
|
temp = g.PAGENUM + count
|
||||||
location.pathname = "/#{g.BOARD}/#{temp}#0"
|
if temp > 15 then temp = 15
|
||||||
|
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()
|
||||||
|
|||||||
28
4chan_x.js
28
4chan_x.js
@ -593,12 +593,16 @@
|
|||||||
count || (count = 1);
|
count || (count = 1);
|
||||||
switch (char) {
|
switch (char) {
|
||||||
case "H":
|
case "H":
|
||||||
if (!g.REPLY) {
|
if (e.shiftKey) {
|
||||||
temp = g.PAGENUM - count;
|
if (!g.REPLY) {
|
||||||
if (temp < 0) {
|
temp = g.PAGENUM - count;
|
||||||
temp = 0;
|
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;
|
break;
|
||||||
case "I":
|
case "I":
|
||||||
@ -681,12 +685,16 @@
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "L":
|
case "L":
|
||||||
if (!g.REPLY) {
|
if (e.shiftKey) {
|
||||||
temp = g.PAGENUM + count;
|
if (!g.REPLY) {
|
||||||
if (temp > 15) {
|
temp = g.PAGENUM + count;
|
||||||
temp = 15;
|
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;
|
break;
|
||||||
case "M":
|
case "M":
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user