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.

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:

before

Becomes this amazing, exciting HTML!

after

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.

Post A Comment

  • Any of these HTML tags may be used for style: a, b, i, br, p, strong, em, pre, code.
  • Multi-line JavaScript code should be wrapped in <pre class="brush:js"></pre>
    (supported syntax highlighting brushes: js, css, php, plain, bash, ruby, html, xml)
  • Use &lt; instead of < and &gt; instead of > in the examples themselves.