Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
8228841b
authored
Feb 25, 2013
by
Dányi Bence
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webui: allow multiple file upload
fixes #38
parent
8121804f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
3 deletions
+27
-3
one/static/script/store.js
+27
-3
No files found.
one/static/script/store.js
View file @
8228841b
...
@@ -394,14 +394,19 @@ var cloud = (function(cloud) {
...
@@ -394,14 +394,19 @@ var cloud = (function(cloud) {
var
start
=
new
Date
().
getTime
();
var
start
=
new
Date
().
getTime
();
xhr
.
open
(
'POST'
,
self
.
uploadURL
());
xhr
.
open
(
'POST'
,
self
.
uploadURL
());
xhr
.
onload
=
xhr
.
onerror
=
function
()
{
xhr
.
onload
=
xhr
.
onerror
=
function
()
{
self
.
uploadProgress
(
'0%'
);
self
.
uploadURL
(
'/'
);
if
(
next
)
{
console
.
log
(
'complete, next'
)
next
();
}
else
{
$
(
'.file-upload'
).
removeClass
(
'opened'
);
$
(
'.file-upload'
).
removeClass
(
'opened'
);
$
(
'.file-upload .details'
).
slideUp
(
700
);
$
(
'.file-upload .details'
).
slideUp
(
700
);
$
(
'#upload-zone'
).
show
();
$
(
'#upload-zone'
).
show
();
$
(
'#upload-progress-text'
).
hide
();
$
(
'#upload-progress-text'
).
hide
();
self
.
uploadProgress
(
'0%'
);
self
.
uploadURL
(
'/'
);
loadFolder
(
self
.
currentPath
());
loadFolder
(
self
.
currentPath
());
}
}
}
if
(
tests
.
progress
)
{
if
(
tests
.
progress
)
{
$
(
'#upload-zone'
).
hide
();
$
(
'#upload-zone'
).
hide
();
$
(
'#upload-progress-text'
).
show
();
$
(
'#upload-progress-text'
).
show
();
...
@@ -444,7 +449,26 @@ var cloud = (function(cloud) {
...
@@ -444,7 +449,26 @@ var cloud = (function(cloud) {
document
.
addEventListener
(
'drop'
,
function
(
e
)
{
document
.
addEventListener
(
'drop'
,
function
(
e
)
{
e
.
stopPropagation
();
e
.
stopPropagation
();
e
.
preventDefault
();
e
.
preventDefault
();
readfiles
(
e
.
dataTransfer
.
files
[
0
]);
var
len
=
e
.
dataTransfer
.
files
.
length
;
var
files
=
e
.
dataTransfer
.
files
;
console
.
log
(
files
);
console
.
log
(
e
.
dataTransfer
.
files
);
var
i
=
1
;
readfiles
(
e
.
dataTransfer
.
files
[
0
],
function
()
{
console
.
log
(
'next'
,
i
);
next
=
arguments
.
callee
;
return
function
()
{
console
.
log
(
'readnext'
,
i
,
len
);
if
(
i
>=
len
-
1
)
{
console
.
log
(
'end'
,
i
,
len
);
self
.
getUploadURL
();
readfiles
(
files
[
i
++
],
null
);
return
;
}
self
.
getUploadURL
();
readfiles
(
files
[
i
++
],
next
());
}
}());
return
false
;
return
false
;
});
});
document
.
addEventListener
(
'dragover'
,
function
(
e
)
{
document
.
addEventListener
(
'dragover'
,
function
(
e
)
{
...
...
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