Move this code into Build.catalogReply function.
This commit is contained in:
parent
236a3b8ba9
commit
0d3ad8a1ec
@ -224,3 +224,18 @@ Build =
|
||||
$.addClass root, 'noFile' unless thread.OP.file
|
||||
|
||||
root
|
||||
|
||||
catalogReply: (thread, data) ->
|
||||
excerpt = ''
|
||||
if data.com
|
||||
excerpt = Build.parseCommentDisplay(data.com).replace(/>>\d+/g, '').trim().replace(/\n+/g, ' // ')
|
||||
if data.ext
|
||||
excerpt or= "#{data.filename}#{data.ext}"
|
||||
if data.com
|
||||
excerpt or= Build.unescape data.com.replace(/<br\b[^<]*>/gi, ' // ')
|
||||
excerpt or= '\xA0'
|
||||
excerpt = "#{excerpt[...70]}..." if excerpt.length > 73
|
||||
|
||||
link = Build.postURL thread.board.ID, thread.ID, data.no
|
||||
$.el 'div', {className: 'catalog-reply'},
|
||||
<%= readHTML('CatalogReply.html') %>
|
||||
|
||||
@ -690,19 +690,7 @@ Index =
|
||||
|
||||
replies = []
|
||||
for data in lastReplies
|
||||
excerpt = ''
|
||||
if data.com
|
||||
excerpt = Build.parseCommentDisplay(data.com).replace(/>>\d+/g, '').trim().replace(/\n+/g, ' // ')
|
||||
if data.ext
|
||||
excerpt or= "#{data.filename}#{data.ext}"
|
||||
if data.com
|
||||
excerpt or= Build.unescape data.com.replace(/<br\b[^<]*>/gi, ' // ')
|
||||
excerpt or= '\xA0'
|
||||
excerpt = "#{excerpt[...70]}..." if excerpt.length > 73
|
||||
|
||||
link = Build.postURL thread.board.ID, thread.ID, data.no
|
||||
reply = $.el 'div', {className: 'catalog-reply'},
|
||||
<%= readHTML('CatalogReply.html') %>
|
||||
reply = Build.catalogReply thread, data
|
||||
RelativeDates.update $('time', reply)
|
||||
$.on $('.catalog-reply-preview', reply), 'mouseover', QuotePreview.mouseover
|
||||
replies.push reply
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user