Free javascript Hosting


pika emoticon.js

Uploaded on Sep 25 2009 00:21 by nosameerf

// Based on the original emoticonsforblogger by Kuribo (http://www.kuribo.info/2006/04/emoticons-for-blogger.html)
// Modified by Wolverinex02 (http://wolverinex02.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 Pika Emoticones for Blogger
// @namespace http://wolverinex02.googlepages.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("pika01", "http://www.anikaos.com/0000-pika/kaos-pika01.gif");
buttons += emoticonButton("pika02", "http://www.anikaos.com/0000-pika/kaos-pika02.gif");
buttons += emoticonButton("pika03", "http://www.anikaos.com/0000-pika/kaos-pika03.gif");
buttons += emoticonButton("pika04", "http://www.anikaos.com/0000-pika/kaos-pika04.gif");
buttons += emoticonButton("pika05", "http://www.anikaos.com/0000-pika/kaos-pika05.gif");
buttons += emoticonButton("pika06", "http://www.anikaos.com/0000-pika/kaos-pika06.gif");
buttons += emoticonButton("pika07", "http://www.anikaos.com/0000-pika/kaos-pika07.gif");
buttons += emoticonButton("pika08", "http://www.anikaos.com/0000-pika/kaos-pika08.gif");
buttons += emoticonButton("pika09", "http://www.anikaos.com/0000-pika/kaos-pika09.gif");
buttons += emoticonButton("pika10", "http://www.anikaos.com/0000-pika/kaos-pika10.gif");
buttons += emoticonButton("pika11", "http://www.anikaos.com/0000-pika/kaos-pika11.gif");
buttons += emoticonButton("pika12", "http://www.anikaos.com/0000-pika/kaos-pika12.gif");
buttons += emoticonButton("pika13", "http://www.anikaos.com/0000-pika/kaos-pika13.gif");
buttons = "<br />";
buttons += emoticonButton("pika14", "http://www.anikaos.com/0000-pika/kaos-pika14.gif");
buttons += emoticonButton("pika15", "http://www.anikaos.com/0000-pika/kaos-pika15.gif");
buttons += emoticonButton("pika16", "http://www.anikaos.com/0000-pika/kaos-pika16.gif");
buttons += emoticonButton("pika17", "http://www.anikaos.com/0000-pika/kaos-pika17.gif");
buttons += emoticonButton("pika18", "http://www.anikaos.com/0000-pika/kaos-pika18.gif");
buttons += emoticonButton("pika19", "http://www.anikaos.com/0000-pika/kaos-pika19.gif");
buttons += emoticonButton("pika20", "http://www.anikaos.com/0000-pika/kaos-pika20.gif");
buttons += emoticonButton("pika21", "http://www.anikaos.com/0000-pika/kaos-pika21.gif");
buttons += emoticonButton("pika22", "http://www.anikaos.com/0000-pika/kaos-pika22.gif");
buttons += emoticonButton("pika23", "http://www.anikaos.com/0000-pika/kaos-pika23.gif");
buttons += emoticonButton("pika24", "http://www.anikaos.com/0000-pika/kaos-pika24.gif");
buttons += emoticonButton("pika25", "http://www.anikaos.com/0000-pika/kaos-pika25.gif");
buttons += emoticonButton("pika26", "http://www.anikaos.com/0000-pika/kaos-pika26.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=\\\"50\\\" height=\\\"50\\\" alt=\\\"" + name + "\\\" title=\\\"" + name + "\\\" />\";})();ButtonMouseDown(this);'><img width=\"25\" height=\"25\" src='" + url + "' alt='" + name + "' border='0'></span>\n";
}

function separator() {
return "<div style=\"display: block;\" class=\"vertbar\"><span style=\"display: block;\" class=\"g\">&nbsp;</span><span style=\"display: block;\" class=\"w\">&nbsp;</span></div>\n";
}

setemoticons("formatbar");

}, false);

Back to list