Post by ialex on Dec 13, 2007 3:50:06 GMT -8
Will place a UBBC icon with the others that looks like this:
When clicked, it will put tags into the post area. Whatever is between these tags will appear as a spoiler in that message.
Preview One
Preview Two
Preview Three
You can change the UBBC icon at the top of the code if you wish, or keep it as is.
Global Footers.
Cross Browser.
<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(\'
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(/\
When clicked, it will put tags into the post area. Whatever is between these tags will appear as a spoiler in that message.
Preview One
Preview Two
Preview Three
You can change the UBBC icon at the top of the code if you wish, or keep it as is.
Global Footers.
Cross Browser.
<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(\'
\', \'
\')"><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\]/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>
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>