Sha256: 7e4d5d2eb70acbedf930e9fcd1b2b80a506dc5bdf72bc1dd43632a7bc0aeb7fc

Contents?: true

Size: 887 Bytes

Versions: 1

Compression:

Stored size: 887 Bytes

Contents

$(function() {
  $(document).on('pjax:complete', 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
    }]);
  });
});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
easy-emoji-0.0.1 app/assets/javascripts/emoji-pjax.js