gitlabhq/app/views/layouts/_init_auto_complete.html.haml
Riyad Preukschas e4aa5a5c8f Extract and split GFM auto-completion setup JS
* static initialization and setup moved to assets
* per request initialization moved to layout partial
2012-10-10 00:53:55 +02:00

18 lines
593 B
Plaintext

:javascript
$(function() {
autocompleteMembersUrl = "#{ "/api/v2/projects/#{@project.code}/members" if @project }";
autocompleteMembersParams.private_token = "#{current_user.authentication_token}";
autocompleteEmojiData = #{raw emoji_autocomplete_source};
// convert the list so that the items have the right format for completion
autocompleteEmojiData = $.map(autocompleteEmojiData, function(value) {
return {
name: value,
insert: value+':',
image: '#{image_path("emoji")}/'+value+'.png'
}
});
setupGfmAutoComplete();
});