Free javascript Hosting


smileys_blogger.js

Uploaded on Dec 27 2009 15:38 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://img18.imageshack.us/img18/7169/uzgun.png' alt='Uzgun'/>")
d[i].innerHTML = d[i].innerHTML.replace (/\:\)/ig,"<img style='border: 0; padding:0' src='http://img18.imageshack.us/img18/1590/duz.png' alt='Mutlu'/>")
d[i].innerHTML = d[i].innerHTML.replace (/\;\)/ig,"<img style='border: 0; padding:0' src='http://img9.imageshack.us/img9/5402/gozkrpan.png' alt='Sakin'/>")
d[i].innerHTML = d[i].innerHTML.replace(/\:D/ig,"<img style='border: 0; padding:0' src='http://img18.imageshack.us/img18/8626/gulucuk.png' alt='Sevincli'/>")
d[i].innerHTML = d[i].innerHTML.replace (/\:P/ig,"<img style='border: 0; padding:0' src='http://img18.imageshack.us/img18/768/dil.png' alt='Dil'/>")
d[i].innerHTML = d[i].innerHTML.replace (/\:Q/ig,"<img style='border: 0; padding:0' src='http://img9.imageshack.us/img9/8262/kizgin.png' alt='Kizgin'/>")
d[i].innerHTML = d[i].innerHTML.replace (/\:S/ig,"<img style='border: 0; padding:0' src='http://img27.imageshack.us/img27/2941/saskin.png' alt='Saskin'/>")
d[i].innerHTML = d[i].innerHTML.replace (/\=\)/ig,"<img style='border: 0; padding:0' src='http://img26.imageshack.us/img26/692/surat.png' alt='Surat'/>")




}
}

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