We only have to look for one thread when visiting thread pages.
This commit is contained in:
parent
b8dac71456
commit
bddb032dac
@ -202,8 +202,7 @@ Index =
|
|||||||
posts.push new Post postRoot, thread, g.BOARD
|
posts.push new Post postRoot, thread, g.BOARD
|
||||||
catch err
|
catch err
|
||||||
# Skip posts that we failed to parse.
|
# Skip posts that we failed to parse.
|
||||||
unless errors
|
errors = [] unless errors
|
||||||
errors = []
|
|
||||||
errors.push
|
errors.push
|
||||||
message: "Parsing of Post No.#{postRoot.id.match /\d+/} failed. Post will be skipped."
|
message: "Parsing of Post No.#{postRoot.id.match /\d+/} failed. Post will be skipped."
|
||||||
error: err
|
error: err
|
||||||
|
|||||||
@ -169,26 +169,21 @@ Main =
|
|||||||
# Something might have gone wrong!
|
# Something might have gone wrong!
|
||||||
Main.initStyle()
|
Main.initStyle()
|
||||||
|
|
||||||
if g.VIEW is 'thread' and board = $ '.board'
|
if g.VIEW is 'thread' and threadRoot = $ '.thread'
|
||||||
threads = []
|
thread = new Thread +threadRoot.id[1..], g.BOARD
|
||||||
posts = []
|
posts = []
|
||||||
|
for postRoot in $$ '.thread > .postContainer', threadRoot
|
||||||
for threadRoot in $$ '.board > .thread', board
|
try
|
||||||
thread = new Thread +threadRoot.id[1..], g.BOARD
|
posts.push new Post postRoot, thread, g.BOARD
|
||||||
threads.push thread
|
catch err
|
||||||
for postRoot in $$ '.thread > .postContainer', threadRoot
|
# Skip posts that we failed to parse.
|
||||||
try
|
errors = [] unless errors
|
||||||
posts.push new Post postRoot, thread, g.BOARD
|
errors.push
|
||||||
catch err
|
message: "Parsing of Post No.#{postRoot.id.match /\d+/} failed. Post will be skipped."
|
||||||
# Skip posts that we failed to parse.
|
error: err
|
||||||
unless errors
|
|
||||||
errors = []
|
|
||||||
errors.push
|
|
||||||
message: "Parsing of Post No.#{postRoot.id.match /\d+/} failed. Post will be skipped."
|
|
||||||
error: err
|
|
||||||
Main.handleErrors errors if errors
|
Main.handleErrors errors if errors
|
||||||
|
|
||||||
Main.callbackNodes Thread, threads
|
Main.callbackNodes Thread, [thread]
|
||||||
Main.callbackNodes Post, posts
|
Main.callbackNodes Post, posts
|
||||||
|
|
||||||
if $.hasClass d.body, 'fourchan_x'
|
if $.hasClass d.body, 'fourchan_x'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user