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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
e0bddb64
Commit
e0bddb64
authored
Mar 24, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'emoji_with_gzipped_assets' into 'master'
Show emoji in autocomplete when assets gzip compression is on
parents
a87f0376
5e985a7e
Changes
3
Hide 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 @
e0bddb64
...
@@ -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 @
e0bddb64
...
@@ -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 @
e0bddb64
: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