From 353d46dad959eb46188a9c71b5c4e47837582bcf Mon Sep 17 00:00:00 2001 From: ccd0 Date: Tue, 1 Jul 2014 00:43:29 -0700 Subject: [PATCH] fix Reveal Spoiler Thumbnails on archived posts --- src/General/Get.coffee | 1 + src/General/lib/post.class | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/General/Get.coffee b/src/General/Get.coffee index 6f6c27d47..3ea67dbc4 100755 --- a/src/General/Get.coffee +++ b/src/General/Get.coffee @@ -217,6 +217,7 @@ Get = thread = g.threads["#{boardID}.#{threadID}"] or new Thread threadID, board post = new Post Build.post(o), thread, board, {isArchived: true} + post.file.thumbURL = o.file.turl post.isFetchedQuote = true Main.callbackNodes Post, [post] Get.insert post, root, context diff --git a/src/General/lib/post.class b/src/General/lib/post.class index cb995a06e..74a92cfeb 100755 --- a/src/General/lib/post.class +++ b/src/General/lib/post.class @@ -149,10 +149,7 @@ class Post unit = ['B', 'KB', 'MB', 'GB'].indexOf @file.size.match(/\w+$/)[0] size *= 1024 while unit-- > 0 @file.sizeInBytes = size - @file.thumbURL = if that.isArchived - thumb.src - else - "#{location.protocol}//t.4cdn.org/#{@board}/#{@file.URL.match(/(\d+)\./)[1]}s.jpg" + @file.thumbURL = "#{location.protocol}//t.4cdn.org/#{@board}/#{@file.URL.match(/(\d+)\./)[1]}s.jpg" @file.isImage = /(jpg|png|gif)$/i.test @file.URL @file.isVideo = /webm$/i.test @file.URL nameNode = $ 'a', fileText