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
f48e8986
Commit
f48e8986
authored
Aug 12, 2016
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable slash commands on edit forms
parent
ccd44546
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
7 deletions
+13
-7
app/assets/javascripts/gfm_auto_complete.js.es6
app/assets/javascripts/gfm_auto_complete.js.es6
+2
-2
app/views/layouts/_init_auto_complete.html.haml
app/views/layouts/_init_auto_complete.html.haml
+2
-2
app/views/projects/_zen.html.haml
app/views/projects/_zen.html.haml
+2
-1
app/views/projects/notes/_form.html.haml
app/views/projects/notes/_form.html.haml
+5
-1
app/views/shared/issuable/_form.html.haml
app/views/shared/issuable/_form.html.haml
+2
-1
No files found.
app/assets/javascripts/gfm_auto_complete.js.es6
View file @
f48e8986
...
@@ -249,8 +249,8 @@
...
@@ -249,8 +249,8 @@
}
}
}
}
});
});
// We don't instantiate the slash commands autocomplete for note edit forms
// We don't instantiate the slash commands autocomplete for note
and issue/MR
edit forms
$("form:not(.edit-note) .js-gfm-input"
).atwho({
this.input.filter('[data-supports-slash-commands="true"]'
).atwho({
at: '/',
at: '/',
alias: 'commands',
alias: 'commands',
displayTpl: function(value) {
displayTpl: function(value) {
...
...
app/views/layouts/_init_auto_complete.html.haml
View file @
f48e8986
-
project
=
@target_project
||
@project
-
project
=
@target_project
||
@project
-
noteable_
class
=
@noteable
.
class
if
@noteable
.
present?
-
noteable_
type
=
@noteable
.
class
if
@noteable
.
present?
:javascript
:javascript
GitLab
.
GfmAutoComplete
.
dataSource
=
"
#{
autocomplete_sources_namespace_project_path
(
project
.
namespace
,
project
,
type:
noteable_
class
,
type_id:
params
[
:id
],
action_name:
action_name
)
}
"
GitLab
.
GfmAutoComplete
.
dataSource
=
"
#{
autocomplete_sources_namespace_project_path
(
project
.
namespace
,
project
,
type:
noteable_
type
,
type_id:
params
[
:id
]
)
}
"
GitLab
.
GfmAutoComplete
.
cachedData
=
undefined
;
GitLab
.
GfmAutoComplete
.
cachedData
=
undefined
;
GitLab
.
GfmAutoComplete
.
setup
();
GitLab
.
GfmAutoComplete
.
setup
();
app/views/projects/_zen.html.haml
View file @
f48e8986
-
supports_slash_commands
=
local_assigns
.
fetch
(
:supports_slash_commands
,
false
)
.zen-backdrop
.zen-backdrop
-
classes
<<
' js-gfm-input js-autosize markdown-area'
-
classes
<<
' js-gfm-input js-autosize markdown-area'
-
if
defined?
(
f
)
&&
f
-
if
defined?
(
f
)
&&
f
=
f
.
text_area
attr
,
class:
classes
,
placeholder:
placeholder
=
f
.
text_area
attr
,
class:
classes
,
placeholder:
placeholder
,
data:
{
supports_slash_commands:
supports_slash_commands
}
-
else
-
else
=
text_area_tag
attr
,
nil
,
class:
classes
,
placeholder:
placeholder
=
text_area_tag
attr
,
nil
,
class:
classes
,
placeholder:
placeholder
%a
.zen-control.zen-control-leave.js-zen-leave
{
href:
"#"
}
%a
.zen-control.zen-control-leave.js-zen-leave
{
href:
"#"
}
...
...
app/views/projects/notes/_form.html.haml
View file @
f48e8986
...
@@ -10,7 +10,11 @@
...
@@ -10,7 +10,11 @@
=
f
.
hidden_field
:position
=
f
.
hidden_field
:position
=
render
layout:
'projects/md_preview'
,
locals:
{
preview_class:
"md-preview"
,
referenced_users:
true
}
do
=
render
layout:
'projects/md_preview'
,
locals:
{
preview_class:
"md-preview"
,
referenced_users:
true
}
do
=
render
'projects/zen'
,
f:
f
,
attr: :note
,
classes:
'note-textarea js-note-text'
,
placeholder:
"Write a comment or drag your files here..."
=
render
'projects/zen'
,
f:
f
,
attr: :note
,
classes:
'note-textarea js-note-text'
,
placeholder:
"Write a comment or drag your files here..."
,
supports_slash_commands:
true
=
render
'projects/notes/hints'
=
render
'projects/notes/hints'
.error-alert
.error-alert
...
...
app/views/shared/issuable/_form.html.haml
View file @
f48e8986
...
@@ -30,7 +30,8 @@
...
@@ -30,7 +30,8 @@
=
render
layout:
'projects/md_preview'
,
locals:
{
preview_class:
"md-preview"
,
referenced_users:
true
}
do
=
render
layout:
'projects/md_preview'
,
locals:
{
preview_class:
"md-preview"
,
referenced_users:
true
}
do
=
render
'projects/zen'
,
f:
f
,
attr: :description
,
=
render
'projects/zen'
,
f:
f
,
attr: :description
,
classes:
'note-textarea'
,
classes:
'note-textarea'
,
placeholder:
"Write a comment or drag your files here..."
placeholder:
"Write a comment or drag your files here..."
,
supports_slash_commands:
!
issuable
.
persisted?
=
render
'projects/notes/hints'
=
render
'projects/notes/hints'
.clearfix
.clearfix
.error-alert
.error-alert
...
...
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