Post by iAlex on Dec 20, 2007 18:03:01 GMT -5
This code will add smilies to your quick reply box.
If you are not using the default smilies, then you will need to edit the URL of the corresponding smilies at the top of the code. There is no need to edit anything if you have the default smilies.
Preview: Click
Cross Browser.
Global Footer.
Open Source.
<script type="text/javascript">
<!--
/*Add Smilies to Quick Reply - By iAlex - Open Source*/
var iSmileList=[
["http://s3.images.proboards.com/smiley.gif", " :)", "Smiley"],
["http://s3.images.proboards.com/wink.gif", " ;)", "Wink"],
["http://s3.images.proboards.com/cheesy.gif", " :D", "Cheesy"],
["http://s3.images.proboards.com/grin.gif", " ;D", "Grin"],
["http://s3.images.proboards.com/angry.gif", " >:(", "Angry"],
["http://s3.images.proboards.com/sad.gif", " :(", "Sad"],
["http://s3.images.proboards.com/shocked.gif", " :o", "Shocked"],
["http://s3.images.proboards.com/cool.gif", " 8-)", "Cool"],
["http://s3.images.proboards.com/huh.gif", " ???", "Huh"],
["http://s3.images.proboards.com/rolleyes.gif", " ::)", "Roll Eyes"],
["http://s3.images.proboards.com/tongue.gif", " :P", "Tongue"],
["http://s3.images.proboards.com/embarassed.gif", " :-[", "Embarassed"],
["http://s3.images.proboards.com/lipsrsealed.gif", " :-X", "Lips Sealed"],
["http://s3.images.proboards.com/undecided.gif", " :-/", "Undecided"],
["http://s3.images.proboards.com/kiss.gif", " :-*", "Kiss"],
["http://s3.images.proboards.com/cry.gif", " :'(", "Cry"]
];
if(location.href.match(/action=display/)){
var iTd=document.getElementsByTagName('td');
var i=iTd.length;
while(--i){
if(iTd.item(i).className.match(/^titlebg/) && iTd.item(i).width=="100%" && iTd.item(i).innerHTML.match(/>Quick\sReply</)){
var iSmileSpan=document.createElement('div');
iQuick='<font size="2">Smilies:</font><b'+'r />';
for(var a=0;a<iSmileList.length;a++){
iQuick+='<a onclick="javascript: iAddSmile(this)" style="cursor: pointer;" name="'+iSmileList[1]+'"><img src="'+iSmileList[0]+'" alt="'+iSmileList[2]+'" title="'+iSmileList[2]+'" border="0" /></a> ';
}
iQuick+='<b'+'r /><b'+'r />';
iSmileSpan.innerHTML=iQuick;
var iNext=iTd.item(i).parentNode.nextSibling.firstChild;
iNext.insertBefore(iSmileSpan, iNext.firstChild);
break;
}
}
}
function iAddSmile(iLink){
iCode=iLink.name;
var iMessage=iLink.parentNode.parentNode.getElementsByTagName('textarea').item(0)
iMessage.value=iMessage.value+iCode;
}
//-->
</script>
If you are not using the default smilies, then you will need to edit the URL of the corresponding smilies at the top of the code. There is no need to edit anything if you have the default smilies.
Preview: Click
Cross Browser.
Global Footer.
Open Source.
<script type="text/javascript">
<!--
/*Add Smilies to Quick Reply - By iAlex - Open Source*/
var iSmileList=[
["http://s3.images.proboards.com/smiley.gif", " :)", "Smiley"],
["http://s3.images.proboards.com/wink.gif", " ;)", "Wink"],
["http://s3.images.proboards.com/cheesy.gif", " :D", "Cheesy"],
["http://s3.images.proboards.com/grin.gif", " ;D", "Grin"],
["http://s3.images.proboards.com/angry.gif", " >:(", "Angry"],
["http://s3.images.proboards.com/sad.gif", " :(", "Sad"],
["http://s3.images.proboards.com/shocked.gif", " :o", "Shocked"],
["http://s3.images.proboards.com/cool.gif", " 8-)", "Cool"],
["http://s3.images.proboards.com/huh.gif", " ???", "Huh"],
["http://s3.images.proboards.com/rolleyes.gif", " ::)", "Roll Eyes"],
["http://s3.images.proboards.com/tongue.gif", " :P", "Tongue"],
["http://s3.images.proboards.com/embarassed.gif", " :-[", "Embarassed"],
["http://s3.images.proboards.com/lipsrsealed.gif", " :-X", "Lips Sealed"],
["http://s3.images.proboards.com/undecided.gif", " :-/", "Undecided"],
["http://s3.images.proboards.com/kiss.gif", " :-*", "Kiss"],
["http://s3.images.proboards.com/cry.gif", " :'(", "Cry"]
];
if(location.href.match(/action=display/)){
var iTd=document.getElementsByTagName('td');
var i=iTd.length;
while(--i){
if(iTd.item(i).className.match(/^titlebg/) && iTd.item(i).width=="100%" && iTd.item(i).innerHTML.match(/>Quick\sReply</)){
var iSmileSpan=document.createElement('div');
iQuick='<font size="2">Smilies:</font><b'+'r />';
for(var a=0;a<iSmileList.length;a++){
iQuick+='<a onclick="javascript: iAddSmile(this)" style="cursor: pointer;" name="'+iSmileList[1]+'"><img src="'+iSmileList[0]+'" alt="'+iSmileList[2]+'" title="'+iSmileList[2]+'" border="0" /></a> ';
}
iQuick+='<b'+'r /><b'+'r />';
iSmileSpan.innerHTML=iQuick;
var iNext=iTd.item(i).parentNode.nextSibling.firstChild;
iNext.insertBefore(iSmileSpan, iNext.firstChild);
break;
}
}
}
function iAddSmile(iLink){
iCode=iLink.name;
var iMessage=iLink.parentNode.parentNode.getElementsByTagName('textarea').item(0)
iMessage.value=iMessage.value+iCode;
}
//-->
</script>