diff --git a/src/General/Main.coffee b/src/General/Main.coffee index 07d495cde..a6ccd5503 100644 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -174,7 +174,8 @@ Main = posts = [] for postRoot in $$ '.thread > .postContainer', threadRoot try - posts.push new Post postRoot, thread, g.BOARD + posts.push post = new Post postRoot, thread, g.BOARD + post.cleanup() catch err # Skip posts that we failed to parse. errors = [] unless errors diff --git a/src/General/Post.coffee b/src/General/Post.coffee index 2da5ed5e3..dca023484 100644 --- a/src/General/Post.coffee +++ b/src/General/Post.coffee @@ -141,6 +141,13 @@ 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 + $.rm node + for node in $$ '.desktop', @nodes.root + $.rmClass node, 'desktop' + return + kill: (file, now) -> now or= new Date() if file