Cold Shadow
Dream League Admin
Shadow of Justice
Posts: 74
|
Post by Cold Shadow on Jul 7, 2011 0:14:29 GMT -8
I have implemented a code which now allows spoiler coding. To the right of the 'Insert List' option of the normal default ProBoards code options you will notice a 'Shocked' emote which is not positioned with the other smileys. Highlight any text you wish to conceal, then click on that button and give an appropriate title. Your text is now hidden and must be clicked to be viewed. Perfect for hiding sensitive information when discussing films, stories, etc. where you may spoil something other's haven't had a chance to see yet. Enjoy!
|
|
Dreamchild
Dream League Admin
The Dream Come True
"Open your mind..."
Posts: 206
|
Post by Dreamchild on Jul 7, 2011 0:21:35 GMT -8
Good man! Good thinking!
|
|
El Tirador
Dream League Member
El Primero Caballero
Posts: 36
|
Post by El Tirador on Aug 7, 2011 13:05:14 GMT -8
Love the spoiler code--it's so useful.
Is there an html code I can use to do that on my website?
Thanks.
|
|
Cold Shadow
Dream League Admin
Shadow of Justice
Posts: 74
|
Post by Cold Shadow on Aug 7, 2011 13:12:01 GMT -8
<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(/google_ad_section_start/) || (posts[p].size == '1' && pb_action.match(/preview|(modify)?post/))) { if(document.postForm) { var qPost = document.postForm.message.value; } 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>'); if(document.postForm) { document.postForm.message.value = qPost; } }}} // --> </script>
You can, of course, edit the color code to change the font color for the spoiler topic and body.
|
|
El Tirador
Dream League Member
El Primero Caballero
Posts: 36
|
Post by El Tirador on Aug 7, 2011 13:14:24 GMT -8
Gracias! Can't wait to try it out.
|
|