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
17bab502
Commit
17bab502
authored
Aug 10, 2015
by
Nikita Verkhovin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add dropzone upload progress
parent
8ceb7c05
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
3 deletions
+19
-3
Gemfile.lock
Gemfile.lock
+2
-2
app/assets/javascripts/dropzone_input.js.coffee
app/assets/javascripts/dropzone_input.js.coffee
+8
-1
app/assets/stylesheets/generic/markdown_area.scss
app/assets/stylesheets/generic/markdown_area.scss
+9
-0
No files found.
Gemfile.lock
View file @
17bab502
...
@@ -154,7 +154,7 @@ GEM
...
@@ -154,7 +154,7 @@ GEM
doorkeeper (2.1.3)
doorkeeper (2.1.3)
railties (>= 3.2)
railties (>= 3.2)
dotenv (0.9.0)
dotenv (0.9.0)
dropzonejs-rails (0.
4.14
)
dropzonejs-rails (0.
7.1
)
rails (> 3.1)
rails (> 3.1)
email_spec (1.6.0)
email_spec (1.6.0)
launchy (~> 2.1)
launchy (~> 2.1)
...
@@ -373,7 +373,7 @@ GEM
...
@@ -373,7 +373,7 @@ GEM
mini_portile (0.6.2)
mini_portile (0.6.2)
minitest (5.3.5)
minitest (5.3.5)
mousetrap-rails (1.4.6)
mousetrap-rails (1.4.6)
multi_json (1.11.
1
)
multi_json (1.11.
2
)
multi_xml (0.5.5)
multi_xml (0.5.5)
multipart-post (1.2.0)
multipart-post (1.2.0)
mysql2 (0.3.16)
mysql2 (0.3.16)
...
...
app/assets/javascripts/dropzone_input.js.coffee
View file @
17bab502
...
@@ -8,6 +8,7 @@ class @DropzoneInput
...
@@ -8,6 +8,7 @@ class @DropzoneInput
divAlert
=
"<div class=
\"
"
+
alertClass
+
"
\"
></div>"
divAlert
=
"<div class=
\"
"
+
alertClass
+
"
\"
></div>"
iconPaperclip
=
"<i class=
\"
fa fa-paperclip div-dropzone-icon
\"
></i>"
iconPaperclip
=
"<i class=
\"
fa fa-paperclip div-dropzone-icon
\"
></i>"
iconSpinner
=
"<i class=
\"
fa fa-spinner fa-spin div-dropzone-icon
\"
></i>"
iconSpinner
=
"<i class=
\"
fa fa-spinner fa-spin div-dropzone-icon
\"
></i>"
uploadProgress
=
$
(
"<div class=
\"
div-dropzone-progress
\"
></div>"
)
btnAlert
=
"<button type=
\"
button
\"
"
+
alertAttr
+
">×</button>"
btnAlert
=
"<button type=
\"
button
\"
"
+
alertAttr
+
">×</button>"
project_uploads_path
=
window
.
project_uploads_path
or
null
project_uploads_path
=
window
.
project_uploads_path
or
null
markdown_preview_path
=
window
.
markdown_preview_path
or
null
markdown_preview_path
=
window
.
markdown_preview_path
or
null
...
@@ -28,6 +29,7 @@ class @DropzoneInput
...
@@ -28,6 +29,7 @@ class @DropzoneInput
form_dropzone
.
find
(
".div-dropzone-hover"
).
append
iconPaperclip
form_dropzone
.
find
(
".div-dropzone-hover"
).
append
iconPaperclip
form_dropzone
.
append
divSpinner
form_dropzone
.
append
divSpinner
form_dropzone
.
find
(
".div-dropzone-spinner"
).
append
iconSpinner
form_dropzone
.
find
(
".div-dropzone-spinner"
).
append
iconSpinner
form_dropzone
.
find
(
".div-dropzone-spinner"
).
append
uploadProgress
form_dropzone
.
find
(
".div-dropzone-spinner"
).
css
form_dropzone
.
find
(
".div-dropzone-spinner"
).
css
"opacity"
:
0
"opacity"
:
0
"display"
:
"none"
"display"
:
"none"
...
@@ -112,13 +114,18 @@ class @DropzoneInput
...
@@ -112,13 +114,18 @@ class @DropzoneInput
$
(
".div-dropzone-alert"
).
append
btnAlert
+
errorMessage
$
(
".div-dropzone-alert"
).
append
btnAlert
+
errorMessage
return
return
totaluploadprogress
:
(
totalUploadProgress
)
->
uploadProgress
.
text
Math
.
round
(
totalUploadProgress
)
+
"%"
return
sending
:
->
sending
:
->
form_dropzone
.
find
(
".div-dropzone-spinner"
).
css
form_dropzone
.
find
(
".div-dropzone-spinner"
).
css
"opacity"
:
0.7
"opacity"
:
0.7
"display"
:
"inherit"
"display"
:
"inherit"
return
return
complete
:
->
queuecomplete
:
->
uploadProgress
.
text
""
$
(
".dz-preview"
).
remove
()
$
(
".dz-preview"
).
remove
()
$
(
".markdown-area"
).
trigger
"input"
$
(
".markdown-area"
).
trigger
"input"
$
(
".div-dropzone-spinner"
).
css
$
(
".div-dropzone-spinner"
).
css
...
...
app/assets/stylesheets/generic/markdown_area.scss
View file @
17bab502
...
@@ -40,6 +40,15 @@
...
@@ -40,6 +40,15 @@
font-size
:
inherit
;
font-size
:
inherit
;
}
}
.div-dropzone-progress
{
position
:
absolute
;
top
:
7px
;
left
:
-40px
;
width
:
35px
;
font-size
:
13px
;
text-align
:
right
;
}
.dz-preview
{
.dz-preview
{
display
:
none
;
display
:
none
;
}
}
...
...
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