Post by Peter on Jul 20, 2005 4:48:34 GMT -8
Adds the smileys in the quick reply box.
Simple to change, just read the comments
<script type="text/javascript">
<!--
// Created by PopThosePringles
// Base url for the smileys folder
var sBaseImg = "http://s1.images.proboards.com/";
// List of smileys - [SMILEY FILE, CODE, TITLE]
var iSmileys = [
["smiley.gif", "", "Smiley"],
["wink.gif", "", "Wink"],
["grin.gif", "", "Grin"],
["angry.gif", "", "Angry"],
["sad.gif", "", "Sad"],
["shocked.gif", "", "Shocked"],
["cool.gif", "", "Cool"],
["rolleyes.gif", "", "Roll Eyes"],
["tongue.gif", "", "Tongue"],
["embarassed.gif", "", "Embarassed"],
["lipsrsealed.gif", "", "Lips Sealed"],
["undecided.gif", "", "Undecided"],
["kiss.gif", "", "Kiss"],
["cry.gif", "", "Cry"]
];
var iTable = document.getElementsByTagName("table");
function addSmiley(smiley){
var isIE = (document.all)? true : false;
var mArea = document.getElementById("qrform").message;
if(isIE){
mArea.focus();
var iCurSelect = document.selection.createRange();
iCurSelect.text = smiley + iCurSelect.text
} else if(!isIE){
var selStart = mArea.value.substr(0, mArea.selectionStart);
var selEnd = mArea.value.substr(mArea.selectionEnd, mArea.value.length);
var curSelection = mArea.value.replace(selStart, '').replace(selEnd, '');
mArea.value = selStart + smiley + curSelection + selEnd;
} else {
mArea.value += smiley;
}
mArea.focus();
}
for(t = 0; t < iTable.length; t ++){
var iBR = document.createElement("br");
if(iTable.item(t).cellPadding == "4" && iTable.item(t).cellSpacing == "1" && iTable.item(t).rows.item(0).innerHTML.match(/>Quick Reply</)){
var iMCell = iTable.item(t).rows.item(1).cells.item(0);
iTable.item(t).getElementsByTagName("form").item(0).id = "qrform";
iMCell.insertBefore(iBR, iMCell.firstChild);
iSmileys.reverse();
for(s = 0; s < iSmileys.length; s ++){
var sLink = document.createElement("a");
var sImg = document.createElement("img");
sImg.border = "0";
sImg.src = sBaseImg + iSmileys[0];
sImg.title = iSmileys[2];
sLink.href = "javascript: addSmiley(\" " + iSmileys[1] + "\")";
sLink.appendChild(sImg);
iMCell.insertBefore(sLink, iMCell.firstChild);
iMCell.insertBefore(document.createTextNode(" "), iMCell.firstChild);
}
}
}
//-->
</script>
Simple to change, just read the comments
<script type="text/javascript">
<!--
// Created by PopThosePringles
// Base url for the smileys folder
var sBaseImg = "http://s1.images.proboards.com/";
// List of smileys - [SMILEY FILE, CODE, TITLE]
var iSmileys = [
["smiley.gif", "", "Smiley"],
["wink.gif", "", "Wink"],
["grin.gif", "", "Grin"],
["angry.gif", "", "Angry"],
["sad.gif", "", "Sad"],
["shocked.gif", "", "Shocked"],
["cool.gif", "", "Cool"],
["rolleyes.gif", "", "Roll Eyes"],
["tongue.gif", "", "Tongue"],
["embarassed.gif", "", "Embarassed"],
["lipsrsealed.gif", "", "Lips Sealed"],
["undecided.gif", "", "Undecided"],
["kiss.gif", "", "Kiss"],
["cry.gif", "", "Cry"]
];
var iTable = document.getElementsByTagName("table");
function addSmiley(smiley){
var isIE = (document.all)? true : false;
var mArea = document.getElementById("qrform").message;
if(isIE){
mArea.focus();
var iCurSelect = document.selection.createRange();
iCurSelect.text = smiley + iCurSelect.text
} else if(!isIE){
var selStart = mArea.value.substr(0, mArea.selectionStart);
var selEnd = mArea.value.substr(mArea.selectionEnd, mArea.value.length);
var curSelection = mArea.value.replace(selStart, '').replace(selEnd, '');
mArea.value = selStart + smiley + curSelection + selEnd;
} else {
mArea.value += smiley;
}
mArea.focus();
}
for(t = 0; t < iTable.length; t ++){
var iBR = document.createElement("br");
if(iTable.item(t).cellPadding == "4" && iTable.item(t).cellSpacing == "1" && iTable.item(t).rows.item(0).innerHTML.match(/>Quick Reply</)){
var iMCell = iTable.item(t).rows.item(1).cells.item(0);
iTable.item(t).getElementsByTagName("form").item(0).id = "qrform";
iMCell.insertBefore(iBR, iMCell.firstChild);
iSmileys.reverse();
for(s = 0; s < iSmileys.length; s ++){
var sLink = document.createElement("a");
var sImg = document.createElement("img");
sImg.border = "0";
sImg.src = sBaseImg + iSmileys
sImg.title = iSmileys
sLink.href = "javascript: addSmiley(\" " + iSmileys
sLink.appendChild(sImg);
iMCell.insertBefore(sLink, iMCell.firstChild);
iMCell.insertBefore(document.createTextNode(" "), iMCell.firstChild);
}
}
}
//-->
</script>