The spoiler tag

Is it possible to add a preference for the spoiler tag to not hide text? Or, alternatively, adjust the spoiler tag so that it defaults to “not hidden” on a non-javascript browser?

Well, the purpose of the spoiler tag was the hide the text inside it, so having it be expanded by default would defeat its purpose. I could add another tag that has the same header but doesn’t collapse, if that would help. I gather from the request that there’s a reason you’re asking, though. Is it causing some issues with non-javascript browsers?

A block which fails to be hidden defeats the purpose of the spoiler tag, but a block which fails to expand defeats the purpose of the whole post. It’s easier for a non-javascript reader to deal with the former, is all.

The usual way to handle accessibility in such cases is to use the same technology to hide elements which is later used to ‘unhide’ them again manually. I.e.: If you use Javascript to show these spoiler sections, use a Javascript function (which can be called on page load) to hide them in the first place, too. This way, if a client doesn’t handle this kind of code, there will be no problem.

I think what Zarf meant is a user preference that shows spoilers by default. If someone enables that preference in his profile, then that user, and only that user gets to see spoilers.

Showing spoilers for everyone would of course defeat the purpose.

Could I bring this up again? That tag is used quite extensively on these forums and it makes all those threads where it is used unreadable for people with non-Javascript browsers. It would be a really simple change technically:

– Change the “spoiler” CSS class not to be hidden, but to have the same background and foreground colour (so that marking the text will make it readable).
– Write three lines of Javascript changing the foreground colour back to the default (as it is now) and hiding those spoiler sections. Put this Javascript in the body’s onload attribute or anywhere on the page.

That’s it. Everybody’s happy!

I’d quite like that option. I dislike having to continually click to show spoilers, particularly in posts where people hide every second word in spoiler tags. Having one simple option that would turn off the tags and let me see everything would be great.

So we’re talking about two things, right? One would be to change how spoiler sections work for non-javascript browsers and then “change it back” with javascript? The other would be to create a profile option that stops hiding spoilers as a preference?

Adding global javascript probably means modding the board, or at a minimum, hacking the themes. That’s not difficult necessarily, but I’d rather avoid doing something one-off that would complicate version updates. The same is true for adding a preference for automatically showing spoilers, and to a larger degree.

Anybody know if such mods already exist?

It might be possible to do something with the spoiler tag just in its definition, which is editable without monkeying with the code of the board itself. In the spoiler tag definition, javascript runs on click events, but I don’t know if what’s being requested is possible just in the tag definition. Maybe. But not the preference for automatically showing them. That would take some modding.

That’s what I was talking about.

It’s not a high priority, though.

Also, if someone could change the default theme so that the code block would have a maximum height like in the alternative theme, that would cut down using the spoiler tag to hide large blocks of code. Because it’s pretty annoying when it’s misused that way especially when you’re using the theme where it has no benefit whatsoever.

Guilty of that. Sorry. I did it because I found large chunks of code annoying (too much to scroll down) when not interested in the fine details or revisiting a thread looking for some comment.

The other way could be to make it into a link when JavaScripts aren’t enabled (this way it work even if CSS isn’t enabled either).

I’ve seen some people use the “Rant” tag instead, which I believe is intended to hide a long screed that people may wish to skip.

I would dislike this change. Scrolling windows within scrolling windows are often awkward for me to deal with, especially now that the scroll bar has been done away with and the only way to get a window to scroll is to point your cursor in the general direction, two-finger swipe your way down, and hope the computer understands you. At least when there’s a massive code block open in the default theme as it stands, I can click outside the text entry fields and scroll using the arrow keys.

I have kind of always preferred the ‘invisible text you need highlight’ form of spoiler control – more sentence compatible. I feel it’s more natural when the sentence reigns supreme and the spoiler is a subset of the sentence, rather than vice versa. This makes spoiler-tagged posts easier to get the gist of without getting spoiled, because when it’s convenient to only blank out certain words in a sentence, that’s what people tend to want to do. (Everybody used to do it that way in the days when this kind of software was young so I expect other people know about this method and just don’t prefer it for whatever reason maybe having to do with having to fiddle with theme colours too much.)

Not compatible with all browsers, which after all are a very wide range of display models (including terminal apps running in another wide range of display models).

Does the simple “text the same color as the background” thing work for folks using screen readers, though? (Also, highlighting text can be a pain on mobile devices.)

Thanks for those caveats. Anyone else get the feeling from threads like these that mobile has been a giant downgrade for the web?

Since screen readers have been mentioned as well, I’d say no… it’s just a matter of accessibility. You are not forced to make websites that are mobile-friendly, nor blind-user-friendly, but if you can, kudos to you. As long as you at least make websites that work on the most popular browsers out there. Everything else has been going on since before the mobile, methinks.

Adding a user setting to control this will be too tricky, but if you can find somewhere a phpbb mod for spoilers with a user setting already included then I can install it.