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
df1eb4fa
Commit
df1eb4fa
authored
Sep 13, 2018
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move GFM autocomplete setup, delete dispatcher
parent
38000164
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
3 deletions
+21
-3
app/assets/javascripts/behaviors/index.js
app/assets/javascripts/behaviors/index.js
+2
-0
app/assets/javascripts/behaviors/markdown/gfm_auto_complete.js
...ssets/javascripts/behaviors/markdown/gfm_auto_complete.js
+19
-0
app/assets/javascripts/main.js
app/assets/javascripts/main.js
+0
-3
No files found.
app/assets/javascripts/behaviors/index.js
View file @
df1eb4fa
import
'
./autosize
'
;
import
'
./bind_in_out
'
;
import
'
./markdown/render_gfm
'
;
import
initGFMInput
from
'
./markdown/gfm_auto_complete
'
;
import
initCopyAsGFM
from
'
./markdown/copy_as_gfm
'
;
import
initCopyToClipboard
from
'
./copy_to_clipboard
'
;
import
'
./details_behavior
'
;
...
...
@@ -12,6 +13,7 @@ import './toggler_behavior';
import
'
./preview_markdown
'
;
installGlEmojiElement
();
initGFMInput
();
initCopyAsGFM
();
initCopyToClipboard
();
initPageShortcuts
();
app/assets/javascripts/
dispatcher
.js
→
app/assets/javascripts/
behaviors/markdown/gfm_auto_complete
.js
View file @
df1eb4fa
/* eslint-disable consistent-return, no-new */
import
$
from
'
jquery
'
;
import
GfmAutoComplete
from
'
./gfm_auto_complete
'
;
import
{
convertPermissionToBoolean
}
from
'
./lib/utils/common_utils
'
;
import
{
convertPermissionToBoolean
}
from
'
~/lib/utils/common_utils
'
;
import
GfmAutoComplete
from
'
~/gfm_auto_complete
'
;
function
initGFMInput
()
{
export
default
function
initGFMInput
()
{
$
(
'
.js-gfm-input:not(.js-vue-textarea)
'
).
each
((
i
,
el
)
=>
{
const
gfm
=
new
GfmAutoComplete
(
gl
.
GfmAutoComplete
&&
gl
.
GfmAutoComplete
.
dataSources
,
);
const
enableGFM
=
convertPermissionToBoolean
(
el
.
dataset
.
supportsAutocomplete
,
);
const
gfm
=
new
GfmAutoComplete
(
gl
.
GfmAutoComplete
&&
gl
.
GfmAutoComplete
.
dataSources
);
const
enableGFM
=
convertPermissionToBoolean
(
el
.
dataset
.
supportsAutocomplete
);
gfm
.
setup
(
$
(
el
),
{
emojis
:
true
,
members
:
enableGFM
,
...
...
@@ -22,10 +17,3 @@ function initGFMInput() {
});
});
}
export
default
()
=>
{
const
page
=
$
(
'
body
'
).
attr
(
'
data-page
'
);
if
(
page
)
{
initGFMInput
();
}
};
app/assets/javascripts/main.js
View file @
df1eb4fa
...
...
@@ -26,7 +26,6 @@ import LazyLoader from './lazy_loader';
import
initLogoAnimation
from
'
./logo
'
;
import
'
./frequent_items
'
;
import
initBreadcrumbs
from
'
./breadcrumb
'
;
import
initDispatcher
from
'
./dispatcher
'
;
import
initUsagePingConsent
from
'
./usage_ping_consent
'
;
import
initPerformanceBar
from
'
./performance_bar
'
;
import
initSearchAutocomplete
from
'
./search_autocomplete
'
;
...
...
@@ -274,6 +273,4 @@ document.addEventListener('DOMContentLoaded', () => {
// initialize field errors
$
(
'
.gl-show-field-errors
'
).
each
((
i
,
form
)
=>
new
GlFieldErrors
(
form
));
initDispatcher
();
});
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