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
Boxiang Sun
gitlab-ce
Commits
2874bab4
Commit
2874bab4
authored
Jun 27, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dynamically import emoji helpers for GfmAutoComplete class
parent
f26d4778
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
app/assets/javascripts/gfm_auto_complete.js
app/assets/javascripts/gfm_auto_complete.js
+12
-6
No files found.
app/assets/javascripts/gfm_auto_complete.js
View file @
2874bab4
import
{
validEmojiNames
,
glEmojiTag
}
from
'
./emoji
'
;
import
glRegexp
from
'
./lib/utils/regexp
'
;
import
glRegexp
from
'
./lib/utils/regexp
'
;
import
AjaxCache
from
'
./lib/utils/ajax_cache
'
;
import
AjaxCache
from
'
./lib/utils/ajax_cache
'
;
...
@@ -373,7 +372,12 @@ class GfmAutoComplete {
...
@@ -373,7 +372,12 @@ class GfmAutoComplete {
if
(
this
.
cachedData
[
at
])
{
if
(
this
.
cachedData
[
at
])
{
this
.
loadData
(
$input
,
at
,
this
.
cachedData
[
at
]);
this
.
loadData
(
$input
,
at
,
this
.
cachedData
[
at
]);
}
else
if
(
GfmAutoComplete
.
atTypeMap
[
at
]
===
'
emojis
'
)
{
}
else
if
(
GfmAutoComplete
.
atTypeMap
[
at
]
===
'
emojis
'
)
{
this
.
loadData
(
$input
,
at
,
validEmojiNames
);
import
(
/* webpackChunkName: 'emoji' */
'
./emoji
'
)
.
then
(({
validEmojiNames
,
glEmojiTag
})
=>
{
this
.
loadData
(
$input
,
at
,
validEmojiNames
);
GfmAutoComplete
.
glEmojiTag
=
glEmojiTag
;
})
.
catch
(()
=>
{
this
.
isLoadingData
[
at
]
=
false
;
});
}
else
{
}
else
{
AjaxCache
.
retrieve
(
this
.
dataSources
[
GfmAutoComplete
.
atTypeMap
[
at
]],
true
)
AjaxCache
.
retrieve
(
this
.
dataSources
[
GfmAutoComplete
.
atTypeMap
[
at
]],
true
)
.
then
((
data
)
=>
{
.
then
((
data
)
=>
{
...
@@ -421,12 +425,14 @@ GfmAutoComplete.atTypeMap = {
...
@@ -421,12 +425,14 @@ GfmAutoComplete.atTypeMap = {
};
};
// Emoji
// Emoji
GfmAutoComplete
.
glEmojiTag
=
null
;
GfmAutoComplete
.
Emoji
=
{
GfmAutoComplete
.
Emoji
=
{
templateFunction
(
name
)
{
templateFunction
(
name
)
{
return
`<li>
// glEmojiTag helper is loaded on-demand in fetchData()
${
name
}
${
glEmojiTag
(
name
)}
if
(
GfmAutoComplete
.
glEmojiTag
)
{
</li>
return
`<li>
${
name
}
${
GfmAutoComplete
.
glEmojiTag
(
name
)}
</li>`
;
`
;
}
return
`<li>
${
name
}
</li>`
;
},
},
};
};
// Team Members
// Team Members
...
...
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