Last active
August 29, 2015 14:07
-
-
Save Aufree/421ccfee7bbaa43958d1 to your computer and use it in GitHub Desktop.
The basic configuration of easy-emoji
This file contains 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
$(function(){ | |
emojify.setConfig({ | |
img_dir: '/images/emoji', | |
ignored_tags: { | |
'SCRIPT': 1, | |
'TEXTAREA': 1, | |
'A': 1, | |
'PRE': 1, | |
'CODE': 1 | |
} | |
}); | |
emojify.run(); | |
$('textarea').textcomplete([{ // emoji strategy | |
match: /\B:([\-+\w]*)$/, | |
search: function(term, callback) { | |
callback($.map(emojies, function(emoji) { | |
return emoji.indexOf(term) === 0 ? emoji : null; | |
})); | |
}, | |
template: function(value) { | |
return '<img src="/images/emoji/' + value + '.png" class="emoji"></img>' + value; | |
}, | |
replace: function(value) { | |
return ':' + value + ': '; | |
}, | |
index: 1, | |
maxCount: 5 | |
}]); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment