Fix incorrect OP/cross-thread markers on some backlinks.
This commit is contained in:
parent
7df0fd1414
commit
d8049013f5
@ -27,8 +27,8 @@ QuoteBacklink =
|
|||||||
for quoteID in @quotes
|
for quoteID in @quotes
|
||||||
(QuoteBacklink.map[quoteID] or= []).push @fullID
|
(QuoteBacklink.map[quoteID] or= []).push @fullID
|
||||||
continue unless (post = g.posts[quoteID]) and container = post?.nodes.backlinkContainer
|
continue unless (post = g.posts[quoteID]) and container = post?.nodes.backlinkContainer
|
||||||
for container in [container].concat post.clones.map((clone) -> clone.nodes.backlinkContainer)
|
for post in [post].concat post.clones
|
||||||
$.add container, QuoteBacklink.buildBacklink @
|
$.add post.nodes.backlinkContainer, QuoteBacklink.buildBacklink post, @
|
||||||
return
|
return
|
||||||
secondNode: ->
|
secondNode: ->
|
||||||
# Don't backlink the OP.
|
# Don't backlink the OP.
|
||||||
@ -41,19 +41,19 @@ QuoteBacklink =
|
|||||||
if @fullID of QuoteBacklink.map
|
if @fullID of QuoteBacklink.map
|
||||||
for quoteID in QuoteBacklink.map[@fullID]
|
for quoteID in QuoteBacklink.map[@fullID]
|
||||||
if post = g.posts[quoteID] # Post hasn't been collected since.
|
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
|
$.add @nodes.info, container
|
||||||
buildBacklink: (post) ->
|
buildBacklink: (quoted, quoter) ->
|
||||||
frag = QuoteBacklink.frag.cloneNode true
|
frag = QuoteBacklink.frag.cloneNode true
|
||||||
a = frag.lastElementChild
|
a = frag.lastElementChild
|
||||||
a.href = "/#{post.board}/res/#{post.thread}#p#{post}"
|
a.href = "/#{quoter.board}/res/#{quoter.thread}#p#{quoter}"
|
||||||
a.textContent = text = QuoteBacklink.funk post.ID
|
a.textContent = text = QuoteBacklink.funk quoter.ID
|
||||||
if post.isDead
|
if quoter.isDead
|
||||||
$.addClass a, 'deadlink'
|
$.addClass a, 'deadlink'
|
||||||
if post.isHidden
|
if quoter.isHidden
|
||||||
$.addClass a, 'filtered'
|
$.addClass a, 'filtered'
|
||||||
if Conf['Quote Markers']
|
if Conf['Quote Markers']
|
||||||
QuoteMarkers.parseQuotelink post, a, false, text
|
QuoteMarkers.parseQuotelink quoted, a, false, text
|
||||||
if Conf['Quote Previewing']
|
if Conf['Quote Previewing']
|
||||||
$.on a, 'mouseover', QuotePreview.mouseover
|
$.on a, 'mouseover', QuotePreview.mouseover
|
||||||
if Conf['Quote Inlining']
|
if Conf['Quote Inlining']
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user