|
function typeSmiley(sSmiley)
{
if (document.getElementsByTagName('textarea')[0].getAttribute('name') == 'bdescr')
var editor = document.getElementsByTagName('textarea')[0];
else
{
var allTextAreas = document.getElementsByTagName('textarea');
for (i = 0; i < allTextAreas.length; ++i)
{
if (allTextAreas[i].getAttribute('name') == 'bdescr')
{
var editor = allTextAreas[i];
break;
}
}
}
editor.value = editor.value + sSmiley;
}
function replaceTextSmileys()
{
// ***add textual emoticons to the array below
var textSmileys = new Array(
":)",
":(",
":wink:",
":p",
":lol:",
":mad:",
":heartbeat:",
":love:",
":eprop:",
":wave:",
":sunny:",
":wha:",
":yes:",
":sleepy:",
":rolleyes:",
":lookaround:",
":eek:",
":confused:",
":nono:",
":fun:",
":goodjob:",
":giggle:",
":cry:",
":shysmile:",
":jealous:",
":whocares:",
":spinning:",
":coolman:",
":littlekiss:",
":laugh:");
// *** add the url's from the corresponding images below
var realSmileys = new Array(
"http://www.xanga.com/Images/smiley1.gif",
"http://www.xanga.com/Images/smiley2.gif",
"http://i.xanga.com/Alice/AliceSmileyAnimatedWink.gif",
"http://www.xanga.com/Images/smiley4.gif",
"http://i.xanga.com/Alice/Smileylol.gif",
"http://i.xanga.com/Alice/7_mad.gif",
"http://i.xanga.com/Alice/heartbeating.gif",
"http://i.xanga.com/Alice/SmileLove.gif",
"http://i.xanga.com/Alice/eProp.gif",
"http://i.xanga.com/Alice/SmileyWave.gif",
"http://i.xanga.com/Alice/sunnySmiley.gif",
"http://i.xanga.com/Alice/wha.gif",
"http://i.xanga.com/Alice/yes.gif",
"http://i.xanga.com/Alice/Smileysleep.gif",
"http://i.xanga.com/Alice/Smileyrolleyes.gif",
"http://i.xanga.com/Alice/SmileyLookaround.gif",
"http://i.xanga.com/Alice/Smileyeek.gif",
"http://i.xanga.com/Alice/Smileyconfused.gif",
"http://i.xanga.com/Alice/SmileyAnimatedNoNo.gif",
"http://i.xanga.com/Alice/propeller.gif",
"http://i.xanga.com/Alice/goodjob.gif",
"http://i.xanga.com/Alice/emot-giggle.gif",
"http://i.xanga.com/Alice/blueAnimatedCry.gif",
"http://i.xanga.com/Alice/Animatedshysmile.gif",
"http://i.xanga.com/Alice/AliceJealous.gif",
"http://i.xanga.com/Alice/19_indifferent.gif",
"http://i.xanga.com/Alice/Smileyspinning.gif",
"http://i.xanga.com/Alice/25_coolguy.gif",
"http://i.xanga.com/Alice/AliceSmileyAnimatedBlinkKiss.gif",
"http://i.xanga.com/Alice/LaughingAgua.gif");
// *** number of smileys that will be displayed per row
var maxNumberOfSmileysPerRow = 10;
// *** button size in pixels
var buttonSize = 30;
// preloading images
var preloadedImages = new Array(realSmileys.length);
for (i = 0; i < preloadedImages.length; ++i)
{
preloadedImages[i] = new Image();
preloadedImages[i].src = realSmileys[i];
}
var allTableData = document.getElementsByTagName('td');
var indx;
var smiley;
var replacement;
for (var i = 0 ; i < allTableData.length ; ++i )
{
for ( var n = 0 ; n < textSmileys.length; ++n )
{
if ((allTableData[i].innerHTML.toUpperCase().indexOf('TABLE') == -1) &&
(allTableData[i].innerHTML.indexOf('previewHTML()') == -1))
{
indx = allTableData[i].innerHTML.indexOf(textSmileys[n]);
if (indx != -1)
{
while (indx != -1)
{
replacement = '';
indx = allTableData[i].innerHTM |