Post by iAlex on Dec 19, 2007 19:30:52 GMT -5
This code will add a drop down menu next to the colors drop down menu when posting. From this menu you can select a font background highlight colour.
Posting Preview: Click
Highlight Preview: Click
Global Footer.
Cross Browser.
Open Source.
<script type="text/javascript">
<!--
/*Highlight Text UBBC - By iAlex - Open Source*/
if(document.postForm && document.postForm.color){
var iColour=document.postForm.color;
iHighSelect=iColour.cloneNode(true);
iHighSelect.options[0].innerHTML='Highlight Colors';
iColour.parentNode.insertBefore(iHighSelect, iColour.nextSibling);
iColour.parentNode.insertBefore(document.createTextNode(' '), iColour.nextSibling);
iHighSelect.onchange=function(){
eval(add('[highlight='+this.value+']', '[/highlight]'));
this.selectedIndex=0;
}
}
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(/\[highlight=(.+?)\](.+?)\[\/highlight\]/i) || document.postForm && iTd.item(i).width=="100%" && iTd.item(i).className.match(/windowbg2/) && iTd.item(i).innerHTML.match(/\[highlight=(.+?)\](.+?)\[\/highlight\]/i) && iTd.item(i).parentNode.parentNode.parentNode.cellPadding=="4"){
iTd.item(i).innerHTML=iTd.item(i).innerHTML.replace(/\[highlight=(.+?)\](.+?)\[\/highlight\]/ig, '<font style="background-color: $1;">$2</font>');
}
}
}
//-->
</script>
Posting Preview: Click
Highlight Preview: Click
Global Footer.
Cross Browser.
Open Source.
<script type="text/javascript">
<!--
/*Highlight Text UBBC - By iAlex - Open Source*/
if(document.postForm && document.postForm.color){
var iColour=document.postForm.color;
iHighSelect=iColour.cloneNode(true);
iHighSelect.options[0].innerHTML='Highlight Colors';
iColour.parentNode.insertBefore(iHighSelect, iColour.nextSibling);
iColour.parentNode.insertBefore(document.createTextNode(' '), iColour.nextSibling);
iHighSelect.onchange=function(){
eval(add('[highlight='+this.value+']', '[/highlight]'));
this.selectedIndex=0;
}
}
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(/\[highlight=(.+?)\](.+?)\[\/highlight\]/i) || document.postForm && iTd.item(i).width=="100%" && iTd.item(i).className.match(/windowbg2/) && iTd.item(i).innerHTML.match(/\[highlight=(.+?)\](.+?)\[\/highlight\]/i) && iTd.item(i).parentNode.parentNode.parentNode.cellPadding=="4"){
iTd.item(i).innerHTML=iTd.item(i).innerHTML.replace(/\[highlight=(.+?)\](.+?)\[\/highlight\]/ig, '<font style="background-color: $1;">$2</font>');
}
}
}
//-->
</script>