BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
4 deletions
+2
-4
gfm_auto_complete.js.coffee
app/assets/javascripts/gfm_auto_complete.js.coffee
+1
-2
projects_controller.rb
app/controllers/projects_controller.rb
+1
-1
_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 =
...
@@ -6,7 +6,6 @@ GitLab.GfmAutoComplete =
dataSource
:
''
dataSource
:
''
# Emoji
# Emoji
Emoji
:
Emoji
:
assetBase
:
''
template
:
'<li data-value="${insert}">${name} <img alt="${name}" height="20" src="${image}" width="20" /></li>'
template
:
'<li data-value="${insert}">${name} <img alt="${name}" height="20" src="${image}" width="20" /></li>'
# Team Members
# Team Members
...
@@ -27,7 +26,7 @@ GitLab.GfmAutoComplete =
...
@@ -27,7 +26,7 @@ GitLab.GfmAutoComplete =
tpl
:
@
Emoji
.
template
tpl
:
@
Emoji
.
template
callbacks
:
callbacks
:
before_save
:
(
emojis
)
=>
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
# Team Members
input
.
atwho
input
.
atwho
...
...
app/controllers/projects_controller.rb
View file @
5e985a7e
...
@@ -124,7 +124,7 @@ class ProjectsController < ApplicationController
...
@@ -124,7 +124,7 @@ class ProjectsController < ApplicationController
def
autocomplete_sources
def
autocomplete_sources
@suggestions
=
{
@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
]),
issues:
@project
.
issues
.
select
([
:iid
,
:title
,
:description
]),
mergerequests:
@project
.
merge_requests
.
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
}
}
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
:javascript
GitLab
.
GfmAutoComplete
.
dataSource
=
"
#{
autocomplete_sources_project_path
(
@project
)
}
"
GitLab
.
GfmAutoComplete
.
dataSource
=
"
#{
autocomplete_sources_project_path
(
@project
)
}
"
GitLab
.
GfmAutoComplete
.
Emoji
.
assetBase
=
"
#{
Gitlab
.
config
.
gitlab
.
relative_url_root
+
Emoji
.
asset_path
}
"
GitLab
.
GfmAutoComplete
.
setup
();
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