Overboard compatibility.

This commit is contained in:
ccd0 2018-01-24 06:20:34 -08:00
parent 7a37c7cad0
commit 616f27963f
2 changed files with 7 additions and 3 deletions

View File

@ -10,7 +10,7 @@ Get =
excerpt
threadFromRoot: (root) ->
return null unless root?
g.threads["#{g.BOARD}.#{root.id.match(/\d*$/)[0]}"]
g.threads["#{root.dataset.board or g.BOARD.ID}.#{root.id.match(/\d*$/)[0]}"]
threadFromNode: (node) ->
Get.threadFromRoot $.x "ancestor-or-self::#{Site.xpath.thread}", node
postFromRoot: (root) ->

View File

@ -304,14 +304,18 @@ Main =
posts = []
for threadRoot in $$(s.thread, board)
thread = new Thread +threadRoot.id.match(/\d*$/)[0], g.BOARD
boardObj = if (boardID = threadRoot.dataset.board)
g.boards[boardID] or new Board(boardID)
else
g.BOARD
thread = new Thread +threadRoot.id.match(/\d*$/)[0], boardObj
thread.nodes.root = threadRoot
threads.push thread
postRoots = $$ s.postContainer, threadRoot
postRoots.unshift threadRoot if Site.isOPContainerThread
for postRoot in postRoots when $(s.comment, postRoot)
try
posts.push new Post postRoot, thread, g.BOARD
posts.push new Post postRoot, thread, thread.board
catch err
# Skip posts that we failed to parse.
unless errors