Post by Todge on Aug 14, 2005 14:35:26 GMT -8
This will place a new button in your post area which will then wrap any highlighted section with tags, you also now have the option to name the spoiler whatever you like...
Global Footer or Board Footer
Edit this line with the URL of the button you'd like added to posting page..
You can edit this part of the CSS to give your spoilers different effects/colors..
It is against the T.O.S. to hide any of the ads on ProBoards..
Do NOT put YouTube videos or any other ads inside the spoiler tags, that is a breach of the terms and I will not be held accountable for any trouble you may get into through use of this code.
Global Footer or Board Footer
<style type="text/css">
<!--
.spoiler { color: black; font-weight: bold; cursor: pointer; padding: 0px 0px 0px 25px; }
.spoilerbody{ color: blue; width: 70%; padding: 0px 5px 5px 55px; !important; }
.hidden { display: none; }
-->
</style>
<script type="text/javascript">
<!--
/*
Spoiler tags by Todge
Copyright © 2010
Please keep this header intact
Global or Board Footer
*/
var spButton = 'http://images.proboards.com/new/shocked.gif';
// Add spoiler button to posting page..
function addspoil()
{
var bname = prompt("what would you like the spoiler to be called?","Spoiler");
add('[spoiler='+bname+']','[/spoiler]');
return;
}
if(document.postForm)
{
var spb = document.createElement('a');
spb.innerHTML = '<img src="'+spButton+'" border="0">';
spb.href = 'javascript:addspoil()';
document.postForm.color.parentNode.appendChild(spb);
}
// Find and create spoilers..
if(pb_action.match(/(display|preview|(modify)?post|search2)/) )
{
var posts = document.getElementsByTagName('font');
for(p=0; p<posts.length; p++)
{
if(posts[p].innerHTML.match(/\[spoiler=/) && (posts[p].innerHTML.match(/ google_ad_section_start/) || (document.postForm && posts[p].size=='1' && !posts[p].innerHTML.match(/<(input|select|textarea)/i))))
{
var spCell = '<div><div>';
spCell += '<span onclick="if(this.nextSibling.className==\'hidden\')';
spCell += '{this.nextSibling.className=\'spoilerbody\'}else';
spCell += '{this.nextSibling.className=\'hidden\'}"><font class="spoiler">$1</font>';
spCell += '</span><div class="hidden">';
posts[p].innerHTML = posts[p].innerHTML.replace(/\[spoiler=(([^\[\]])+)*\]/g,spCell).replace(/\[\/spoiler\]/g,'</div></div></div>');
}}}
// -->
</script>
Edit this line with the URL of the button you'd like added to posting page..
var spButton = 'images.proboards.com/new/shocked.gif';
You can edit this part of the CSS to give your spoilers different effects/colors..
.spoiler { color: black; font-weight: bold; cursor: pointer; padding: 0px 0px 0px 25px; }
.spoilerbody{ color: blue; width: 70%; padding: 0px 5px 5px 55px; !important; }
Totally rewritten and updated to include editable spoiler title.
It is against the T.O.S. to hide any of the ads on ProBoards..
Do NOT put YouTube videos or any other ads inside the spoiler tags, that is a breach of the terms and I will not be held accountable for any trouble you may get into through use of this code.