From 075568e4d743049eda7fa178ebaa2d7d168c3caa Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 16 May 2012 14:53:33 +0200 Subject: [PATCH] Fix forwardlinks when previewing from an inlined post. --- 4chan_x.user.js | 2 +- script.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 341a8cd57..aa27efb2a 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -3203,7 +3203,7 @@ $.addClass(el, 'qphl'); } } - replyID = $.x('ancestor::div[contains(@class,"postContainer")]', this).id.slice(2); + replyID = $.x('ancestor::div[contains(@class,"postContainer")]', this).id.match(/\d+$/)[0]; _ref = $$('.quotelink, .backlink', qp); for (_i = 0, _len = _ref.length; _i < _len; _i++) { quote = _ref[_i]; diff --git a/script.coffee b/script.coffee index 1ed25ed4e..7055b03d6 100644 --- a/script.coffee +++ b/script.coffee @@ -2431,7 +2431,7 @@ QuotePreview = $.addClass el.parentNode, 'qphl' else $.addClass el, 'qphl' - replyID = $.x('ancestor::div[contains(@class,"postContainer")]', @).id[2..] + replyID = $.x('ancestor::div[contains(@class,"postContainer")]', @).id.match(/\d+$/)[0] for quote in $$ '.quotelink, .backlink', qp if quote.hash[2..] is replyID $.addClass quote, 'forwardlink'