diff --git a/4chan_x.user.js b/4chan_x.user.js index b408f741e..ad6e7974f 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1002,7 +1002,7 @@ }, node: function(post) { var side; - if (post.isInlined || /\bop\b/.test(post["class"])) { + if (post.isInlined || post.ID === post.threadID) { return; } side = $('.sideArrows', post.root); @@ -2869,12 +2869,14 @@ return Main.callbacks.push(this.node); }, node: function(post) { - var img; + var img, s; img = post.img; if (!(img && /^Spoiler/.test(img.alt)) || post.isInlined && !post.isCrosspost || post.isArchived) { return; } img.removeAttribute('style'); + s = img.style; + s.maxHeight = s.maxWidth = /\bop\b/.test(post["class"]) ? '250px' : '125px'; return img.src = "//thumbs.4chan.org" + (img.parentNode.pathname.replace(/src(\/\d+).+$/, 'thumb$1s.jpg')); } }; @@ -4895,17 +4897,6 @@ textarea.field {\ width: 100%;\ }\ \ -/* revealed spoilers do not have height/width,\ - this fixes "expanded" auto-gifs */\ -.op > div > a > img[data-md5] {\ - max-height: 252px;\ - max-width: 252px;\ -}\ -.reply > div > a > img[data-md5] {\ - max-height: 127px;\ - max-width: 127px;\ -}\ -\ #qr, #qp, #updater, #stats, #ihover, #overlay, #navlinks {\ position: fixed;\ }\ diff --git a/script.coffee b/script.coffee index b231ee8a3..360f8f545 100644 --- a/script.coffee +++ b/script.coffee @@ -766,7 +766,7 @@ ReplyHiding = Main.callbacks.push @node node: (post) -> - return if post.isInlined or /\bop\b/.test post.class + return if post.isInlined or post.ID is post.threadID side = $ '.sideArrows', post.root $.addClass side, 'hide_reply_button' side.innerHTML = '[ - ]' @@ -2250,6 +2250,9 @@ RevealSpoilers = if not (img and /^Spoiler/.test img.alt) or post.isInlined and not post.isCrosspost or post.isArchived return img.removeAttribute 'style' + # revealed spoilers do not have height/width set, this fixes auto-gifs dimensions. + s = img.style + s.maxHeight = s.maxWidth = if /\bop\b/.test post.class then '250px' else '125px' img.src = "//thumbs.4chan.org#{img.parentNode.pathname.replace /src(\/\d+).+$/, 'thumb$1s.jpg'}" Time = @@ -3841,17 +3844,6 @@ textarea.field { width: 100%; } -/* revealed spoilers do not have height/width, - this fixes "expanded" auto-gifs */ -.op > div > a > img[data-md5] { - max-height: 252px; - max-width: 252px; -} -.reply > div > a > img[data-md5] { - max-height: 127px; - max-width: 127px; -} - #qr, #qp, #updater, #stats, #ihover, #overlay, #navlinks { position: fixed; }