Fix 'Reveal Spoiler Thumbnails' on .bmp files.
This commit is contained in:
parent
510603e8f2
commit
44ca4c34bb
@ -199,8 +199,8 @@ class Post
|
||||
|
||||
$.extend file,
|
||||
url: file.link.href
|
||||
isImage: /\.(jpe?g|png|gif|bmp)$/i.test file.link.href
|
||||
isVideo: /\.(webm|mp4)$/i.test file.link.href
|
||||
isImage: $.isImage file.link.href
|
||||
isVideo: $.isVideo file.link.href
|
||||
size = +file.size.match(/[\d.]+/)[0]
|
||||
unit = ['B', 'KB', 'MB', 'GB'].indexOf file.size.match(/\w+$/)[0]
|
||||
size *= 1024 while unit-- > 0
|
||||
|
||||
@ -490,6 +490,9 @@ $.unescape = (text) ->
|
||||
text.replace(/<[^>]*>/g, '').replace /&(amp|#039|quot|lt|gt|#44);/g, (c) ->
|
||||
(({'&': '&', ''': "'", '"': '"', '<': '<', '>': '>', ',': ','})[c])
|
||||
|
||||
$.isImage = (url) -> /\.(jpe?g|png|gif|bmp)$/i.test url
|
||||
$.isVideo = (url) -> /\.(webm|mp4)$/i.test url
|
||||
|
||||
$.engine = do ->
|
||||
return 'edge' if /Edge\//.test navigator.userAgent
|
||||
return 'blink' if /Chrome\//.test navigator.userAgent
|
||||
|
||||
@ -218,7 +218,7 @@ SW.tinyboard =
|
||||
dimensions: info[0].match(/\d+x\d+/)?[0]
|
||||
if thumb
|
||||
$.extend file,
|
||||
thumbURL: if /\/static\//.test(thumb.src) and /\.(?:gif|jpe?g|png)$/.test(link.href) then link.href else thumb.src
|
||||
thumbURL: if /\/static\//.test(thumb.src) and $.isImage(link.href) then link.href else thumb.src
|
||||
isSpoiler: /^Spoiler/i.test(info[1] or '') or link.textContent is 'Spoiler Image'
|
||||
true
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user