Free javascript Hosting


yahoosmileys2.js

Uploaded on Nov 04 2009 05:35 by kcalpesh

document.getElementsByClassName = function(clsName){
var retVal = new Array();
var elements = document.getElementsByTagName("*");
for(var i = 0;i < elements.length;i++){
if(elements[i].className.indexOf(" ") >= 0){
var classes = elements[i].className.split(" ");
for(var j = 0;j < classes.length;j++){
if(classes[j] == clsName)
retVal.push(elements[i]);
}
}
else if(elements[i].className == clsName)
retVal.push(elements[i]);
}
return retVal;
}

function addSmiley(){
var postBodyClass = (postBodyClass) ? postBodyClass : 'post-body';
var d = document.getElementsByClassName(postBodyClass);
for(var i=0;i<d.length;i++){

d[i].innerHTML = d[i].innerHTML.replace(/\s:-*\)/g, ' <img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/1.gif" title="Smile" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*\(/g, ' <img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/2.gif" title="Sad" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s;-*\)/g, ' <img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/3.gif" title="Wink" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*D/g, ' <img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/4.gif" title="Grin" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*o/g, ' <img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/13.gif" title="Shock" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*k/g, ' <img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/11.gif" title="Kiss" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*c/g, ' <img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/20.gif" title="Cry" style="border:0; margin:0; padding:0;" id="new" /> ');



}

var d = document.getElementsByClassName('comment-body');
for(var i=0;i<d.length;i++){
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*\)/g, ' <img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/1.gif" title="Smile" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*\(/g, ' <img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/2.gif" title="Sad" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s;-*\)/g, ' <img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/3.gif" title="Wink" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*D/g, ' <img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/4.gif" title="Grin" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*o/g, ' <img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/13.gif" title="Shock" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*k/g, ' <img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/11.gif" title="Kiss" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*c/g, ' <img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/20.gif" title="Cry" style="border:0; margin:0; padding:0;" id="new" /> ');

}

var d = document.getElementsByClassName('comment-body-author');
for(var i=0;i<d.length;i++){
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*\)/g, ' <img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/1.gif" title="Smile" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*\(/g, ' <img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/2.gif" title="Sad" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s;-*\)/g, ' <img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/3.gif" title="Wink" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*D/g, ' <img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/4.gif" title="Grin" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*o/g, ' <img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/13.gif" title="Shock" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*k/g, ' <img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/11.gif" title="Kiss" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*c/g, ' <img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/20.gif" title="Cry" style="border:0; margin:0; padding:0;" id="new" /> ');

}

var d = document.getElementsByClassName('widget-content');
for(var i=0;i<d.length;i++){
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*\(/g, ' <img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/2.gif" title="Sad" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s;-*\)/g, ' <img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/3.gif" title="Wink" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*D/g, ' <img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/4.gif" title="Grin" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*o/g, ' <img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/13.gif" title="Shock" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*k/g, ' <img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/11.gif" title="Kiss" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*c/g, ' <img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/20.gif" title="Cry" style="border:0; margin:0; padding:0;" id="new" /> ');

}
}

function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
oldonload();
func();
}
}
}

addLoadEvent(addSmiley);

Back to list