- Letakan script berikut dibawah tag <head>
- Letakan CSS berikut sebelum kode ]]></b:skin>
.post-body img#new {
margin:0px;
padding:0px;
border:none;
vertical-align:middle;
} - Save.
<script type='text/javascript' src='http://toekang.googlepages.com/DeepaSmiley.js'></script>
Click expand here to look the scriptdocument.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;
}//taken from Netlobo.com (http://www.netlobo.com/javascript_getelementsbyclassname.html)
function addSmiley(dummy){
var d = [], i=0, def = ['post-body','entry-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 (/o:\)/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/25.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\:\-B/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/26.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\=\;/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/27.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\:\-c/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/101.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\:\)\]/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/100.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\~X\(/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/102.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\:\-h/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/103.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\I-\)/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/28.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\8-\|/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/29.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\L-\)/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/30.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\:-\&/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/31.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\:-\$/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/32.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\[-\(/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/33.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\:O\)/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/34.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\8-\}/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/35.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\<\:\-P/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/36.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\(\:\|/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/37.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\=P\~/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/38.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\:-\?/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/39.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\#\-O/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/40.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\:-SS/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/42.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\@-\)/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/43.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\:\^O/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/44.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\:-\</ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/46.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\<\)\:\)/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/48.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace(/\o=\>/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/73.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\o-\+/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/74.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\(\%\)/ig,"<img src = 'http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/75.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\:\"\>/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/9.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\[\-o\</ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/63.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\$\-\)/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/64.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\:\-\"/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/65.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/b-\)/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/16.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/b-\(/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/66.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\:\)\>\-/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/67.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\\\:D\//ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/69.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\>\:\//ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/70.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\;\)\)/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/71.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\:\-\@/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/76.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\^\:\)\^/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/77.gif' id='new' >")
d[i].innerHTML = d[i].innerHTML.replace (/\:\-j/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/78.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\(\*\)/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/79.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/o-\>/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/72.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace(/\=\:\)/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/60.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace(/\>\-\)/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/61.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace(/\:\-L/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/62.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace(/\8-x/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/59.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace(/\*\-\:\)/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/58.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace(/\~O\)/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/57.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace(/\(\~\~\)/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/56.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace(/\*\*\=\=/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/55.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace(/\%\%\-/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/54.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\@\}\;\-/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/53.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\~\:\>/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/52.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace(/\/\:\)/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/23.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace(/\>\:\D\</ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/6.gif' id='new' alt='>:-D<'/>")
d[i].innerHTML = d[i].innerHTML.replace(/\>:\)/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/19.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace(/\=\)\)/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/24.gif' id='new' alt='=)'/>")
d[i].innerHTML = d[i].innerHTML.replace(/\=\(\(/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/12.gif' id='new' alt='=('/>")
d[i].innerHTML = d[i].innerHTML.replace(/\:\)/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/1.gif' id='new' alt=':)'/>")
d[i].innerHTML = d[i].innerHTML.replace(/\:\(\|\)/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/51.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace(/\:\(\(/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/20.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace(/\:\-\*/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/11.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace(/\:\|/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/22.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace(/\:\(/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/2.gif' id='new' alt=':('/>")
d[i].innerHTML = d[i].innerHTML.replace(/\;;\)/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/5.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace(/\;\)/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/3.gif' id='new' alt=';)'/>")
d[i].innerHTML = d[i].innerHTML.replace(/\:D/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/4.gif' id='new' alt=':-D'/>")
d[i].innerHTML = d[i].innerHTML.replace(/\:\-\//ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/7.gif' id='new' alt=':-C'/>")
d[i].innerHTML = d[i].innerHTML.replace(/\:-T/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/104.gif' id='new' alt=':-T'/>")
d[i].innerHTML = d[i].innerHTML.replace(/\:x/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/8.gif' id='new' alt=':X'/>")
d[i].innerHTML = d[i].innerHTML.replace(/\:>/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/15.gif' id='new' alt=':>'/>")
d[i].innerHTML = d[i].innerHTML.replace(/\#:-S/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/18.gif' id='new' alt='hash :- S'/>")
d[i].innerHTML = d[i].innerHTML.replace(/\:-S/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/17.gif' id='new' alt=':-S'/>")
d[i].innerHTML = d[i].innerHTML.replace(/\:o3/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/108.gif' id='new' alt=':o3' />")
d[i].innerHTML = d[i].innerHTML.replace(/\8-\>/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/105.gif' id='new' alt='8->'/>")
d[i].innerHTML = d[i].innerHTML.replace(/\:-W/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/45.gif' id='new' alt=':-w'/>")
d[i].innerHTML = d[i].innerHTML.replace(/\[-*x/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/68.gif' id='new' alt='[-X'/>")
d[i].innerHTML = d[i].innerHTML.replace(/\s*x\(/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/14.gif' id='new' alt='X('/>")
d[i].innerHTML = d[i].innerHTML.replace(/\:-O/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/13.gif' id='new' alt=':-O'/>")
d[i].innerHTML = d[i].innerHTML.replace(/\:P/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/10.gif' id='new' alt='>:P'/>")
d[i].innerHTML = d[i].innerHTML.replace(/\=D>/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/41.gif' id='new' alt='=D>'/>")
d[i].innerHTML = d[i].innerHTML.replace(/\s=;/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/27.gif' id='new' alt='=;>'/>")
d[i].innerHTML = d[i].innerHTML.replace(/\:\-\?\?/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/106.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\%\-\(/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/107.gif' id='new' />")
d[i].innerHTML = d[i].innerHTML.replace (/\:\@\)/ig,"<img src='http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/49.gif' id='new' />")
}
}
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
oldonload();
func();
}
}
}
addLoadEvent(function(){
addSmiley();
});
Source by: http://maid3n.blogspot.com and http://beta-templatetesting.blogspot.com
Tidak ada komentar:
Posting Komentar