|
Post by CD on Jun 23, 2005 20:21:43 GMT -8
Forums: ProBoards Version 4 Compatibility: FF and IE 6.0 Location: Board Footers or Global Footers Description: Adds a spoiler tag that when clicked, displays the spoiler. If you ever want to switch between this and version 1, they are cross-compatible. Editing: Edit the first two variables. They tell you what they do. Preview: None
<script> // Spoiler Tag v2 by CDDude229 // Code may not be redistrbuted without permission
// URL to Spoiler tag Image var spoiler = "http://www.4d5.net/v4images/strike.gif"; // Text to be displayed for where to click spoiler. var text = "<b>Spoiler</b> (Click to display)";
//No need to edit below here. var aTD = document.getElementsByTagName("TD");
if(location.href.match(/board=/i)){
if(location.href.match(/action=(modifypost|post|createpoll)/i)){ for(a=0;a<aTD.length;a++){ if(aTD[a].innerHTML.match(/javascript:add/i) && aTD[a].className=="windowbg2" && aTD[a].innerHTML.match(/quote/i)){ aTD[a].innerHTML+='<a href=javascript:add("[spoiler]","[/spoiler]")><img src="'+spoiler+'" alt="Spoiler" title="Spoiler" border="0"><\/a>'; } } }
function spoilshow(ext){ ext.parentNode.cells[0].innerHTML="<b>Spoiler</b>: "; ext.parentNode.cells[1].style.display=""; }
if(!location.href.match(/action=(modifypost|post|createpoll)/i)){ for(b=0;b<aTD.length;b++){ if(aTD[b].className.match(/windowbg/i) && aTD[b].width=="80%"){ var wbg = aTD[b].bgColor; aTD[b].innerHTML=aTD[b].innerHTML.replace("[spoiler]","<table border='0' cellpadding='0' cellspacing='0' width='100%'><tr><td onclick='spoilshow(this)' valign='top' align='left' width='1%' nowrap='nowrap'>"+text+"&nb"+"sp;&nb"+"sp;&nb"+"sp;</td><td style='display: none;' valign='top' align='left' width='99%'>"); aTD[b].innerHTML=aTD[b].innerHTML.replace("[\/spoiler]","</td></tr></table>"); } } }
}</script>
|
|