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 = "