Sha256: 5c0343286ee4b384973dc0bc4615de33358ff66e82fb1899e5cb1e58815ef395
Contents?: true
Size: 1.09 KB
Versions: 19
Compression:
Stored size: 1.09 KB
Contents
var EmoteHelper = { legalEmotes: ['angry', 'arr', 'blink', 'blush', 'brucelee', 'btw', 'chuckle', 'clap', 'cool', 'drool', 'drunk', 'dry', 'eek', 'flex', 'happy', 'holmes', 'huh', 'laugh', 'lol', 'mad', 'mellow', 'noclue', 'oh', 'ohmy', 'ph34r', 'pimp', 'punch', 'realmad', 'rock', 'rofl', 'rolleyes', 'sad', 'scratch', 'shifty', 'shock', 'shrug', 'sleep', 'sleeping', 'smile', 'suicide', 'sweat', 'thumbs', 'tongue', 'unsure', 'w00t', 'wacko', 'whistling', 'wink', 'worship', 'yucky'], emoteToImage: function(emote) { var result = emote; emote = emote.replace(/^:/, '').toLowerCase(); if (EmoteHelper.legalEmotes.find(function(v) { return v == emote })) { result = '<img src="/images/emoticons/#{emote}.gif" alt="#{description}" />'.interpolate({ emote: emote, description: emote }); } return result; }, insertEmotes: function(text) { var result = ''; $A(text.split(/(:[^ ]*)/)).each(function(segment) { if (segment && segment.match(/^:/)) { segment = EmoteHelper.emoteToImage(segment); } result += segment; }); return result; } };
Version data entries
19 entries across 19 versions & 1 rubygems