Reveal Spoiler Thumbnails will replace the imgspoiler class on the thumbnail parent link with imgspoiler-revealed.

This commit is contained in:
ccd0 2016-09-24 10:29:36 -07:00
parent 08c8eb77cc
commit 5fbe0c27d2
2 changed files with 3 additions and 1 deletions

View File

@ -9,6 +9,8 @@ RevealSpoilers =
node: ->
return unless not @isClone and @file and @file.thumb and @file.isSpoiler
{thumb} = @file
$.rmClass thumb.parentNode, 'imgspoiler'
$.addClass thumb.parentNode, 'imgspoiler-revealed'
# Remove old width and height.
thumb.removeAttribute 'style'
# Enforce thumbnail size if thumbnail is replaced.

View File

@ -175,6 +175,7 @@ class Post
size: info[1]
isImage: /(jpg|png|gif)$/i.test link.href
isVideo: /webm$/i.test link.href
isSpoiler: '.' not in link.textContent
dimensions: info[0].match(/\d+x\d+/)?[0]
tag: info[0].match(/,[^,]*, ([a-z]+)\)/i)?[1]
size = +@file.size.match(/[\d.]+/)[0]
@ -186,7 +187,6 @@ class Post
thumb: thumb
thumbURL: if m = link.href.match(/\d+(?=\.\w+$)/) then "#{location.protocol}//i.4cdn.org/#{@board}/#{m[0]}s.jpg"
MD5: thumb.dataset.md5
isSpoiler: $.hasClass thumb.parentNode, 'imgspoiler'
@deadMark =
# \u00A0 is nbsp