Cleanup asap.
This commit is contained in:
parent
410fbf3444
commit
8227d935cd
@ -231,7 +231,6 @@ Get =
|
||||
new Board boardID
|
||||
thread = g.threads["#{boardID}.#{threadID}"] or
|
||||
new Thread threadID, board
|
||||
post = new Post Build.post(o, true), thread, board,
|
||||
isArchived: true
|
||||
post = new Post Build.post(o, true), thread, board, {isArchived: true}
|
||||
Main.callbackNodes Post, [post]
|
||||
Get.insert post, root, context
|
||||
|
||||
@ -174,8 +174,7 @@ Main =
|
||||
posts = []
|
||||
for postRoot in $$ '.thread > .postContainer', threadRoot
|
||||
try
|
||||
posts.push post = new Post postRoot, thread, g.BOARD
|
||||
post.cleanup()
|
||||
posts.push post = new Post postRoot, thread, g.BOARD, {isOriginalMarkup: true}
|
||||
catch err
|
||||
# Skip posts that we failed to parse.
|
||||
errors = [] unless errors
|
||||
|
||||
@ -6,6 +6,7 @@ class Post
|
||||
@ID = +root.id[2..]
|
||||
@fullID = "#{@board}.#{@ID}"
|
||||
|
||||
@cleanup root if that.isOriginalMarkup
|
||||
post = $ '.post', root
|
||||
info = $ '.postInfo', post
|
||||
@nodes =
|
||||
@ -141,10 +142,10 @@ class Post
|
||||
if @file.isImage = /(jpg|png|gif)$/i.test @file.name
|
||||
@file.dimensions = fileText.textContent.match(/\d+x\d+/)[0]
|
||||
|
||||
cleanup: ->
|
||||
for node in $$ '.mobile', @nodes.root
|
||||
cleanup: (root) ->
|
||||
for node in $$ '.mobile', root
|
||||
$.rm node
|
||||
for node in $$ '.desktop', @nodes.root
|
||||
for node in $$ '.desktop', root
|
||||
$.rmClass node, 'desktop'
|
||||
return
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user