From df62a454516cd6c5995bb2adea1b0bdb9803f4e2 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Fri, 26 Aug 2011 08:50:31 +0200 Subject: [PATCH] Fix quote features in expanded comments. close #195 --- 4chan_x.user.js | 17 ++++++++++++++++- script.coffee | 9 +++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 7b2c49e8e..0ace320ae 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -543,7 +543,7 @@ })); }, parse: function(req, a, threadID, replyID) { - var body, bq, reply, _i, _len, _ref; + var body, bq, quote, reply, _i, _j, _len, _len2, _ref, _ref2; if (req.status !== 200) { a.textContent = "" + req.status + " " + req.statusText; return; @@ -563,6 +563,21 @@ } } } + _ref2 = $$('a.quotelink', bq); + for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) { + quote = _ref2[_j]; + if (quote.getAttribute('href') === quote.hash) { + quote.pathname = "/" + g.BOARD + "/res/" + threadID; + } + if (conf['Quote Preview']) { + $.bind(quote, 'mouseover', quotePreview.mouseover); + $.bind(quote, 'mousemove', ui.hover); + $.bind(quote, 'mouseout', quotePreview.mouseout); + } + if (conf['Quote Inline']) { + $.bind(quote, 'click', quoteInline.toggle); + } + } return $.replace(a.parentNode.parentNode, bq); } }; diff --git a/script.coffee b/script.coffee index b0e9e7377..8a13e52e8 100644 --- a/script.coffee +++ b/script.coffee @@ -401,6 +401,15 @@ expandComment = if reply.id == replyID bq = $ 'blockquote', reply break + for quote in $$ 'a.quotelink', bq + if quote.getAttribute('href') is quote.hash + quote.pathname = "/#{g.BOARD}/res/#{threadID}" + if conf['Quote Preview'] + $.bind quote, 'mouseover', quotePreview.mouseover + $.bind quote, 'mousemove', ui.hover + $.bind quote, 'mouseout', quotePreview.mouseout + if conf['Quote Inline'] + $.bind quote, 'click', quoteInline.toggle $.replace a.parentNode.parentNode, bq expandThread =