// Based on the original emoticonsforblogger by Kuribo (http://www.kuribo.info/2006/04/emoticons-for-blogger.html) // Modified by thedieyna (http://dieyna-afieyna.blogspot.com/) // FEATURES // Works only in Compose modes // Add the emoticons at the end of the text // TODO // modify the script to insert the emoticon directly after the cursor // ==UserScript== // @name Kawaii Emoticons // @namespace http://dieyna-afieyna.blogspot.com/ // @description You can use emoticons in Blogger. // @include http://*.blogger.com/post-edit.g?* // @include http://*.blogger.com/post-create.g?* // ==/UserScript== window.addEventListener("load", function(e) { function setemoticons(domname) { var editbar = document.getElementById(domname); if (editbar) { var buttons = "<br />"; buttons += emoticonButton("emoticon01", "http://emo.com/emotikon.gif"); buttons += emoticonButton("emoticon02", "http://emo.com/emotikon.gif"); buttons += emoticonButton("emoticon03", "http://emo.com/emotikon.gif"); buttons += separator(); editbar.innerHTML += buttons; } } function emoticonButton(name, url) { return "<span class='' style='display: block;' id='htmlbar_undefined' title='" + name + "' onmouseover='ButtonHoverOn(this);' onmouseout='ButtonHoverOff(this);' onmouseup='' onmousedown='CheckFormatting(event);(function() {var rich_edit = document.getElementById(\"richeditorframe\");var rich_body = rich_edit.contentDocument.getElementsByTagName(\"body\");rich_body[0].innerHTML+=\"<img class=\\\"emoticon\\\" src=\\\""+url+"\\\" width=\\\"\\\" height=\\\"\\\" alt=\\\"" + name + "\\\" title=\\\"" + name + "\\\" />\";})();ButtonMouseDown(this);'><img src='" + url + "' alt='" + name + "' border='0'></span>\n"; } function separator() { return "<div style=\"display: block;\" class=\"vertbar\"><span style=\"display: block;\" class=\"g\"> </span><span style=\"display: block;\" class=\"w\"> </span></div>\n"; } setemoticons("formatbar"); }, false);