JavaScript Emotify: Making the web a better place, one tiny image at a time...
JavaScript Emotify helps make the web a better place, one tiny image at a time… (the original title was “this is what it sounds like when HTML cries” but Prince’s lawyers sent me a C&D citing, get this, “bad taste”). Seriously though, this code turns text into “emotified” HTML. You know, like, with smileys.
- Release v0.6
- No third-party JavaScript API required.
- Tested in Internet Explorer 6-8, Firefox 3-3.5, Safari 3-4, Chrome, Opera 9.6-10.
- Download Source, Minified (1.1kb)
- Follow the project on GitHub project page
- View Full Documentation
- Examples: Basic Emotification, Adium Emoticonsets
To make a long story short…
This code was originally written as a way to “pretty-up” the chat text in Simplified, my Linkinus message theme. And like much of my code, it seemed like a good idea to make it as generalized as possible, so that others could benefit from my “hard work” (also known as “lack of something better to do with my spare time”).
And the result?
This sad, old, uninteresting text:
Becomes this amazing, exciting HTML!
I won’t bore you with any code samples on this page, because it’s really “just that simple” (and there are plenty of code samples in the examples and documentation).
Check out either the basic emotification example, where emoticons are defined in a simple, standard way.. or the much more intense, thrilling Adium Emoticonsets example, where emoticons from the popular open-source chat client are loaded dynamically.. and the world simply becomes a better place in which to live.
a
,b
,i
,br
,p
,strong
,em
,pre
,code
.<pre class="brush:js"></pre>
(supported syntax highlighting brushes:
js
,css
,php
,plain
,bash
,ruby
,html
,xml
)<
instead of<
and>
instead of>
in the examples themselves.