Simplify Build.thread arguments.
This commit is contained in:
parent
49a74fe6e1
commit
378d2be2da
@ -162,22 +162,22 @@ Build =
|
|||||||
textContent: Build.summaryText '', posts, files
|
textContent: Build.summaryText '', posts, files
|
||||||
href: "/#{boardID}/thread/#{threadID}"
|
href: "/#{boardID}/thread/#{threadID}"
|
||||||
|
|
||||||
thread: (board, data, OP) ->
|
thread: (thread, data) ->
|
||||||
if (root = OP.nodes.root.parentNode)
|
if (root = thread.OP.nodes.root.parentNode)
|
||||||
$.rmAll root
|
$.rmAll root
|
||||||
else
|
else
|
||||||
root = $.el 'div',
|
root = $.el 'div',
|
||||||
className: 'thread'
|
className: 'thread'
|
||||||
id: "t#{data.no}"
|
id: "t#{data.no}"
|
||||||
$.add root, Build.hat.cloneNode(false) if Build.hat
|
$.add root, Build.hat.cloneNode(false) if Build.hat
|
||||||
$.add root, OP.nodes.root
|
$.add root, thread.OP.nodes.root
|
||||||
if data.omitted_posts or !Conf['Show Replies'] and data.replies
|
if data.omitted_posts or !Conf['Show Replies'] and data.replies
|
||||||
[posts, files] = if Conf['Show Replies']
|
[posts, files] = if Conf['Show Replies']
|
||||||
# XXX data.omitted_images is not accurate.
|
# XXX data.omitted_images is not accurate.
|
||||||
[data.omitted_posts, data.images - data.last_replies.filter((data) -> !!data.ext).length]
|
[data.omitted_posts, data.images - data.last_replies.filter((data) -> !!data.ext).length]
|
||||||
else
|
else
|
||||||
[data.replies, data.images]
|
[data.replies, data.images]
|
||||||
summary = Build.summary board.ID, data.no, posts, files
|
summary = Build.summary thread.board.ID, data.no, posts, files
|
||||||
$.add root, summary
|
$.add root, summary
|
||||||
root
|
root
|
||||||
|
|
||||||
|
|||||||
@ -592,7 +592,7 @@ Index =
|
|||||||
posts.push OP
|
posts.push OP
|
||||||
thread.setPage i // Index.threadsNumPerPage + 1
|
thread.setPage i // Index.threadsNumPerPage + 1
|
||||||
|
|
||||||
Index.nodes[thread.ID] = Build.thread g.BOARD, threadData, OP
|
Index.nodes[thread.ID] = Build.thread thread, threadData
|
||||||
catch err
|
catch err
|
||||||
# Skip posts that we failed to parse.
|
# Skip posts that we failed to parse.
|
||||||
errors = [] unless errors
|
errors = [] unless errors
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user