Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
965a8ba2
Commit
965a8ba2
authored
13 years ago
by
Simon Birnbach
Browse files
Options
Downloads
Patches
Plain Diff
Fixed cancelling of uploads and wrong merge conflict resolution
parent
8e27b725
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
files/css/files.css
+3
-3
3 additions, 3 deletions
files/css/files.css
files/js/files.js
+33
-9
33 additions, 9 deletions
files/js/files.js
with
36 additions
and
12 deletions
files/css/files.css
+
3
−
3
View file @
965a8ba2
...
...
@@ -42,9 +42,9 @@ tbody tr { background-color:#fff; height:2.5em; }
tbody
tr
:hover
,
tbody
tr
:active
,
tbody
tr
.selected
{
background-color
:
#f8f8f8
;
}
tbody
tr
.selected
{
background-color
:
#eee
;
}
tbody
a
{
color
:
#000
;
}
span
.exten
t
ion
,
span
.uploading
,
td
.date
{
color
:
#999
;
}
span
.exten
t
ion
{
opacity
:
0
;
-webkit-transition
:
opacity
500ms
;
-moz-transition
:
opacity
500ms
;
-o-transition
:
opacity
500ms
;
transition
:
opacity
500ms
;
}
tr
:hover
span
.exten
t
ion
{
opacity
:
1
;
}
span
.exten
s
ion
,
span
.uploading
,
td
.date
{
color
:
#999
;
}
span
.exten
s
ion
{
text-transform
:
lowercase
;
opacity
:
0
;
-webkit-transition
:
opacity
500ms
;
-moz-transition
:
opacity
500ms
;
-o-transition
:
opacity
500ms
;
transition
:
opacity
500ms
;
}
tr
:hover
span
.exten
s
ion
{
opacity
:
1
;
}
div
.crumb
{
float
:
left
;
display
:
block
;
background
:
no-repeat
right
0
;
padding
:
.75em
1.5em
0
1em
;
height
:
2.9em
;
}
div
.crumb
:first-child
{
padding-left
:
1em
;
}
div
.crumb.last
{
font-weight
:
bold
;
}
...
...
This diff is collapsed.
Click to expand it.
files/js/files.js
+
33
−
9
View file @
965a8ba2
...
...
@@ -9,13 +9,20 @@ Files={
return
false
;
},
cancelUploads
:
function
()
{
$
.
each
(
uploadingFiles
,
function
(
index
,
file
){
file
.
abort
();
$
.
each
(
uploadingFiles
,
function
(
index
,
file
)
{
if
(
typeof
file
[
'
abort
'
]
===
'
function
'
)
{
file
.
abort
();
var
filename
=
$
(
'
tr
'
).
filterAttr
(
'
data-file
'
,
index
);
filename
.
hide
();
filename
.
find
(
'
input[type="checkbox"]
'
).
removeAttr
(
'
checked
'
);
filename
.
removeClass
(
'
selected
'
);
}
else
{
$
.
each
(
file
,
function
(
i
,
f
)
{
f
.
abort
();
delete
file
[
i
];
});
}
delete
uploadingFiles
[
index
];
var
filename
=
$
(
'
tr
'
).
filterAttr
(
'
data-file
'
,
index
);
filename
.
hide
();
filename
.
find
(
'
input[type="checkbox"]
'
).
removeAttr
(
'
checked
'
);
filename
.
removeClass
(
'
selected
'
);
});
procesSelection
();
}
...
...
@@ -206,8 +213,9 @@ $(document).ready(function() {
}
else
{
if
(
$
.
support
.
xhrFileUpload
)
{
for
(
var
i
=
0
;
i
<
files
.
length
;
i
++
){
var
fileName
=
files
[
i
].
name
var
dropTarget
=
$
(
e
.
originalEvent
.
target
).
closest
(
'
tr
'
);
if
(
dropTarget
&&
dropTarget
.
attr
(
'
data-type
'
)
===
'
dir
'
)
{
if
(
dropTarget
&&
dropTarget
.
attr
(
'
data-type
'
)
===
'
dir
'
)
{
// drag&drop upload to folder
var
dirName
=
dropTarget
.
attr
(
'
data-file
'
)
var
jqXHR
=
$
(
'
.file_upload_start
'
).
fileupload
(
'
send
'
,
{
files
:
files
[
i
],
formData
:
function
(
form
)
{
...
...
@@ -222,7 +230,7 @@ $(document).ready(function() {
$
(
'
#notification
'
).
fadeIn
();
}
var
file
=
response
[
0
];
delete
uploadingFiles
[
file
.
name
];
delete
uploadingFiles
[
dirName
][
file
.
name
];
var
currentUploads
=
parseInt
(
uploadtext
.
attr
(
'
currentUploads
'
));
currentUploads
-=
1
;
uploadtext
.
attr
(
'
currentUploads
'
,
currentUploads
);
...
...
@@ -238,12 +246,28 @@ $(document).ready(function() {
})
.
error
(
function
(
jqXHR
,
textStatus
,
errorThrown
)
{
if
(
errorThrown
===
'
abort
'
)
{
var
currentUploads
=
parseInt
(
uploadtext
.
attr
(
'
currentUploads
'
));
currentUploads
-=
1
;
uploadtext
.
attr
(
'
currentUploads
'
,
currentUploads
);
if
(
currentUploads
===
0
)
{
var
img
=
OC
.
imagePath
(
'
core
'
,
'
filetypes/folder.png
'
);
var
tr
=
$
(
'
tr
'
).
filterAttr
(
'
data-file
'
,
dirName
);
tr
.
find
(
'
td.filename
'
).
attr
(
'
style
'
,
'
background-image:url(
'
+
img
+
'
)
'
);
uploadtext
.
text
(
''
);
uploadtext
.
hide
();
}
else
{
uploadtext
.
text
(
currentUploads
+
'
files uploading
'
)
}
$
(
'
#notification
'
).
hide
();
$
(
'
#notification
'
).
text
(
t
(
'
files
'
,
'
Upload cancelled.
'
));
$
(
'
#notification
'
).
fadeIn
();
}
});
uploadingFiles
[
dirName
+
"
/
"
+
files
[
i
].
name
]
=
jqXHR
;
//TODO test with filenames containing slashes
if
(
uploadingFiles
[
dirName
]
===
undefined
)
{
uploadingFiles
[
dirName
]
=
{};
}
uploadingFiles
[
dirName
][
fileName
]
=
jqXHR
;
}
else
{
var
jqXHR
=
$
(
'
.file_upload_start
'
).
fileupload
(
'
send
'
,
{
files
:
files
[
i
]})
.
success
(
function
(
result
,
textStatus
,
jqXHR
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment