Free javascript Hosting


smileys_bloggerv2.js

Uploaded on Dec 27 2009 16:18 by tolgaask

function showsbtext(id,index) {
var bookmarktext=document.getElementById(id);
document.getElementById(bookmarktext.id).innerHTML = sbValues[index];
}


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(dummy)
{
var d = [], i=0, def = ['Blog','content','comment-body'];

for(i=0;i<def.length;i++)
{
var content = document.getElementsByClassName(def[i]);
for(var j=0;j<content.length;j++)
d.push(content[j]);
}

for(i=0;i<arguments.length;i++)
{
var content = document.getElementsByClassName(arguments[i]);
for(var m=0;m<content.length;m++)
d.push(content[m]);
}

for(var i=0;i<d.length;i++)
{
d[i].innerHTML = d[i].innerHTML.replace (/\:\(/ig,"<img style='border: 0; padding:0' src='http://img692.imageshack.us/img692/8888/iconsad.gif' alt='Uzgun'/>")
d[i].innerHTML = d[i].innerHTML.replace (/\:\)/ig,"<img style='border: 0; padding:0' src='http://img8.imageshack.us/img8/5008/iconsmilep.gif' alt='Mutlu'/>")
d[i].innerHTML = d[i].innerHTML.replace (/\;\)/ig,"<img style='border: 0; padding:0' src='http://img130.imageshack.us/img130/2562/iconwinka.gif' alt='Sakin'/>")
d[i].innerHTML = d[i].innerHTML.replace(/\:D/ig,"<img style='border: 0; padding:0' src='http://img692.imageshack.us/img692/6153/iconbiggrink.gif' alt='Sevincli'/>")
d[i].innerHTML = d[i].innerHTML.replace (/\:P/ig,"<img style='border: 0; padding:0' src='http://img690.imageshack.us/img690/3/iconrazzf.gif' alt='Dil'/>")
d[i].innerHTML = d[i].innerHTML.replace (/\:Q/ig,"<img style='border: 0; padding:0' src='http://img696.imageshack.us/img696/6139/iconevil.gif' alt='Kizgin'/>")
d[i].innerHTML = d[i].innerHTML.replace (/\:S/ig,"<img style='border: 0; padding:0' src='http://img684.imageshack.us/img684/3135/iconconfused.gif' alt='Kafasikarisik'/>")
d[i].innerHTML = d[i].innerHTML.replace (/\:\H/ig,"<img style='border: 0; padding:0' src='http://img192.imageshack.us/img192/361/iconcool.gif' alt='Havali'/>")
d[i].innerHTML = d[i].innerHTML.replace (/\:\O/ig,"<img style='border: 0; padding:0' src='http://img34.imageshack.us/img34/116/iconeekm.gif' alt='Saskin'/>")




}
}

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

addLoadEvent(function(){
addSmiley();
});

Back to list