Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
5e985a7e
Commit
5e985a7e
authored
Mar 24, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use emoji assets on autocomplete.
parent
a87f0376
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
4 deletions
+2
-4
app/assets/javascripts/gfm_auto_complete.js.coffee
app/assets/javascripts/gfm_auto_complete.js.coffee
+1
-2
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+1
-1
app/views/layouts/_init_auto_complete.html.haml
app/views/layouts/_init_auto_complete.html.haml
+0
-1
No files found.
app/assets/javascripts/gfm_auto_complete.js.coffee
View file @
5e985a7e
...
...
@@ -6,7 +6,6 @@ GitLab.GfmAutoComplete =
dataSource
:
''
# Emoji
Emoji
:
assetBase
:
''
template
:
'<li data-value="${insert}">${name} <img alt="${name}" height="20" src="${image}" width="20" /></li>'
# Team Members
...
...
@@ -27,7 +26,7 @@ GitLab.GfmAutoComplete =
tpl
:
@
Emoji
.
template
callbacks
:
before_save
:
(
emojis
)
=>
$
.
map
emojis
,
(
em
)
=>
name
:
em
,
insert
:
em
+
':'
,
image
:
"
#{
@
Emoji
.
assetBase
}
/
#{
em
}
.png"
$
.
map
emojis
,
(
em
)
=>
name
:
em
.
name
,
insert
:
em
.
name
+
':'
,
image
:
em
.
path
# Team Members
input
.
atwho
...
...
app/controllers/projects_controller.rb
View file @
5e985a7e
...
...
@@ -124,7 +124,7 @@ class ProjectsController < ApplicationController
def
autocomplete_sources
@suggestions
=
{
emojis:
Emoji
.
names
,
emojis:
Emoji
.
names
.
map
{
|
e
|
{
name:
e
,
path:
view_context
.
image_url
(
"emoji/
#{
e
}
.png"
)
}
}
,
issues:
@project
.
issues
.
select
([
:iid
,
:title
,
:description
]),
mergerequests:
@project
.
merge_requests
.
select
([
:iid
,
:title
,
:description
]),
members:
@project
.
team
.
members
.
sort_by
(
&
:username
).
map
{
|
user
|
{
username:
user
.
username
,
name:
user
.
name
}
}
...
...
app/views/layouts/_init_auto_complete.html.haml
View file @
5e985a7e
:javascript
GitLab
.
GfmAutoComplete
.
dataSource
=
"
#{
autocomplete_sources_project_path
(
@project
)
}
"
GitLab
.
GfmAutoComplete
.
Emoji
.
assetBase
=
"
#{
Gitlab
.
config
.
gitlab
.
relative_url_root
+
Emoji
.
asset_path
}
"
GitLab
.
GfmAutoComplete
.
setup
();
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment