Created
March 7, 2012 11:37
-
-
Save jrom/1992651 to your computer and use it in GitHub Desktop.
Emoji plugin for Talker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugin.onMessageInsertion = function (event) { | |
var content; | |
content = Talker.getLastInsertion().replace(/:[\w_+]+:/g, function (match) { | |
var emoji = match, | |
filename = (emoji == ':+1:' ? ':plus1:' : emoji).replace(/:/g, ''); | |
return "<img class=\"emoji\" title=\"" + emoji + "\" alt=\"" + emoji + "\" height=\"20\" width=\"20\" align=\"absmiddle\" src=\"https://teambox.com/assets/emojis/" + filename + ".png\">" | |
}); | |
return content; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment