diff --git a/src/General/Build.coffee b/src/General/Build.coffee index 67cfd2a65..091208e75 100755 --- a/src/General/Build.coffee +++ b/src/General/Build.coffee @@ -66,7 +66,7 @@ Build = isDeleted: false tag: data.tag Build.post o - post: (o, isArchived) -> + post: (o) -> ### This function contains code from 4chan-JS (https://github.com/4chan/4chan-JS). @license: https://github.com/4chan/4chan-JS/blob/master/LICENSE @@ -212,10 +212,17 @@ Build = h_fileTitle1 = "title='#{E file.name}'" shortFilename = 'Spoiler Image' h_spoilerClass = ' imgspoiler' + if spoilerRange = Build.spoilerRange[boardID] + # Randomize the spoiler image. + fileThumb = "//s.4cdn.org/image/spoiler-#{boardID}#{Math.floor 1 + spoilerRange * Math.random()}.png" + else + fileThumb = '//s.4cdn.org/image/spoiler.png' + file.twidth = file.theight = 100 else h_fileTitle1 = '' shortFilename = Build.shortFilename file.name, !isOP h_spoilerClass = '' + fileThumb = file.turl if file.isSpoiler or file.name is shortFilename h_fileTitle2 = '' @@ -229,16 +236,6 @@ Build = else h_fileDims = "#{+file.width}x#{+file.height}" - if file.isSpoiler and !isArchived - if spoilerRange = Build.spoilerRange[boardID] - # Randomize the spoiler image. - fileThumb = "//s.4cdn.org/image/spoiler-#{boardID}#{Math.floor 1 + spoilerRange * Math.random()}.png" - else - fileThumb = '//s.4cdn.org/image/spoiler.png' - file.twidth = file.theight = 100 - else - fileThumb = file.turl - h_fileCont = "
" h_fileCont += "File: #{E shortFilename} (#{E fileSize}, #{h_fileDims})" h_fileCont += '
' diff --git a/src/General/Get.coffee b/src/General/Get.coffee index c13aa6a37..6f6c27d47 100755 --- a/src/General/Get.coffee +++ b/src/General/Get.coffee @@ -216,7 +216,7 @@ 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), thread, board, {isArchived: true} post.isFetchedQuote = true Main.callbackNodes Post, [post] Get.insert post, root, context