Old way of handling quotelinks in clones was leaving resurrected quotes out of @quotes and putting duplicates in @nodes.quotelinks.

This commit is contained in:
ccd0 2015-12-13 18:30:28 -08:00
parent 5e31c289b7
commit 30adbd6fa2
3 changed files with 7 additions and 7 deletions

View File

@ -10,12 +10,9 @@ Quotify =
cb: @node
node: ->
return if @isClone
for deadlink in $$ '.deadlink', @nodes.comment
if @isClone
if $.hasClass deadlink, 'quotelink'
@nodes.quotelinks.push deadlink
else
Quotify.parseDeadlink.call @, deadlink
Quotify.parseDeadlink.call @, deadlink
return
parseDeadlink: (deadlink) ->

View File

@ -1,4 +1,6 @@
class Clone extends Post
isClone: true
constructor: (@origin, @context, contractThumb) ->
for key in ['ID', 'fullID', 'board', 'thread', 'info', 'quotes', 'isReply']
# Copy or point to the origin's key value.
@ -62,6 +64,7 @@ class Clone extends Post
@nodes.date = $ '.dateTime', info
@parseQuotes()
@quotes = [@origin.quotes...]
if @origin.file
# Copy values, point to relevant elements.
@ -87,7 +90,6 @@ class Clone extends Post
ImageExpand.contract @ if @file.thumb and contractThumb
@isDead = true if @origin.isDead
@isClone = true
root.dataset.clone = @origin.clones.push(@) - 1
cloneWithoutVideo: (node) ->

View File

@ -163,13 +163,14 @@ class Post
# - catalog links. (>>>/b/catalog or >>>/b/search)
# - rules links. (>>>/a/rules)
# - text-board quotelinks. (>>>/img/1234)
return unless match = quotelink.href.match ///
match = quotelink.href.match ///
^https?://boards\.4chan\.org/+
([^/]+) # boardID
/+(?:res|thread)/+\d+(?:/[^#]*)?#p
(\d+) # postID
$
///
return unless match or (@isClone and quotelink.dataset.postID) # normal or resurrected quote
@nodes.quotelinks.push quotelink