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
27a1348f
Commit
27a1348f
authored
Jun 27, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
split emoji support methods from the async module
parent
88114c41
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
12 deletions
+16
-12
app/assets/javascripts/behaviors/gl_emoji.js
app/assets/javascripts/behaviors/gl_emoji.js
+3
-5
app/assets/javascripts/emoji/index.js
app/assets/javascripts/emoji/index.js
+0
-4
app/assets/javascripts/emoji/support/index.js
app/assets/javascripts/emoji/support/index.js
+10
-0
app/assets/javascripts/emoji/support/is_emoji_unicode_supported.js
...s/javascripts/emoji/support/is_emoji_unicode_supported.js
+0
-0
app/assets/javascripts/emoji/support/unicode_support_map.js
app/assets/javascripts/emoji/support/unicode_support_map.js
+1
-1
spec/javascripts/behaviors/gl_emoji/unicode_support_map_spec.js
...avascripts/behaviors/gl_emoji/unicode_support_map_spec.js
+1
-1
spec/javascripts/gl_emoji_spec.js
spec/javascripts/gl_emoji_spec.js
+1
-1
No files found.
app/assets/javascripts/behaviors/gl_emoji.js
View file @
27a1348f
import
installCustomElements
from
'
document-register-element
'
;
import
{
emojiMap
,
normalizeEmojiName
,
isEmojiUnicodeSupported
,
getUnicodeSupportMap
}
from
'
../emoji
'
;
import
{
emojiMap
,
normalizeEmojiName
}
from
'
../emoji
'
;
import
isEmojiUnicodeSupported
from
'
../emoji/support
'
;
installCustomElements
(
window
);
const
generatedUnicodeSupportMap
=
getUnicodeSupportMap
();
function
emojiImageTag
(
name
,
src
)
{
return
`<img class="emoji" title=":
${
name
}
:" alt=":
${
name
}
:" src="
${
src
}
" width="20" height="20" align="absmiddle" />`
;
}
...
...
@@ -82,7 +81,7 @@ function installGlEmojiElement() {
if
(
emojiUnicode
&&
isEmojiUnicode
&&
!
isEmojiUnicodeSupported
(
generatedUnicodeSupportMap
,
emojiUnicode
,
unicodeVersion
)
!
isEmojiUnicodeSupported
(
emojiUnicode
,
unicodeVersion
)
)
{
// CSS sprite fallback takes precedence over image fallback
if
(
hasCssSpriteFalback
)
{
...
...
@@ -106,5 +105,4 @@ function installGlEmojiElement() {
export
{
installGlEmojiElement
,
glEmojiTag
,
emojiImageTag
,
};
app/assets/javascripts/emoji/index.js
View file @
27a1348f
import
emojiMap
from
'
emojis/digests.json
'
;
import
emojiAliases
from
'
emojis/aliases.json
'
;
import
getUnicodeSupportMap
from
'
./unicode_support_map
'
;
import
isEmojiUnicodeSupported
from
'
./is_emoji_unicode_supported
'
;
const
validEmojiNames
=
[...
Object
.
keys
(
emojiMap
),
...
Object
.
keys
(
emojiAliases
)];
...
...
@@ -52,8 +50,6 @@ export {
filterEmojiNames
,
filterEmojiNamesByAlias
,
getEmojiByCategory
,
getUnicodeSupportMap
,
isEmojiNameValid
,
isEmojiUnicodeSupported
,
validEmojiNames
,
};
app/assets/javascripts/emoji/support/index.js
0 → 100644
View file @
27a1348f
import
isEmojiUnicodeSupported
from
'
./is_emoji_unicode_supported
'
;
import
getUnicodeSupportMap
from
'
./unicode_support_map
'
;
// cache browser support map between calls
let
browserUnicodeSupportMap
;
export
default
function
isEmojiUnicodeSupportedByBrowser
(
emojiUnicode
,
unicodeVersion
)
{
browserUnicodeSupportMap
=
browserUnicodeSupportMap
||
getUnicodeSupportMap
();
return
isEmojiUnicodeSupported
(
browserUnicodeSupportMap
,
emojiUnicode
,
unicodeVersion
);
}
app/assets/javascripts/emoji/is_emoji_unicode_supported.js
→
app/assets/javascripts/emoji/
support/
is_emoji_unicode_supported.js
View file @
27a1348f
File moved
app/assets/javascripts/emoji/unicode_support_map.js
→
app/assets/javascripts/emoji/
support/
unicode_support_map.js
View file @
27a1348f
import
AccessorUtilities
from
'
../lib/utils/accessor
'
;
import
AccessorUtilities
from
'
../
../
lib/utils/accessor
'
;
const
unicodeSupportTestMap
=
{
// man, student (emojione does not have any of these yet), http://emojipedia.org/emoji-zwj-sequences/
...
...
spec/javascripts/behaviors/gl_emoji/unicode_support_map_spec.js
View file @
27a1348f
import
getUnicodeSupportMap
from
'
~/emoji/unicode_support_map
'
;
import
getUnicodeSupportMap
from
'
~/emoji/
support/
unicode_support_map
'
;
import
AccessorUtilities
from
'
~/lib/utils/accessor
'
;
describe
(
'
Unicode Support Map
'
,
()
=>
{
...
...
spec/javascripts/gl_emoji_spec.js
View file @
27a1348f
...
...
@@ -5,7 +5,7 @@ import isEmojiUnicodeSupported, {
isSkinToneComboEmoji
,
isHorceRacingSkinToneComboEmoji
,
isPersonZwjEmoji
,
}
from
'
~/emoji/is_emoji_unicode_supported
'
;
}
from
'
~/emoji/
support/
is_emoji_unicode_supported
'
;
const
emptySupportMap
=
{
personZwj
:
false
,
...
...
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