_init_auto_complete.html.haml 591 Bytes
Newer Older
1 2
:javascript
  $(function() {
3 4
    autocompleteMembers.url = "#{ "/api/v2/projects/#{@project.code}/members" if @project }";
    autocompleteMembers.params.private_token = "#{current_user.private_token}";
5

6
    autocompleteEmoji.data = #{raw emoji_autocomplete_source};
7
    // convert the list so that the items have the right format for completion
8
    autocompleteEmoji.data = $.map(autocompleteEmoji.data, function(value) {
9 10 11 12 13 14 15 16 17
      return {
        name: value,
        insert: value+':',
        image: '#{image_path("emoji")}/'+value+'.png'
      }
    });

    setupGfmAutoComplete();
  });