gitlab-org--gitlab-foss/app/views/layouts/_init_auto_complete.html.haml
2012-12-21 18:55:39 +01:00

17 lines
652 B
Text

:javascript
$(function() {
GitLab.GfmAutoComplete.Members.url = "#{ "/api/v3/projects/#{@project.id}/members" if @project }";
GitLab.GfmAutoComplete.Members.params.private_token = "#{current_user.private_token}";
GitLab.GfmAutoComplete.Emoji.data = #{raw emoji_autocomplete_source};
// convert the list so that the items have the right format for completion
GitLab.GfmAutoComplete.Emoji.data = $.map(GitLab.GfmAutoComplete.Emoji.data, function(value) {
return {
name: value,
insert: value+':',
image: '#{image_path("emoji")}/'+value+'.png'
}
});
GitLab.GfmAutoComplete.setup();
});