Update Next/Previous board page navigation.

This commit is contained in:
Nicolas Stepien 2012-05-02 11:14:43 +02:00
parent 8bbddc262e
commit e6954fd254
2 changed files with 9 additions and 7 deletions

View File

@ -1071,7 +1071,7 @@
return $.on(d, 'keydown', Keybinds.keydown); return $.on(d, 'keydown', Keybinds.keydown);
}, },
keydown: function(e) { keydown: function(e) {
var key, o, range, selEnd, selStart, ta, thread, value, _ref, _ref1; var key, link, o, range, selEnd, selStart, ta, thread, value;
if (!(key = Keybinds.keyCode(e)) || /TEXTAREA|INPUT/.test(e.target.nodeName) && !(e.altKey || e.ctrlKey || e.keyCode === 27)) { if (!(key = Keybinds.keyCode(e)) || /TEXTAREA|INPUT/.test(e.target.nodeName) && !(e.altKey || e.ctrlKey || e.keyCode === 27)) {
return; return;
} }
@ -1132,13 +1132,13 @@
window.location = "/" + g.BOARD + "/0#0"; window.location = "/" + g.BOARD + "/0#0";
break; break;
case Conf.nextPage: case Conf.nextPage:
if ((_ref = $('input[value=Next]')) != null) { if (link = $('link[rel=next]', d.head)) {
_ref.click(); window.location = link.href;
} }
break; break;
case Conf.previousPage: case Conf.previousPage:
if ((_ref1 = $('input[value=Previous]')) != null) { if (link = $('link[rel=prev]', d.head)) {
_ref1.click(); window.location.href = link.href;
} }
break; break;
case Conf.nextThread: case Conf.nextThread:

View File

@ -888,9 +888,11 @@ Keybinds =
when Conf.zero when Conf.zero
window.location = "/#{g.BOARD}/0#0" window.location = "/#{g.BOARD}/0#0"
when Conf.nextPage when Conf.nextPage
$('input[value=Next]')?.click() if link = $ 'link[rel=next]', d.head
window.location = link.href
when Conf.previousPage when Conf.previousPage
$('input[value=Previous]')?.click() if link = $ 'link[rel=prev]', d.head
window.location.href = link.href
# Thread Navigation # Thread Navigation
when Conf.nextThread when Conf.nextThread
return if g.REPLY return if g.REPLY