# Spoiler BBcode tag - button please?



## Fofer

Lots of folks (and I) believe the discourse would be kinder in the TV Talk section if spoiler tags were used more commonly.

(See the recent discussion here for just one example.)

One way to encourage this is to make it super easy to use them. vBulletin's admin page makes this a simple addition, just upload an image for the button, like this one, to the pre-existing BBcode entry for


Spoiler



.










Can this please be added here? This is a forum that revolves around the activity of TV watching after all, and spoilers (or lack thereof) can be a sore subject. Making it easy to use the spoiler feature can only have positive effects on the discourse here. And if someone prefers to type out the 19 characters the


Spoiler



tag requires, they can still do it the old-fashioned way.

Thanks for the consideration.


----------



## sushikitten

Excellent suggestion. I wish I'd thought of it. Or at least to ask for it here.


----------



## hummingbird_206

:up: Thank you Fofer for making the formal request.


----------



## Robin

This would be a fabulous addition. :up:


----------



## Rob Helmerichs

I don't know if that's such a good idea. Seems to me it would just encourage people to use spoiler tags.


----------



## Zevida

I endorse this suggestion! :up:


----------



## murgatroyd

Yes, please.

Jan


----------



## jradosh

Sounds good to me.


----------



## Bob_Newhart

Me too


----------



## steve614

I'm adding my vote.
I've thought this has been needed for a long time, I just didn't think to post about it here.
Thanks, Fofer!


----------



## DavidTigerFan

I agree!


----------



## sushikitten

Is it done yet?


Yet?


Yet?


----------



## Jonathan_S

hummingbird_206 said:


> :up: Thank you Fofer for making the formal request.


:up: +1


----------



## Fofer

I can't imagine anyone would disagree about this feature. There's literally not one single valid reason I can think of to deny it here.

So, all we need now is for a single admin or mod to read this, and Make It So. Since I've already included the icon .gif in the OP, it should take no more than 20 seconds to enable.

Is anyone minding the store?

Hello?

Is this thing on?


----------



## teknikel

:up:


----------



## justen_m

:up:


----------



## Peter Redmer

Spoiler



Thanks for your patience, everyone, in getting this feature added. Now, when you use the spoiler tag, you'll see this button which will only display the spoiler text if you click on it. I hope this fulfills your request! Cheers, Pete


----------



## Fofer

Peter, thanks for changing how spoilers appear in posts. It's nice and all, but that is NOT what I requested here.

What I was requesting was a button in the post message composition toolbar, that makes it easier for users to actually _use the spoiler tag, when they are typing their posts._

Lots of newbies (or folks just unaware) don't know to type [ spoiler ] or maybe they are just lazy.

But putting a button for the BBcode function (which is just a matter of assigning a .gif to in the admin panel) would make it very easy for everyone to use.

This is what I was requesting...


----------



## Mike Lang

Thanks Peter.


----------



## Fofer

To make things painfully clear:

We want this button:









placed here:










And all you need to do for this to happen is to upload that hide.gif to the /images directory, and add that filepath to the BBCode entry for


Spoiler



.

Thanks.


----------



## Peter Redmer

Spoiler



Testing


----------



## Peter Redmer

Should be working now - try it out and let me know if there are any problems.


----------



## Fofer

Spoiler



Now we're talking. Thanks, Peter.


----------



## SeanC

OMG that is seriously awesome. I love both button additions!


----------



## DavidTigerFan

Spoiler



Woot!


Since it apears to be christmas here, would it be to much to ask that the button be added to the quick reply box as well?


----------



## hummingbird_206

Great! Thank you!!!


----------



## sushikitten

YAY!

And I would also request it in the Quick Reply box if at all possible, although I am not complaining one iota.

:up:


----------



## Fofer

DavidTigerFan said:


> Since it apears to be christmas here, would it be to much to ask that the button be added to the quick reply box as well?


Saw that one coming a mile away... but didn't want to push my luck. 

Hey Peter, this little extra would be fantastic... since most folks use QuickReply anyway. (It's a tiny bit more difficult to implement, but not all that bad.)

And then I promise I won't ask for anything else through the rest of the year. 

Here's how to add the button to QuickReply:

http://www.vbulletin.org/forum/showthread.php?t=102282


----------



## markz

Cool, I love the new feature!

Thanks!


----------



## steve614

Spoiler



OMG! I never expected this to happen so soon. 



Thanks for the timely addition.


----------



## betts4

steve614 said:


> Spoiler
> 
> 
> 
> OMG! I never expected this to happen so soon.
> 
> 
> 
> Thanks for the timely addition.





Spoiler



Just testing this


----------



## betts4

betts4 said:


> Spoiler
> 
> 
> 
> Just testing this


Very cool!

Thank you!!!


----------



## Peter Redmer

Spoiler



Ok, the button in Quick Reply seems to be working. Can everyone test this out and let me know if it is working for you?

Pete


----------



## steve614

Spoiler



Test underway


We'll see if it works.



Spoiler



Peter's earning his paycheck today!  



It works for me.



Spoiler



Nice job!


----------



## Peter Redmer

Spoiler



I earn my paychecks every day


----------



## Einselen

Interesting new way to view spoilers? Does this change the way spoilers are handled in the e-mail notifications (not that I care, just wondering)?


----------



## Robin

Peter, you rock! Thanks!


----------



## sushikitten

Today is a great day. :up:


----------



## sushikitten

Spoiler



Oops, and then I didn't even use the new function!


----------



## BitbyBlit

Thanks Peter. I like this much better than highlighting.

If adding a script block somewhere on the page is not a big deal, I think it would also be nice to have a button to show and hide all spoilers at once.

Here's a script block that will allow that to happen:



Code:


<script type="text/javascript">  
  function ShowSpoiler(spoiler)
  {
    spoiler.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';
    
    var buttons = spoiler.getElementsByTagName('input');
    var showHideButton = buttons[0];
    var showHideAllButton = buttons[1];
        
    showHideButton.value = 'Hide';    
    showHideAllButton.value = 'Hide All';
  }

  function HideSpoiler(spoiler)
  {
    spoiler.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none';
    
    var buttons = spoiler.getElementsByTagName('input');
    var showHideButton = buttons[0];
    var showHideAllButton = buttons[1];
        
    showHideButton.value = 'Show';    
    showHideAllButton.value = 'Show All';    
  }

  function ToggleSpoiler(spoiler)
  {
    if (spoiler.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '')
      ShowSpoiler(spoiler);
    else
      HideSpoiler(spoiler);
  }

  function DoForAllSpoilers(node, action)
  {    
    if (node.name == "spoiler")
    {
      action(node);
      return;
    }
    
    var childNodes = node.childNodes;
    var length = childNodes.length;
    
    for (var i = 0; i < length; ++i)
    {      
      DoForAllSpoilers(childNodes[i], action);
    }
  }

  function ToggleAllSpoilers(showHideAllButton)
  {
    if (showHideAllButton.value == 'Show All')
      DoForAllSpoilers(document.body, ShowSpoiler);
    else
      DoForAllSpoilers(document.body, HideSpoiler);    
  }
</script>

And then you just need to update the template for spoilers to have the following:


Code:


<div name="spoiler" style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">Spoiler: <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onClick="ToggleSpoiler(this.parentNode.parentNode)"></input> <input type="button" value="Show All" style="width:55px;font-size:10px;margin:0px;padding:0px;" onClick="ToggleAllSpoilers(this)"></div>
<div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset;">
<div style="display: none;">
{Spoiler Text}
</div>
</div>
</div></div>


----------



## DavidTigerFan

Spoiler



Wooo hoo!


----------



## TIVO_GUY_HERE

me likes....


----------



## Test

Very cool, now I can read spoilers from my iPhone


----------



## alpacaboy

BitbyBlit said:


> Thanks Peter. I like this much better than highlighting.
> 
> If adding a script block somewhere on the page is not a big deal, I think it would also be nice to have a button to show and hide all spoilers at once.
> 
> Here's a script block that will allow that to happen:


I'd love to see that as well. I'd go one farther and say I wish there was a user preference for spoiler display. That is a way to just say: Indicate what others consider a spoiler so I know what I need to spoilerize, but for me, just expand it so i don't have to hit any buttons, highlight, etc.


----------



## Rob Helmerichs

alpacaboy said:


> I'd love to see that as well. I'd go one farther and say I wish there was a user preference for spoiler display. That is a way to just say: Indicate what others consider a spoiler so I know what I need to spoilerize, but for me, just expand it so i don't have to hit any buttons, highlight, etc.


Better yet, write an artificial intelligence that will analyze the spoilers and break them down into categories..."next week" spoiler, casting spoilers, news about future episodes, etc. Then, we can select what kinds of things we want to remain tagged and which ones can just be out in the open.

That would be handy.


----------



## ellinj

Spoiler



cool


----------



## Sherminator

Spoiler



Can we have a quick spoiler tag button in the quick edit box also?



Thank you.


----------



## Fofer

Sherminator said:


> Can we have a quick spoiler tag button in the quick edit box also?
> 
> Thank you.


Not a bad idea... hopefully our window of opportunity hasn't closed, the Powers That Be remained interested in continued improvements!

Here's instructions for an admin to add buttons to the QuickEdit template:
http://www.vbulletin.org/forum/showthread.php?t=102282

It'd be much appreciated...


----------



## Peter Redmer

Fofer said:


> Not a bad idea... hopefully our window of opportunity hasn't closed, the Powers That Be remained interested in continued improvements!
> 
> Here's instructions for an admin to add buttons to the QuickEdit template:
> http://www.vbulletin.org/forum/showthread.php?t=102282
> 
> It'd be much appreciated...


Done  It seems to work for me. Let me know if you have any trouble.


----------



## sushikitten

This might be somewhat related...or not... but there is no quote button in the Quick Reply box and I thought there used to be. But it could be my bad memory...


----------



## Fofer

Awesome, thanks!



Spoiler



Really!


----------

