Remove capcode replies-related code as it's not relevant anymore.
This commit is contained in:
parent
dcae343687
commit
5ae957b0e2
@ -27,7 +27,6 @@ Build =
|
|||||||
date: data.now
|
date: data.now
|
||||||
dateUTC: data.time
|
dateUTC: data.time
|
||||||
comment: data.com
|
comment: data.com
|
||||||
capcodeReplies: data.capcode_replies
|
|
||||||
# thread status
|
# thread status
|
||||||
isSticky: !!data.sticky
|
isSticky: !!data.sticky
|
||||||
isClosed: !!data.closed
|
isClosed: !!data.closed
|
||||||
@ -55,7 +54,7 @@ Build =
|
|||||||
postID, threadID, boardID
|
postID, threadID, boardID
|
||||||
name, capcode, tripcode, uniqueID, email, subject, flagCode, flagName, date, dateUTC
|
name, capcode, tripcode, uniqueID, email, subject, flagCode, flagName, date, dateUTC
|
||||||
isSticky, isClosed
|
isSticky, isClosed
|
||||||
comment, capcodeReplies
|
comment
|
||||||
file
|
file
|
||||||
} = o
|
} = o
|
||||||
isOP = postID is threadID
|
isOP = postID is threadID
|
||||||
@ -248,36 +247,4 @@ Build =
|
|||||||
continue if href[0] is '/' # Cross-board quote, or board link
|
continue if href[0] is '/' # Cross-board quote, or board link
|
||||||
quote.href = "/#{boardID}/res/#{href}" # Fix pathnames
|
quote.href = "/#{boardID}/res/#{href}" # Fix pathnames
|
||||||
|
|
||||||
Build.capcodeReplies {boardID, threadID, root: container, capcodeReplies}
|
|
||||||
|
|
||||||
container
|
container
|
||||||
|
|
||||||
capcodeReplies: ({boardID, threadID, bq, root, capcodeReplies}) ->
|
|
||||||
return unless capcodeReplies
|
|
||||||
|
|
||||||
generateCapcodeReplies = (capcodeType, array) ->
|
|
||||||
"<span class=smaller><span class=bold>#{
|
|
||||||
switch capcodeType
|
|
||||||
when 'admin'
|
|
||||||
'Administrator'
|
|
||||||
when 'mod'
|
|
||||||
'Moderator'
|
|
||||||
when 'developer'
|
|
||||||
'Developer'
|
|
||||||
} Repl#{if array.length > 1 then 'ies' else 'y'}:</span> #{
|
|
||||||
array.map (ID) ->
|
|
||||||
"<a href='/#{boardID}/res/#{threadID}#p#{ID}' class=quotelink>>>#{ID}</a>"
|
|
||||||
.join ' '
|
|
||||||
}</span><br>"
|
|
||||||
html = []
|
|
||||||
for capcodeType, array of capcodeReplies
|
|
||||||
html.push generateCapcodeReplies capcodeType, array
|
|
||||||
|
|
||||||
bq or= $ 'blockquote', root
|
|
||||||
$.add bq, [
|
|
||||||
$.el 'br'
|
|
||||||
$.el 'br'
|
|
||||||
$.el 'span',
|
|
||||||
className: 'capcodeReplies'
|
|
||||||
innerHTML: html.join ''
|
|
||||||
]
|
|
||||||
|
|||||||
@ -62,13 +62,12 @@ class Post
|
|||||||
# <br> -> \n
|
# <br> -> \n
|
||||||
# Remove:
|
# Remove:
|
||||||
# 'Comment too long'...
|
# 'Comment too long'...
|
||||||
# Admin/Mod/Dev replies. (/q/)
|
|
||||||
# EXIF data. (/p/)
|
# EXIF data. (/p/)
|
||||||
# Rolls. (/tg/)
|
# Rolls. (/tg/)
|
||||||
# Preceding and following new lines.
|
# Preceding and following new lines.
|
||||||
# Trailing spaces.
|
# Trailing spaces.
|
||||||
bq = @nodes.comment.cloneNode true
|
bq = @nodes.comment.cloneNode true
|
||||||
for node in $$ '.abbr, .capcodeReplies, .exif, b', bq
|
for node in $$ '.abbr, .exif, b', bq
|
||||||
$.rm node
|
$.rm node
|
||||||
text = []
|
text = []
|
||||||
# XPathResult.ORDERED_NODE_SNAPSHOT_TYPE === 7
|
# XPathResult.ORDERED_NODE_SNAPSHOT_TYPE === 7
|
||||||
@ -100,8 +99,7 @@ class Post
|
|||||||
|
|
||||||
@nodes.quotelinks.push quotelink
|
@nodes.quotelinks.push quotelink
|
||||||
|
|
||||||
# Don't count capcode replies as quotes in OPs. (Admin/Mod/Dev Replies: ...)
|
return if @isClone
|
||||||
return if @isClone or !@isReply and $.hasClass quotelink.parentNode.parentNode, 'capcodeReplies'
|
|
||||||
|
|
||||||
# ES6 Set when?
|
# ES6 Set when?
|
||||||
fullID = "#{match[1]}.#{match[2]}"
|
fullID = "#{match[1]}.#{match[2]}"
|
||||||
|
|||||||
@ -48,11 +48,6 @@ ExpandComment =
|
|||||||
href = quote.getAttribute 'href'
|
href = quote.getAttribute 'href'
|
||||||
continue if href[0] is '/' # Cross-board quote, or board link
|
continue if href[0] is '/' # Cross-board quote, or board link
|
||||||
quote.href = "/#{post.board}/res/#{href}" # Fix pathnames
|
quote.href = "/#{post.board}/res/#{href}" # Fix pathnames
|
||||||
Build.capcodeReplies
|
|
||||||
boardID: post.board.ID
|
|
||||||
threadID: post.thread.ID
|
|
||||||
bq: clone
|
|
||||||
capcodeReplies: postObj.capcode_replies
|
|
||||||
post.nodes.shortComment = comment
|
post.nodes.shortComment = comment
|
||||||
$.replace comment, clone
|
$.replace comment, clone
|
||||||
post.nodes.comment = post.nodes.longComment = clone
|
post.nodes.comment = post.nodes.longComment = clone
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user