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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
81a37ca1
Commit
81a37ca1
authored
Apr 24, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved the title onto the emoji tag
This adds the description in all places emojis are used
parent
4bde6eae
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
13 deletions
+7
-13
app/assets/javascripts/awards_handler.js
app/assets/javascripts/awards_handler.js
+5
-12
app/assets/javascripts/behaviors/gl_emoji.js
app/assets/javascripts/behaviors/gl_emoji.js
+1
-0
lib/gitlab/emoji.rb
lib/gitlab/emoji.rb
+1
-1
No files found.
app/assets/javascripts/awards_handler.js
View file @
81a37ca1
...
@@ -29,18 +29,11 @@ const categoryLabelMap = {
...
@@ -29,18 +29,11 @@ const categoryLabelMap = {
flags
:
'
Flags
'
,
flags
:
'
Flags
'
,
};
};
function
createEmojiObject
(
alias
)
{
return
{
alias
,
description
:
emojiMap
[
alias
].
description
,
};
};
function
buildCategoryMap
()
{
function
buildCategoryMap
()
{
return
Object
.
keys
(
emojiMap
).
reduce
((
currentCategoryMap
,
emojiNameKey
)
=>
{
return
Object
.
keys
(
emojiMap
).
reduce
((
currentCategoryMap
,
emojiNameKey
)
=>
{
const
emojiInfo
=
emojiMap
[
emojiNameKey
];
const
emojiInfo
=
emojiMap
[
emojiNameKey
];
if
(
currentCategoryMap
[
emojiInfo
.
category
])
{
if
(
currentCategoryMap
[
emojiInfo
.
category
])
{
currentCategoryMap
[
emojiInfo
.
category
].
push
(
createEmojiObject
(
emojiNameKey
)
);
currentCategoryMap
[
emojiInfo
.
category
].
push
(
emojiNameKey
);
}
}
return
currentCategoryMap
;
return
currentCategoryMap
;
...
@@ -62,10 +55,10 @@ function renderCategory(name, emojiList, opts = {}) {
...
@@ -62,10 +55,10 @@ function renderCategory(name, emojiList, opts = {}) {
${
name
}
${
name
}
</h5>
</h5>
<ul class="clearfix emoji-menu-list
${
opts
.
menuListClass
||
''
}
">
<ul class="clearfix emoji-menu-list
${
opts
.
menuListClass
||
''
}
">
${
emojiList
.
map
(
emoji
=>
`
${
emojiList
.
map
(
emoji
Name
=>
`
<li class="emoji-menu-list-item">
<li class="emoji-menu-list-item">
<button class="emoji-menu-btn text-center js-emoji-btn" type="button"
title="
${
emoji
.
description
}
"
>
<button class="emoji-menu-btn text-center js-emoji-btn" type="button">
${
glEmojiTag
(
emoji
.
alias
,
{
${
glEmojiTag
(
emoji
Name
,
{
sprite
:
true
,
sprite
:
true
,
})}
})}
</button>
</button>
...
@@ -505,7 +498,7 @@ AwardsHandler.prototype.getFrequentlyUsedEmojis = function getFrequentlyUsedEmoj
...
@@ -505,7 +498,7 @@ AwardsHandler.prototype.getFrequentlyUsedEmojis = function getFrequentlyUsedEmoj
const
frequentlyUsedEmojis
=
_
.
uniq
((
Cookies
.
get
(
'
frequently_used_emojis
'
)
||
''
).
split
(
'
,
'
));
const
frequentlyUsedEmojis
=
_
.
uniq
((
Cookies
.
get
(
'
frequently_used_emojis
'
)
||
''
).
split
(
'
,
'
));
this
.
frequentlyUsedEmojis
=
frequentlyUsedEmojis
.
filter
(
this
.
frequentlyUsedEmojis
=
frequentlyUsedEmojis
.
filter
(
inputName
=>
isEmojiNameValid
(
inputName
),
inputName
=>
isEmojiNameValid
(
inputName
),
)
.
map
(
emojiNameKey
=>
createEmojiObject
(
emojiNameKey
))
;
);
return
this
.
frequentlyUsedEmojis
;
return
this
.
frequentlyUsedEmojis
;
})();
})();
...
...
app/assets/javascripts/behaviors/gl_emoji.js
View file @
81a37ca1
...
@@ -62,6 +62,7 @@ function glEmojiTag(inputName, options) {
...
@@ -62,6 +62,7 @@ function glEmojiTag(inputName, options) {
data-fallback-src="
${
fallbackImageSrc
}
"
data-fallback-src="
${
fallbackImageSrc
}
"
${
fallbackSpriteAttribute
}
${
fallbackSpriteAttribute
}
data-unicode-version="
${
emojiInfo
.
unicodeVersion
}
"
data-unicode-version="
${
emojiInfo
.
unicodeVersion
}
"
title=
${
emojiInfo
.
description
}
>
>
${
contents
}
${
contents
}
</gl-emoji>
</gl-emoji>
...
...
lib/gitlab/emoji.rb
View file @
81a37ca1
...
@@ -54,7 +54,7 @@ module Gitlab
...
@@ -54,7 +54,7 @@ module Gitlab
unicode_version:
emoji_unicode_version
(
emoji_name
)
unicode_version:
emoji_unicode_version
(
emoji_name
)
}
}
ActionController
::
Base
.
helpers
.
content_tag
(
'gl-emoji'
,
emoji_info
[
'moji'
],
data:
data
)
ActionController
::
Base
.
helpers
.
content_tag
(
'gl-emoji'
,
emoji_info
[
'moji'
],
title:
emoji_info
[
'description'
],
data:
data
)
end
end
end
end
end
end
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