Remove mobile nodes in posts parsed from 4chan's markup.
This commit is contained in:
parent
a46a5a0141
commit
410fbf3444
@ -174,7 +174,8 @@ Main =
|
|||||||
posts = []
|
posts = []
|
||||||
for postRoot in $$ '.thread > .postContainer', threadRoot
|
for postRoot in $$ '.thread > .postContainer', threadRoot
|
||||||
try
|
try
|
||||||
posts.push new Post postRoot, thread, g.BOARD
|
posts.push post = new Post postRoot, thread, g.BOARD
|
||||||
|
post.cleanup()
|
||||||
catch err
|
catch err
|
||||||
# Skip posts that we failed to parse.
|
# Skip posts that we failed to parse.
|
||||||
errors = [] unless errors
|
errors = [] unless errors
|
||||||
|
|||||||
@ -141,6 +141,13 @@ class Post
|
|||||||
if @file.isImage = /(jpg|png|gif)$/i.test @file.name
|
if @file.isImage = /(jpg|png|gif)$/i.test @file.name
|
||||||
@file.dimensions = fileText.textContent.match(/\d+x\d+/)[0]
|
@file.dimensions = fileText.textContent.match(/\d+x\d+/)[0]
|
||||||
|
|
||||||
|
cleanup: ->
|
||||||
|
for node in $$ '.mobile', @nodes.root
|
||||||
|
$.rm node
|
||||||
|
for node in $$ '.desktop', @nodes.root
|
||||||
|
$.rmClass node, 'desktop'
|
||||||
|
return
|
||||||
|
|
||||||
kill: (file, now) ->
|
kill: (file, now) ->
|
||||||
now or= new Date()
|
now or= new Date()
|
||||||
if file
|
if file
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user