Let Post class handle parsing reply link.

This commit is contained in:
ccd0 2016-04-28 10:03:19 -07:00
parent 2e8a187e26
commit 9e5ccf155d
3 changed files with 6 additions and 2 deletions

View File

@ -11,7 +11,7 @@ ThreadLinks =
node: -> node: ->
return if @isReply or @isClone return if @isReply or @isClone
ThreadLinks.process $('.replylink', @nodes.info) ThreadLinks.process @nodes.reply
catalogNode: -> catalogNode: ->
ThreadLinks.process @nodes.thumb.parentNode ThreadLinks.process @nodes.thumb.parentNode

View File

@ -36,6 +36,9 @@ Post.Clone = class extends Post
else else
@nodes.backlinks = info.getElementsByClassName 'backlink' @nodes.backlinks = info.getElementsByClassName 'backlink'
unless @isReply
@nodes.reply = $ '.replylink', info
# Remove inlined posts inside of this post. # Remove inlined posts inside of this post.
for inline in $$ '.inline', post for inline in $$ '.inline', post
$.rm inline $.rm inline

View File

@ -33,12 +33,13 @@ class Post
else else
@nodes.backlinks = info.getElementsByClassName 'backlink' @nodes.backlinks = info.getElementsByClassName 'backlink'
unless @isReply = $.hasClass post, 'reply' unless (@isReply = $.hasClass post, 'reply')
@thread.OP = @ @thread.OP = @
@thread.isArchived = !!$ '.archivedIcon', info @thread.isArchived = !!$ '.archivedIcon', info
@thread.isSticky = !!$ '.stickyIcon', info @thread.isSticky = !!$ '.stickyIcon', info
@thread.isClosed = @thread.isArchived or !!$ '.closedIcon', info @thread.isClosed = @thread.isArchived or !!$ '.closedIcon', info
@thread.kill() if @thread.isArchived @thread.kill() if @thread.isArchived
@nodes.reply = $ '.replylink', info
@info = {} @info = {}
@info.nameBlock = if Conf['Anonymize'] @info.nameBlock = if Conf['Anonymize']