Post by iAlex on Dec 17, 2007 6:20:13 GMT -5
This code will place the smilies that appear when posting into a box next to the message box. Similar to InvisionFree. Simply edit the red text at the top of the code with the number of smilies that will appear per line.
Preview: Click
Cross Browser.
Global Footer.
Open Source.
<script type="text/javascript">
<!--
/*Smilies Box - By iAlex - Open Source*/
var iSmilieLine=4; //Smilies Per Line
if(document.postForm && document.postForm.color){
var iLine=document.createElement('br');
var iSmilies=document.postForm.color.parentNode.parentNode.parentNode.nextSibling;
var iCell=iSmilies.lastChild.firstChild;
var iSmileLink=iCell.getElementsByTagName('img');
for(i=0;i<iSmileLink.length;i=i+iSmilieLine){
iCell.insertBefore(iLine.cloneNode(true), iSmileLink.item(i).parentNode);
iCell.insertBefore(iLine.cloneNode(true), iSmileLink.item(i).parentNode);
}
var iDiv=document.createElement('div');
iDiv.innerHTML='<b'+'r /><table cellpadding="4" cellspacing="1" class="bordercolor" align="center"><tr><td align="center" class="windowbg"><b><font size="1">Clickable Smilies</font></b><b'+'r /><div id="iSmileHold"></div></td></tr></table>';
iSmilies.style.display='none';
document.postForm.message.parentNode.parentNode.previousSibling.appendChild(iDiv);
document.getElementById('iSmileHold').appendChild(iCell);
}
//-->
</script>
Preview: Click
Cross Browser.
Global Footer.
Open Source.
<script type="text/javascript">
<!--
/*Smilies Box - By iAlex - Open Source*/
var iSmilieLine=4; //Smilies Per Line
if(document.postForm && document.postForm.color){
var iLine=document.createElement('br');
var iSmilies=document.postForm.color.parentNode.parentNode.parentNode.nextSibling;
var iCell=iSmilies.lastChild.firstChild;
var iSmileLink=iCell.getElementsByTagName('img');
for(i=0;i<iSmileLink.length;i=i+iSmilieLine){
iCell.insertBefore(iLine.cloneNode(true), iSmileLink.item(i).parentNode);
iCell.insertBefore(iLine.cloneNode(true), iSmileLink.item(i).parentNode);
}
var iDiv=document.createElement('div');
iDiv.innerHTML='<b'+'r /><table cellpadding="4" cellspacing="1" class="bordercolor" align="center"><tr><td align="center" class="windowbg"><b><font size="1">Clickable Smilies</font></b><b'+'r /><div id="iSmileHold"></div></td></tr></table>';
iSmilies.style.display='none';
document.postForm.message.parentNode.parentNode.previousSibling.appendChild(iDiv);
document.getElementById('iSmileHold').appendChild(iCell);
}
//-->
</script>