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
1e0c6439
Commit
1e0c6439
authored
May 18, 2017
by
Sam Rose
Committed by
Phil Hughes
May 18, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable reference prefixes in notes for Snippets
parent
0b52808f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
6 deletions
+18
-6
app/assets/javascripts/gl_form.js
app/assets/javascripts/gl_form.js
+10
-3
app/assets/javascripts/notes.js
app/assets/javascripts/notes.js
+3
-2
app/views/shared/notes/_notes_with_form.html.haml
app/views/shared/notes/_notes_with_form.html.haml
+1
-1
changelogs/unreleased/32086-atwho-is-still-enabled-for-personal-snippet-comments-form.yml
...o-is-still-enabled-for-personal-snippet-comments-form.yml
+4
-0
No files found.
app/assets/javascripts/gl_form.js
View file @
1e0c6439
...
@@ -7,9 +7,10 @@ import GfmAutoComplete from './gfm_auto_complete';
...
@@ -7,9 +7,10 @@ import GfmAutoComplete from './gfm_auto_complete';
window
.
gl
=
window
.
gl
||
{};
window
.
gl
=
window
.
gl
||
{};
function
GLForm
(
form
)
{
function
GLForm
(
form
,
enableGFM
=
false
)
{
this
.
form
=
form
;
this
.
form
=
form
;
this
.
textarea
=
this
.
form
.
find
(
'
textarea.js-gfm-input
'
);
this
.
textarea
=
this
.
form
.
find
(
'
textarea.js-gfm-input
'
);
this
.
enableGFM
=
enableGFM
;
// Before we start, we should clean up any previous data for this form
// Before we start, we should clean up any previous data for this form
this
.
destroy
();
this
.
destroy
();
// Setup the form
// Setup the form
...
@@ -32,8 +33,14 @@ GLForm.prototype.setupForm = function() {
...
@@ -32,8 +33,14 @@ GLForm.prototype.setupForm = function() {
this
.
form
.
addClass
(
'
gfm-form
'
);
this
.
form
.
addClass
(
'
gfm-form
'
);
// remove notify commit author checkbox for non-commit notes
// remove notify commit author checkbox for non-commit notes
gl
.
utils
.
disableButtonIfEmptyField
(
this
.
form
.
find
(
'
.js-note-text
'
),
this
.
form
.
find
(
'
.js-comment-button, .js-note-new-discussion
'
));
gl
.
utils
.
disableButtonIfEmptyField
(
this
.
form
.
find
(
'
.js-note-text
'
),
this
.
form
.
find
(
'
.js-comment-button, .js-note-new-discussion
'
));
new
GfmAutoComplete
(
gl
.
GfmAutoComplete
&&
gl
.
GfmAutoComplete
.
dataSources
).
setup
(
this
.
form
.
find
(
'
.js-gfm-input
'
),
{
new
GfmAutoComplete
(
gl
.
GfmAutoComplete
&&
gl
.
GfmAutoComplete
.
dataSources
).
setup
(
this
.
form
.
find
(
'
.js-gfm-input
'
));
emojis
:
true
,
members
:
this
.
enableGFM
,
issues
:
this
.
enableGFM
,
milestones
:
this
.
enableGFM
,
mergeRequests
:
this
.
enableGFM
,
labels
:
this
.
enableGFM
,
});
new
DropzoneInput
(
this
.
form
);
new
DropzoneInput
(
this
.
form
);
autosize
(
this
.
textarea
);
autosize
(
this
.
textarea
);
}
}
...
...
app/assets/javascripts/notes.js
View file @
1e0c6439
...
@@ -27,7 +27,7 @@ const normalizeNewlines = function(str) {
...
@@ -27,7 +27,7 @@ const normalizeNewlines = function(str) {
Notes
.
interval
=
null
;
Notes
.
interval
=
null
;
function
Notes
(
notes_url
,
note_ids
,
last_fetched_at
,
view
)
{
function
Notes
(
notes_url
,
note_ids
,
last_fetched_at
,
view
,
enableGFM
=
true
)
{
this
.
updateTargetButtons
=
this
.
updateTargetButtons
.
bind
(
this
);
this
.
updateTargetButtons
=
this
.
updateTargetButtons
.
bind
(
this
);
this
.
updateComment
=
this
.
updateComment
.
bind
(
this
);
this
.
updateComment
=
this
.
updateComment
.
bind
(
this
);
this
.
visibilityChange
=
this
.
visibilityChange
.
bind
(
this
);
this
.
visibilityChange
=
this
.
visibilityChange
.
bind
(
this
);
...
@@ -50,6 +50,7 @@ const normalizeNewlines = function(str) {
...
@@ -50,6 +50,7 @@ const normalizeNewlines = function(str) {
this
.
notes_url
=
notes_url
;
this
.
notes_url
=
notes_url
;
this
.
note_ids
=
note_ids
;
this
.
note_ids
=
note_ids
;
this
.
enableGFM
=
enableGFM
;
// Used to keep track of updated notes while people are editing things
// Used to keep track of updated notes while people are editing things
this
.
updatedNotesTrackingMap
=
{};
this
.
updatedNotesTrackingMap
=
{};
this
.
last_fetched_at
=
last_fetched_at
;
this
.
last_fetched_at
=
last_fetched_at
;
...
@@ -523,7 +524,7 @@ const normalizeNewlines = function(str) {
...
@@ -523,7 +524,7 @@ const normalizeNewlines = function(str) {
Notes
.
prototype
.
setupNoteForm
=
function
(
form
)
{
Notes
.
prototype
.
setupNoteForm
=
function
(
form
)
{
var
textarea
,
key
;
var
textarea
,
key
;
new
gl
.
GLForm
(
form
);
new
gl
.
GLForm
(
form
,
this
.
enableGFM
);
textarea
=
form
.
find
(
"
.js-note-text
"
);
textarea
=
form
.
find
(
"
.js-note-text
"
);
key
=
[
key
=
[
"
Note
"
,
"
Note
"
,
...
...
app/views/shared/notes/_notes_with_form.html.haml
View file @
1e0c6439
...
@@ -23,4 +23,4 @@
...
@@ -23,4 +23,4 @@
to post a comment
to post a comment
:javascript
:javascript
var
notes
=
new
Notes
(
"
#{
notes_url
}
"
,
#{
@notes
.
map
(
&
:id
).
to_json
}
,
#{
Time
.
now
.
to_i
}
,
"
#{
diff_view
}
"
)
var
notes
=
new
Notes
(
"
#{
notes_url
}
"
,
#{
@notes
.
map
(
&
:id
).
to_json
}
,
#{
Time
.
now
.
to_i
}
,
"
#{
diff_view
}
"
,
false
)
changelogs/unreleased/32086-atwho-is-still-enabled-for-personal-snippet-comments-form.yml
0 → 100644
View file @
1e0c6439
---
title
:
Disable reference prefixes in notes for Snippets
merge_request
:
11278
author
:
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