• Hey Guest. Check out your NeoGAF Wrapped 2025 results here!

How to add the ability to "Hide images in spoiler tag for NeoGAF"

Status
Not open for further replies.

hesido

Member
Update: Thanks to Timan, you no longer need to do anything on your part. NeoGAF now natively supports hiding of images inside spoiler tags! That was really fast, only a few tongue in cheek comment and then bam!

Some people opting for media blackouts for certain games voiced their requests for having images in spoiler tags. On NeoGAF, that doesn't work, but there's a temporary work-around until our overlords decide to implement it on the forum.

Install a user css extension like Stylish (for chrome), if your browser doesn't natively support it.

Define a user style sheet for NeoGAF, and add the following in it:
span.spoiler img {
visibility: hidden;
}

span.spoiler:active img, span.spoiler.show img{
visibility: visible;
}

Here's an example:
Oh, look at the pixelated graphics
oXEHnj6.jpg
lol.

And here's how it looks when you have the user style:
dfSZzsu.gif


More elegant methods can be used by the NeoGAF webmaster team. This is just a quick hack that doesn't modify the html and just styles existing elements.

You can make the spoiler area as big as the image if you have:
span.spoiler {
display: inline-block;
}
instead of display: inline, but tags become like paragraphs if there's too much text, not much of a problem for me actually.

You can have a variety of styles for displaying spoilers by modifying the CSS:
lQHXtzh.gif
 
Actually thought we had this, hmmmmmmmmmm

Edit: Added it, seems to work ok, doesn't account for the height of the image, and not sure if I can add inline-block to the span. Will have to do some more testing on posts that use spoilers in different cases.
 
Actually thought we had this, hmmmmmmmmmm

Edit: Added it, seems to work ok, doesn't account for the height of the image, and not sure if I can add inline-block to the span. Will have to do some more testing on posts that use spoilers in different cases.

Hmmm.

yANeJ3d.gif

Edit-It works!
 
span.spoiler img {
visibility: hidden;
}

span.spoiler:active img, span.spoiler.show img{
visibility: visible;
}

Nailed it
 
Actually thought we had this, hmmmmmmmmmm

Edit: Added it, seems to work ok, doesn't account for the height of the image, and not sure if I can add inline-block to the span. Will have to do some more testing on posts that use spoilers in different cases.

Glorious.
 
Or you could just scroll really fast


Get a mouse with a flywheel toggle!

Thread was going in directions I never imagined, until...

Actually thought we had this, hmmmmmmmmmm

Edit: Added it, seems to work ok, doesn't account for the height of the image, and not sure if I can add inline-block to the span. Will have to do some more testing on posts that use spoilers in different cases.

Oh, that's superb. Inline-block makes the spoiler span act differently for multi-line spoiler tags, that's why I didn't add that, but adding it causes the image to be nicely fit inside the spoiler tag indeed. But it does change the behaviour of multi-line spoilers and cause them to act like a separate box, chaging the layout based on the size of the div for existing posts, which could break some of them visually.
 
Actually thought we had this, hmmmmmmmmmm

Edit: Added it, seems to work ok, doesn't account for the height of the image, and not sure if I can add inline-block to the span. Will have to do some more testing on posts that use spoilers in different cases.
Could you add a way to ignore users on the mobile version of the site? Maybe an ignore user link on the user profile page? Also, it'd be nice to see "Posts by user" in addition to "Threads by user" on the same profile page.
Edit: On topic, the spoiler tagged images don't work on the mobile version of the site.
 
That's pretty neat. However, when I click on the spolier tags and the picture shows up, it's highlighted in blue, like the same blue when you highlight stuff with your mous? Is this only the case for me?
 
Nope thats it, don't go abusing it either that causes more and more stuff to be removed. It was more of a bug imo than an enhancement. I was pretty positive we had that in place already.
 
post-28669-scanners-hrpjnu.gif

That's pretty neat. However, when I click on the spolier tags and the picture shows up, it's highlighted in blue, like the same blue when you highlight stuff with your mous? Is this only the case for me?
That's because technically you do. Just klick anywhere else on the screen to get rid of the tint
 
Actually thought we had this, hmmmmmmmmmm

Edit: Added it, seems to work ok, doesn't account for the height of the image, and not sure if I can add inline-block to the span. Will have to do some more testing on posts that use spoilers in different cases.

Timan, me again,

Could you please add:
span.spoiler:active img also, if you like?
Currently image doesn't show until you release the left mouse button, without that css selector applied.. Thanks! :=) (Also, this fixes the problem where sometimes the javascript may glitch or not load and the only way to see the spoiler is to hold the left mouse button.. This would save it in cases where the javascript doesn't work or kick in for some reason)
 
Hm... Doesn't seem to work in mobile Chrome or Opera here. Works if I disable mobile site though.

I'm guessing they'd need to add it separately to the mobile style sheets but deploying things like this always have the possibility to screw things up on big operations, no matter how trivial it may seem.
 
Status
Not open for further replies.
Top Bottom