Post by neomoon on Mar 31, 2010 15:51:33 GMT -5
Hi, I noticed you guys don't have any custom buttons XD, On my site I have spoiler button, which is useful for template codes and such, I'll show an example from GSL...
~http://moongem123.proboards.com/index.cgi?board=cacn&action=display&thread=2799&page=1
If any of the admin would like this...
copy this into the Global Footers
If you guys don't want it thats fine, just sharing.
~http://moongem123.proboards.com/index.cgi?board=cacn&action=display&thread=2799&page=1
If any of the admin would like this...
copy this into the Global Footers
<script type="text/javascript">
<!--
/*Spoiler UBBC Tags - By iAlex - Open Source*/
var iSpPic="http://img230.imageshack.us/img230/1641/shhep9.png"; //Spoiler UBBC Image
if(document.postForm && document.postForm.color){
var iSpSpan=document.createElement('span');
iSpSpan.innerHTML='<a href="javascript: add(\'[spoiler]\', \'[/spoiler]\')"><img src="'+iSpPic+'" border="0" alt="Spoiler" title="Spoiler" /></a>';
document.postForm.color.parentNode.parentNode.appendChild(iSpSpan);
}
if(location.href.match(/action=(display|(user)?recent|(calendar|pm)view|search2)/) || document.postForm){
var iTd=document.getElementsByTagName('td');
var i=iTd.length;
while(--i){
if(iTd.item(i).height=="100%" && iTd.item(i).width=="80%" && iTd.item(i).vAlign=="top" && iTd.item(i).align=="left" && iTd.item(i).className.match(/windowbg(2)?/) && iTd.item(i).innerHTML.match(/\[spoiler](.+?)\[\/spoiler\]/i) || document.postForm && iTd.item(i).width=="100%" && iTd.item(i).className.match(/windowbg2/) && iTd.item(i).innerHTML.match(/\[spoiler\](.+?)\[\/spoiler\]/i) && iTd.item(i).parentNode.parentNode.parentNode.cellPadding=="4"){
iTd.item(i).innerHTML = iTd.item(i).innerHTML.replace(/\[spoiler\](.+?)\[\/spoiler]/gi,'<b'+'r/><b>Spoiler: </b><div><input type="submit" value="Show" onclick="iShowHide(this)" /><div id="iSpoilerHold" style="display:none"><table class="bordercolor" cellspacing="1" cellpadding="4" border="0" width="80%"><tr><td class="windowbg">$1</td></tr></table></div></div></b'+'r/>');
}
}
}
function iShowHide(iButton){
if(iButton.value.match(/Show/)){
iButton.parentNode.getElementsByTagName('div').item(0).style.display='';
iButton.value='Hide';
}
else if(iButton.value.match(/Hide/)){
iButton.parentNode.getElementsByTagName('div').item(0).style.display='none';
iButton.value='Show';
}
}
//-->
</script>
If you guys don't want it thats fine, just sharing.