From d8049013f55f28d5f694c3643754bdbbbbaed7fb Mon Sep 17 00:00:00 2001 From: Mayhem Date: Sat, 15 Feb 2014 22:35:15 +0100 Subject: [PATCH] Fix incorrect OP/cross-thread markers on some backlinks. --- src/Quotelinks/QuoteBacklink.coffee | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Quotelinks/QuoteBacklink.coffee b/src/Quotelinks/QuoteBacklink.coffee index e45a2a4c8..000b56a13 100644 --- a/src/Quotelinks/QuoteBacklink.coffee +++ b/src/Quotelinks/QuoteBacklink.coffee @@ -27,8 +27,8 @@ QuoteBacklink = for quoteID in @quotes (QuoteBacklink.map[quoteID] or= []).push @fullID continue unless (post = g.posts[quoteID]) and container = post?.nodes.backlinkContainer - for container in [container].concat post.clones.map((clone) -> clone.nodes.backlinkContainer) - $.add container, QuoteBacklink.buildBacklink @ + for post in [post].concat post.clones + $.add post.nodes.backlinkContainer, QuoteBacklink.buildBacklink post, @ return secondNode: -> # Don't backlink the OP. @@ -41,19 +41,19 @@ QuoteBacklink = if @fullID of QuoteBacklink.map for quoteID in QuoteBacklink.map[@fullID] if post = g.posts[quoteID] # Post hasn't been collected since. - $.add container, QuoteBacklink.buildBacklink post + $.add container, QuoteBacklink.buildBacklink @, post $.add @nodes.info, container - buildBacklink: (post) -> + buildBacklink: (quoted, quoter) -> frag = QuoteBacklink.frag.cloneNode true a = frag.lastElementChild - a.href = "/#{post.board}/res/#{post.thread}#p#{post}" - a.textContent = text = QuoteBacklink.funk post.ID - if post.isDead + a.href = "/#{quoter.board}/res/#{quoter.thread}#p#{quoter}" + a.textContent = text = QuoteBacklink.funk quoter.ID + if quoter.isDead $.addClass a, 'deadlink' - if post.isHidden + if quoter.isHidden $.addClass a, 'filtered' if Conf['Quote Markers'] - QuoteMarkers.parseQuotelink post, a, false, text + QuoteMarkers.parseQuotelink quoted, a, false, text if Conf['Quote Previewing'] $.on a, 'mouseover', QuotePreview.mouseover if Conf['Quote Inlining']