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
Jérome Perrin
gitlab-ce
Commits
2c2c1926
Commit
2c2c1926
authored
Oct 02, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix_selecting_them_upload' of gitlab.com:gitlab-org/gitlab-ce
parents
a950783a
dae670bd
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
21 additions
and
17 deletions
+21
-17
app/assets/javascripts/markdown_area.js.coffee
app/assets/javascripts/markdown_area.js.coffee
+11
-11
app/assets/javascripts/zen_mode.js.coffee
app/assets/javascripts/zen_mode.js.coffee
+4
-0
app/views/projects/issues/_form.html.haml
app/views/projects/issues/_form.html.haml
+1
-1
app/views/projects/merge_requests/_form.html.haml
app/views/projects/merge_requests/_form.html.haml
+1
-1
app/views/projects/merge_requests/_new_submit.html.haml
app/views/projects/merge_requests/_new_submit.html.haml
+1
-1
app/views/projects/milestones/_form.html.haml
app/views/projects/milestones/_form.html.haml
+1
-1
app/views/projects/notes/_form.html.haml
app/views/projects/notes/_form.html.haml
+1
-1
app/views/projects/wikis/_form.html.haml
app/views/projects/wikis/_form.html.haml
+1
-1
No files found.
app/assets/javascripts/markdown_area.js.coffee
View file @
2c2c1926
...
@@ -12,13 +12,13 @@ $(document).ready ->
...
@@ -12,13 +12,13 @@ $(document).ready ->
btnAlert
=
"<button type=
\"
button
\"
"
+
alertAttr
+
">×</button>"
btnAlert
=
"<button type=
\"
button
\"
"
+
alertAttr
+
">×</button>"
project_image_path_upload
=
window
.
project_image_path_upload
or
null
project_image_path_upload
=
window
.
project_image_path_upload
or
null
$
(
"textarea.markdown-area"
).
wrap
"<div class=
\"
div-dropzone
\"
></div>"
$
(
"textarea.markdown-area"
).
wrap
"<div class=
\"
div-dropzone
\"
></div>"
$
(
".div-dropzone"
).
parent
().
addClass
"div-dropzone-wrapper"
$
(
".div-dropzone"
).
parent
().
addClass
"div-dropzone-wrapper"
$
(
".div-dropzone"
).
append
divHover
$
(
".div-dropzone"
).
append
divHover
$
(
".div-dropzone-hover"
).
append
iconPicture
$
(
".div-dropzone-hover"
).
append
iconPicture
$
(
".div-dropzone"
).
append
divSpinner
$
(
".div-dropzone"
).
append
divSpinner
$
(
".div-dropzone-spinner"
).
append
iconSpinner
$
(
".div-dropzone-spinner"
).
append
iconSpinner
$
(
".div-dropzone-spinner"
).
css
$
(
".div-dropzone-spinner"
).
css
"opacity"
:
0
"opacity"
:
0
...
@@ -27,12 +27,12 @@ $(document).ready ->
...
@@ -27,12 +27,12 @@ $(document).ready ->
dropzone
=
$
(
".div-dropzone"
).
dropzone
(
dropzone
=
$
(
".div-dropzone"
).
dropzone
(
url
:
project_image_path_upload
url
:
project_image_path_upload
dictDefaultMessage
:
""
dictDefaultMessage
:
""
clickable
:
fals
e
clickable
:
tru
e
paramName
:
"markdown_img"
paramName
:
"markdown_img"
maxFilesize
:
10
maxFilesize
:
10
uploadMultiple
:
false
uploadMultiple
:
false
acceptedFiles
:
"image/jpg,image/jpeg,image/gif,image/png"
acceptedFiles
:
"image/jpg,image/jpeg,image/gif,image/png"
headers
:
headers
:
"X-CSRF-Token"
:
$
(
"meta[name=
\"
csrf-token
\"
]"
).
attr
(
"content"
)
"X-CSRF-Token"
:
$
(
"meta[name=
\"
csrf-token
\"
]"
).
attr
(
"content"
)
previewContainer
:
false
previewContainer
:
false
...
@@ -91,7 +91,7 @@ $(document).ready ->
...
@@ -91,7 +91,7 @@ $(document).ready ->
handlePaste
=
(
e
)
->
handlePaste
=
(
e
)
->
e
.
preventDefault
()
e
.
preventDefault
()
my_event
=
e
.
originalEvent
my_event
=
e
.
originalEvent
if
my_event
.
clipboardData
and
my_event
.
clipboardData
.
items
if
my_event
.
clipboardData
and
my_event
.
clipboardData
.
items
processItem
(
my_event
)
processItem
(
my_event
)
...
@@ -115,7 +115,7 @@ $(document).ready ->
...
@@ -115,7 +115,7 @@ $(document).ready ->
return
item
return
item
i
++
i
++
return
false
return
false
pasteText
=
(
text
)
->
pasteText
=
(
text
)
->
caretStart
=
$
(
child
)[
0
].
selectionStart
caretStart
=
$
(
child
)[
0
].
selectionStart
caretEnd
=
$
(
child
)[
0
].
selectionEnd
caretEnd
=
$
(
child
)[
0
].
selectionEnd
...
@@ -126,12 +126,12 @@ $(document).ready ->
...
@@ -126,12 +126,12 @@ $(document).ready ->
$
(
child
).
val
beforeSelection
+
text
+
afterSelection
$
(
child
).
val
beforeSelection
+
text
+
afterSelection
$
(
".markdown-area"
).
trigger
"input"
$
(
".markdown-area"
).
trigger
"input"
getFilename
=
(
e
)
->
getFilename
=
(
e
)
->
if
window
.
clipboardData
and
window
.
clipboardData
.
getData
if
window
.
clipboardData
and
window
.
clipboardData
.
getData
value
=
window
.
clipboardData
.
getData
(
"Text"
)
value
=
window
.
clipboardData
.
getData
(
"Text"
)
else
if
e
.
clipboardData
and
e
.
clipboardData
.
getData
else
if
e
.
clipboardData
and
e
.
clipboardData
.
getData
value
=
e
.
clipboardData
.
getData
(
"text/plain"
)
value
=
e
.
clipboardData
.
getData
(
"text/plain"
)
value
=
value
.
split
(
"
\r
"
)
value
=
value
.
split
(
"
\r
"
)
value
.
first
()
value
.
first
()
...
@@ -154,7 +154,7 @@ $(document).ready ->
...
@@ -154,7 +154,7 @@ $(document).ready ->
success
:
(
e
,
textStatus
,
response
)
->
success
:
(
e
,
textStatus
,
response
)
->
insertToTextArea
(
filename
,
formatLink
(
response
.
responseJSON
.
link
))
insertToTextArea
(
filename
,
formatLink
(
response
.
responseJSON
.
link
))
error
:
(
response
)
->
error
:
(
response
)
->
showError
(
response
.
responseJSON
.
message
)
showError
(
response
.
responseJSON
.
message
)
...
@@ -190,7 +190,7 @@ $(document).ready ->
...
@@ -190,7 +190,7 @@ $(document).ready ->
$
(
".markdown-selector"
).
click
(
e
)
->
$
(
".markdown-selector"
).
click
(
e
)
->
e
.
preventDefault
()
e
.
preventDefault
()
$
(
@
).
closest
(
".div-dropzone-wrapper"
).
find
(
".div-dropzone"
).
click
()
$
(
@
).
closest
(
'.gfm-form'
).
find
(
'.div-dropzone'
).
click
()
return
return
return
return
app/assets/javascripts/zen_mode.js.coffee
View file @
2c2c1926
...
@@ -32,6 +32,8 @@ class @ZenMode
...
@@ -32,6 +32,8 @@ class @ZenMode
@
active_zen_area
=
@
active_checkbox
.
parent
().
find
(
'textarea'
)
@
active_zen_area
=
@
active_checkbox
.
parent
().
find
(
'textarea'
)
@
active_zen_area
.
focus
()
@
active_zen_area
.
focus
()
window
.
location
.
hash
=
ZenMode
.
fullscreen_prefix
+
@
active_checkbox
.
prop
(
'id'
)
window
.
location
.
hash
=
ZenMode
.
fullscreen_prefix
+
@
active_checkbox
.
prop
(
'id'
)
# Disable dropzone in ZEN mode
Dropzone
.
forElement
(
'.div-dropzone'
).
disable
()
exitZenMode
:
=>
exitZenMode
:
=>
if
@
active_zen_area
isnt
null
if
@
active_zen_area
isnt
null
...
@@ -41,6 +43,8 @@ class @ZenMode
...
@@ -41,6 +43,8 @@ class @ZenMode
@
active_checkbox
=
null
@
active_checkbox
=
null
window
.
location
.
hash
=
''
window
.
location
.
hash
=
''
window
.
scrollTo
(
window
.
pageXOffset
,
@
scroll_position
)
window
.
scrollTo
(
window
.
pageXOffset
,
@
scroll_position
)
# Enable dropzone when leaving ZEN mode
Dropzone
.
forElement
(
'.div-dropzone'
).
enable
()
checkboxFromLocationHash
:
(
e
)
->
checkboxFromLocationHash
:
(
e
)
->
id
=
$
.
trim
(
window
.
location
.
hash
.
replace
(
'#'
+
ZenMode
.
fullscreen_prefix
,
''
))
id
=
$
.
trim
(
window
.
location
.
hash
.
replace
(
'#'
+
ZenMode
.
fullscreen_prefix
,
''
))
...
...
app/views/projects/issues/_form.html.haml
View file @
2c2c1926
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
.alert.alert-info
.alert.alert-info
=
"Please review the <strong>
#{
link_to
"guidelines for contribution"
,
contribution_guide_url
}
</strong> to this repository."
.
html_safe
=
"Please review the <strong>
#{
link_to
"guidelines for contribution"
,
contribution_guide_url
}
</strong> to this repository."
.
html_safe
=
form_for
[
@project
,
@issue
],
html:
{
class:
'form-horizontal issue-form'
}
do
|
f
|
=
form_for
[
@project
,
@issue
],
html:
{
class:
'form-horizontal issue-form
gfm-form
'
}
do
|
f
|
=
render
'projects/issuable_form'
,
f:
f
,
issuable:
@issue
=
render
'projects/issuable_form'
,
f:
f
,
issuable:
@issue
.form-group
.form-group
=
f
.
label
:label_ids
,
class:
'control-label'
do
=
f
.
label
:label_ids
,
class:
'control-label'
do
...
...
app/views/projects/merge_requests/_form.html.haml
View file @
2c2c1926
=
form_for
[
@project
,
@merge_request
],
html:
{
class:
"merge-request-form form-horizontal"
}
do
|
f
|
=
form_for
[
@project
,
@merge_request
],
html:
{
class:
'merge-request-form form-horizontal gfm-form'
}
do
|
f
|
.merge-request-form-info
.merge-request-form-info
=
render
'projects/issuable_form'
,
f:
f
,
issuable:
@merge_request
=
render
'projects/issuable_form'
,
f:
f
,
issuable:
@merge_request
.form-group
.form-group
...
...
app/views/projects/merge_requests/_new_submit.html.haml
View file @
2c2c1926
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
%span
.pull-right
%span
.pull-right
=
link_to
'Change branches'
,
new_project_merge_request_path
(
@project
)
=
link_to
'Change branches'
,
new_project_merge_request_path
(
@project
)
=
form_for
[
@project
,
@merge_request
],
html:
{
class:
"merge-request-form"
}
do
|
f
|
=
form_for
[
@project
,
@merge_request
],
html:
{
class:
"merge-request-form
gfm-form
"
}
do
|
f
|
.panel.panel-default
.panel.panel-default
.panel-body
.panel-body
...
...
app/views/projects/milestones/_form.html.haml
View file @
2c2c1926
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
%hr
%hr
=
form_for
[
@project
,
@milestone
],
html:
{
class:
"new_milestone form-horizontal"
}
do
|
f
|
=
form_for
[
@project
,
@milestone
],
html:
{
class:
"new_milestone form-horizontal
gfm-form
"
}
do
|
f
|
-
if
@milestone
.
errors
.
any?
-
if
@milestone
.
errors
.
any?
.alert.alert-danger
.alert.alert-danger
%ul
%ul
...
...
app/views/projects/notes/_form.html.haml
View file @
2c2c1926
=
form_for
[
@project
,
@note
],
remote:
true
,
html:
{
:'data-type'
=>
'json'
,
multipart:
true
,
id:
nil
,
class:
"new_note js-new-note-form common-note-form"
},
authenticity_token:
true
do
|
f
|
=
form_for
[
@project
,
@note
],
remote:
true
,
html:
{
:'data-type'
=>
'json'
,
multipart:
true
,
id:
nil
,
class:
"new_note js-new-note-form common-note-form
gfm-form
"
},
authenticity_token:
true
do
|
f
|
=
note_target_fields
=
note_target_fields
=
f
.
hidden_field
:commit_id
=
f
.
hidden_field
:commit_id
=
f
.
hidden_field
:line_code
=
f
.
hidden_field
:line_code
...
...
app/views/projects/wikis/_form.html.haml
View file @
2c2c1926
=
form_for
[
@project
,
@page
],
method:
@page
.
persisted?
?
:put
:
:post
,
html:
{
class:
'form-horizontal'
}
do
|
f
|
=
form_for
[
@project
,
@page
],
method:
@page
.
persisted?
?
:put
:
:post
,
html:
{
class:
'form-horizontal
gfm-form
'
}
do
|
f
|
-
if
@page
.
errors
.
any?
-
if
@page
.
errors
.
any?
#error_explanation
#error_explanation
.alert.alert-danger
.alert.alert-danger
...
...
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