3

My friends and I over at SciFi Beta, have been noticing a few problems. The first is: The spoiler tag is used almost in every other question (or in an answer) and two:

I have to constantly reposition the mouse, when I'd like to quickly read the question.

So I was suggestion a site wide (not exchange wide) setting that disables the hiding of a spoiler. I wouldn't mind having to click on the spoiler text to enable the "show spoiler" feature.

Btw, I'm lazy so the full question is here: Opting out of hiding spoiler markdown content.

5
  • 2
    Click to show is already an existing feature request on its own, so yours is probably best centered on just the preference. That said, if it's used to the point of being problematic, it may be wise to revisit the frequency of its usage on that site.
    – Grace Note StaffMod
    Commented May 17, 2011 at 18:39
  • 2
    Arg. meta.stackexchange.com/questions/89228/…
    – Rebecca Chernoff Mod
    Commented May 17, 2011 at 18:43
  • I'm talking about a site wide setting Commented May 17, 2011 at 19:03
  • If it's site-wide, then isn't @Rebecca's ARGing even more appropriate?
    – Grace Note StaffMod
    Commented May 17, 2011 at 19:13
  • 1
    Why don't we just get rid of spoiler markup since everything is a spoiler to someone
    – random
    Commented May 18, 2011 at 1:47

3 Answers 3

10

The odds of getting a site-wide setting are pretty low, but you can use a userscript to unhide spoilers. I do it with:

function with_jquery(f) {                                                                                                                                      
    var script = document.createElement("script");                                                                                                             
    script.type = "text/javascript";                                                                                                                           
    script.textContent = "(" + f.toString() + ")(jQuery)";                                                                                                     
    document.body.appendChild(script);                                                                                                                         
};                                                                                                                                                             

with_jquery(function($) {                                                                                                                                      
    $('.spoiler').removeClass('spoiler').css('background-color', '#fbb');                                                                                      
});

The result is:

Screenshot of the result

5
  • Darn, I was going to create the user Script. Drat! Commented May 17, 2011 at 19:41
  • 1
    PS, userscripts are new to me, how do I use them? Install them, or whatever? Commented May 17, 2011 at 19:44
  • @Justin I put it on userscripts.org; there's an Install button. You need to be using a browser that supports them (Firefox with Greasemonkey, or Chrome) Commented May 17, 2011 at 19:52
  • 1
    Could you put it up on Stack Apps? Commented May 17, 2011 at 20:05
  • @Gilles, does StackApps have a install into site function? Commented May 17, 2011 at 20:16
3

The spoiler tag is just a bit of CSS. I believe all modern browsers allow use of a user style sheet (and this doesn't require installing any sort of extension to run user scripts). So all you need to do is add a rule that overrides the CSS in your user style sheet, and you're done.

(I don't think user style sheets can be site-specific, so this would change any site that uses the "spoiler" CSS class. If that does have an impact, then IMO a better feature request would be to have SE change the class to something like "stackexchange-spoiler").

For example, in Safari, go to Preferences, then Advanced, then select the stylesheet.

Your stylesheet only needs to contain something like this:

.spoiler { color: #444 !important; }

444 is the colour that you get when hovering - you could make it something else if you wanted spoilers to stand out in some way, or add other markup like a background colour (e.g. so you avoid referencing them in answers!).

2

I've created the StackApps entry for the UserScript and a Safari Extension.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .