How do you spoiler an image or onebox?


(Adam Davis) #1

I can spoiler text as follows:

[spoiler]You might not want to know this![/spoiler]

You might not want to know this!

But when I put an image or onebox inside those tags, they are not handled correctly. The image is not spoilered, and the onebox item is not oneboxed. Interestingly the onebox item, even as a link, is not clickable, so the forum completely ignores links inside spoilers.

Is there a way to do this currently, and if not can it be added to the future features list?


Spoiler plug-in text legibility on 2012 Nexus 7 (Chrome)
A basic Discourse archival tool
(MilleniX) #2

The Ars Technica forums implement spoilers as a folded up block, that expands when clicked. This may be part of phpBB in general, or they may have added it. That seems to compose more readily with other forum features, though that doesn’t necessarily make it better.


(Jeff Atwood) #3

I understand spoilers are an important core forum feature and we want to improvinate this.

I like the idea of an expanded, folded block.


(Michael McAvoy) #4

Also, the spoiler is shown on a simple mouseover. I could imagine that a single word or phrase can be unintentionally read with an accidental mouseover.

Who did it? The butler!

Also, at least on Safari, scrolling the page so that the spoiler meets the mouse position reveals it as well. If the target is large like an image, this is a likely accident!

Finally, I’m not sure how this would work on a touch interface, since there is no mouseover equivalent. This should require a click to reveal (and perhaps re-hide) the spoiler. The appearance should probably also provide more indication other that simply a redacted appearance.

A folding block would probably solve this…

Edit: I just noticed that the spoiler text shows on the activity-tracking pages as well. If I bookmark something so I can read it when it will no longer be a spoiler (i.e., I’ll want to read it after I’ve seen the new episode), then go to my bookmarks page before i’ve seen it, I might see the spoiler.


(Mika Hirvonen) #5

How about an autogenerated button at the top of the post? Is there an use case for showing some of the spoilers in the post but not others?


(Peter Stoinov) #6

how this would work on a touch interface

I can confirm that mouse over on touch does not work as intended. I can select the text but its not showing automatically. Expandability is the way to go, at least for mobile.


(Jordan Urie) #7

The mouse wheel scroll spoils the spoiler on Chrome 24 for me, so it’s not just Safari.


(Arkhanist) #8

In a couple of forums I frequent, spoilers tend to be game section or tv episode specific; so you want to be able to read spoilers for where you are up to, but not beyond that. Obviously that relies on users saying which section/episode the spoiler applies to, but is common enough with polite members. In any case, a ‘reveal all spoilers’ button would be too broad a brush as the only option, but may be useful as an extra option?

Definitely think collapsed spoilers would be the best way to go, especially if there’s a large enough hitbox for touch users to use.


(Mika Hirvonen) #9

Hitboxes are good for block-level elements, but I’m wondering what to do with inline spoilers. It’s hard to fit any UI elements there without messing up the line spacing. Maybe a paragraph-wide Show Spoilers button would be granular enough?


(Régis Hanol) #10

What do you guys think about this: SPOILER ALERT! ?


(Alejandro González) #11

I love the suggestion, @zogstrip!


(Brentley Jones) #12

You think we can get that as a PR? I think it’s a much better implementation that what we have now.


(Jeff Atwood) #13

Eventually we can work on this, Spoilers are actually quite popular. There are a few other more important things on the list that @zogstrip is working on at the moment, but once those are clear, I’m happy to come back to this.


(Kasper Peulen) #14

I’m using this code as a workaround for image spoilers:

<a href="//discourse-meta.s3-us-west-1.amazonaws.com/original/2X/f/fe7049b5a3372056e9d22ba6f617e6995c8f9f9c.png" class="lightbox">Spoiler</a> 

Spoiler


(Régis Hanol) #15

Just to let you know guys that we’ve deployed the new spoiler alert plugin here on meta and it also works with images :wink:


(Jeff Atwood) #19

Looks OK to me – I see the blurred image even after refresh.

One thing though @zogstrip the blurred image makes the topic super laggy for me in Chrome/Win when it is visible. Just something to note, the touch support is more important for now.


(Josh) #27

Should be noted that spoiler content is not hidden in emails.


(Régis Hanol) #28

That’s a good point, but I guess it’s hard to include JS in an email…


(LoveDiscourse) #29

@zogstrip that is indeed impossible.

Remove the spoiler content in the email and just add this:

<A HREF="URL OF TOPIC/REPLY">Click to see spoiler</a>

(Jacob) #31

This works great for images that are uploaded but not so well with images hosted elsewhere. When you click to reveal it opens the image on it’s own page.