Overboard compatibility.
This commit is contained in:
parent
7a37c7cad0
commit
616f27963f
@ -10,7 +10,7 @@ Get =
|
|||||||
excerpt
|
excerpt
|
||||||
threadFromRoot: (root) ->
|
threadFromRoot: (root) ->
|
||||||
return null unless 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) ->
|
threadFromNode: (node) ->
|
||||||
Get.threadFromRoot $.x "ancestor-or-self::#{Site.xpath.thread}", node
|
Get.threadFromRoot $.x "ancestor-or-self::#{Site.xpath.thread}", node
|
||||||
postFromRoot: (root) ->
|
postFromRoot: (root) ->
|
||||||
|
|||||||
@ -304,14 +304,18 @@ Main =
|
|||||||
posts = []
|
posts = []
|
||||||
|
|
||||||
for threadRoot in $$(s.thread, board)
|
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
|
thread.nodes.root = threadRoot
|
||||||
threads.push thread
|
threads.push thread
|
||||||
postRoots = $$ s.postContainer, threadRoot
|
postRoots = $$ s.postContainer, threadRoot
|
||||||
postRoots.unshift threadRoot if Site.isOPContainerThread
|
postRoots.unshift threadRoot if Site.isOPContainerThread
|
||||||
for postRoot in postRoots when $(s.comment, postRoot)
|
for postRoot in postRoots when $(s.comment, postRoot)
|
||||||
try
|
try
|
||||||
posts.push new Post postRoot, thread, g.BOARD
|
posts.push new Post postRoot, thread, thread.board
|
||||||
catch err
|
catch err
|
||||||
# Skip posts that we failed to parse.
|
# Skip posts that we failed to parse.
|
||||||
unless errors
|
unless errors
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user