From e6954fd254343a42ab274721652dc002bbe29b77 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 2 May 2012 11:14:43 +0200 Subject: [PATCH] Update Next/Previous board page navigation. --- 4chan_x.user.js | 10 +++++----- script.coffee | 6 ++++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index fda862808..9716b4420 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1071,7 +1071,7 @@ return $.on(d, 'keydown', Keybinds.keydown); }, 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)) { return; } @@ -1132,13 +1132,13 @@ window.location = "/" + g.BOARD + "/0#0"; break; case Conf.nextPage: - if ((_ref = $('input[value=Next]')) != null) { - _ref.click(); + if (link = $('link[rel=next]', d.head)) { + window.location = link.href; } break; case Conf.previousPage: - if ((_ref1 = $('input[value=Previous]')) != null) { - _ref1.click(); + if (link = $('link[rel=prev]', d.head)) { + window.location.href = link.href; } break; case Conf.nextThread: diff --git a/script.coffee b/script.coffee index 95aaf8f6d..9b2cae76f 100644 --- a/script.coffee +++ b/script.coffee @@ -888,9 +888,11 @@ Keybinds = when Conf.zero window.location = "/#{g.BOARD}/0#0" when Conf.nextPage - $('input[value=Next]')?.click() + if link = $ 'link[rel=next]', d.head + window.location = link.href when Conf.previousPage - $('input[value=Previous]')?.click() + if link = $ 'link[rel=prev]', d.head + window.location.href = link.href # Thread Navigation when Conf.nextThread return if g.REPLY