The following code is for the script we use to make the call emoticon to blog:
*/
function emoticonComentario() {
if(!document.getElementById) {return;} // no soportado
bodyText = document.getElementById('comments');
emoticon = bodyText.innerHTML;
// <b style="color: red;">:)</b> :-) :-]
emoticon = emoticon.replace(/:\)/g,'<img src="<span style="color: #0b5394;">http://static.mobile9.com/bbcode/smileys/smile.gif</span>" />');
emoticon = emoticon.replace(/:-\)/g,'<img src="<span style="color: #0b5394;">http://static.mobile9.com/bbcode/smileys/smile.gif</span>" />');
emoticon = emoticon.replace(/:-\]/g,'<img src="<span style="color: #0b5394;">http://static.mobile9.com/bbcode/smileys/smile.gif</span>" />');
// <b><span style="color: red;">X(</span></b>
emoticon = emoticon.replace(/X\(/g,'<img src="<span style="color: #0b5394;">http://static.mobile9.com/bbcode/smileys/tongue.gif</span>" />');
// :cool:
emoticon = emoticon.replace(/:cool:/g,'<img src="http://static.mobile9.com/bbcode/smileys/wink.gif" />');
// :cry:
emoticon = emoticon.replace(/:cry:/g,'<img src="http://static.mobile9.com/bbcode/smileys/laugh.gif" />');
// :blaf:
emoticon = emoticon.replace(/:blaf:/g,'<img src="http://static.mobile9.com/bbcode/smileys/frown.gif" />');
// :winky:
emoticon = emoticon.replace(/:winky:/g,'<img src="http://static.mobile9.com/bbcode/smileys/thumbup.gif" />');
// :noo:
emoticon = emoticon.replace(/:noo:/g,'<img src="http://static.mobile9.com/bbcode/smileys/blush.gif" />');
// :twisted:
emoticon = emoticon.replace(/:twisted:/g,'<img src="http://static.mobile9.com/bbcode/smileys/byebye.gif" />');
What is in blue corresponds to the URL of the emoticon, that's where you put the URL of your emoticon (in the first part of the code you have to repeat the URL of the image 3 times, from now on you'll just have to put the URL only once).
What is in red corresponds to the code to be used in comments to display the emoticon.
Then save the file in a text editor (eg Notepad) with extension Js and upload it to a hosting like Dropbox or Google Sites, there give you the URL and you'll have to paste before </ body> following the following structure.
<b:if cond='data:blog.pageType == "item"'>
<script src='URL of File .JS' type='text/javascript'/>
<script type='text/javascript'>
emoticonComentario();
</script>
</b:if>
<script src='URL of File .JS' type='text/javascript'/>
<script type='text/javascript'>
emoticonComentario();
</script>
</b:if>
With this we will have ready the emoticons but now we need to show a list of emoticons that readers can use them.
<b:if cond='data:blog.pageType == "item"'>
<div class='divspoiler'>
<img onclick='if (this.parentNode.nextSibling.childNodes[0].style.display != '') { this.parentNode.nextSibling.childNodes[0].style.display = ''; } else { this.parentNode.nextSibling.childNodes[0].style.display = 'none';}' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeFgk72GWnsGBZPExzStse4M293jl83kqH8uyCZj0lQj6FYPouo-UOt0ghzM8ppJ9EKMC-y7b_5ekKzHeLf18svK46Jz3DgOmrQjQevG2bkVQNE4bdRJCyDGNrwYNMtDJOyoypG_emnsI/s1600/Sin+t%C3%ADtulo-1.png'/>
</div><div><div class='spoiler' style='display: none;'>
<div class='comment-content' id='bc_0_1MC'>
<img src='http://static.mobile9.com/bbcode/smileys/smile.gif'/> :) <img src='http://static.mobile9.com/bbcode/smileys/tongue.gif'/> X( <img src='http://static.mobile9.com/bbcode/smileys/wink.gif'/> :cool: <img src='http://static.mobile9.com/bbcode/smileys/laugh.gif'/> :cry: <img src='http://static.mobile9.com/bbcode/smileys/frown.gif'/> :blaf: <img src='http://static.mobile9.com/bbcode/smileys/thumbup.gif'/> :winky: <img src='http://static.mobile9.com/bbcode/smileys/blush.gif'/> :noo: <img src='http://static.mobile9.com/bbcode/smileys/byebye.gif'/> :twisted: <img src='http://static.mobile9.com/bbcode/smileys/clapping.gif'/>:D <img src='http://static.mobile9.com/bbcode/smileys/wow.gif'/> :oops: <img src='http://static.mobile9.com/bbcode/smileys/help.gif'/> :? <img src='http://static.mobile9.com/bbcode/smileys/devil.gif'/> :F
<img src='http://static.mobile9.com/bbcode/smileys/wub.gif'/> :alaba: <img src='http://static.mobile9.com/bbcode/smileys/cry.gif'/>:lpmqtp: <img src='http://static.mobile9.com/bbcode/smileys/thumbdown.gif'/> :idiot:</div>
</div></div>
</b:if>
<div class='divspoiler'>
<img onclick='if (this.parentNode.nextSibling.childNodes[0].style.display != '') { this.parentNode.nextSibling.childNodes[0].style.display = ''; } else { this.parentNode.nextSibling.childNodes[0].style.display = 'none';}' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeFgk72GWnsGBZPExzStse4M293jl83kqH8uyCZj0lQj6FYPouo-UOt0ghzM8ppJ9EKMC-y7b_5ekKzHeLf18svK46Jz3DgOmrQjQevG2bkVQNE4bdRJCyDGNrwYNMtDJOyoypG_emnsI/s1600/Sin+t%C3%ADtulo-1.png'/>
</div><div><div class='spoiler' style='display: none;'>
<div class='comment-content' id='bc_0_1MC'>
<img src='http://static.mobile9.com/bbcode/smileys/smile.gif'/> :) <img src='http://static.mobile9.com/bbcode/smileys/tongue.gif'/> X( <img src='http://static.mobile9.com/bbcode/smileys/wink.gif'/> :cool: <img src='http://static.mobile9.com/bbcode/smileys/laugh.gif'/> :cry: <img src='http://static.mobile9.com/bbcode/smileys/frown.gif'/> :blaf: <img src='http://static.mobile9.com/bbcode/smileys/thumbup.gif'/> :winky: <img src='http://static.mobile9.com/bbcode/smileys/blush.gif'/> :noo: <img src='http://static.mobile9.com/bbcode/smileys/byebye.gif'/> :twisted: <img src='http://static.mobile9.com/bbcode/smileys/clapping.gif'/>:D <img src='http://static.mobile9.com/bbcode/smileys/wow.gif'/> :oops: <img src='http://static.mobile9.com/bbcode/smileys/help.gif'/> :? <img src='http://static.mobile9.com/bbcode/smileys/devil.gif'/> :F
<img src='http://static.mobile9.com/bbcode/smileys/wub.gif'/> :alaba: <img src='http://static.mobile9.com/bbcode/smileys/cry.gif'/>:lpmqtp: <img src='http://static.mobile9.com/bbcode/smileys/thumbdown.gif'/> :idiot:</div>
</div></div>
</b:if>
What this highlighted in green is the URL of the emoticon and what is in pink is the code of the emoticon.
The above code WILL NEED paste it below
<div class='post-footer-line post-footer-line-3'>
With this we have finished the tutorial and you will ready your emoticons, I hope they have been helpful.
I’m impressed. Very informative and trustworthy blog does exactly what it sets out to do.
ReplyDeleteThanks for sharing good post.
website design