Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
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
021e8d35
authored
Feb 06, 2013
by
Dányi Bence
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
one: file upload is delayed, if the client has no valid upload url
parent
21300d42
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
2 deletions
+23
-2
one/static/cloud.js
+23
-2
No files found.
one/static/cloud.js
View file @
021e8d35
...
@@ -144,6 +144,25 @@ $(function() {
...
@@ -144,6 +144,25 @@ $(function() {
}
}
/**
/**
* Delay the function call for `f` until `g` evaluates true
* Default check interval is 1 sec
*/
function
delayUntil
(
f
,
g
,
timeout
){
var
timeout
=
timeout
|
1000
;
function
check
(){
var
o
=
arguments
;
if
(
!
g
()){
setTimeout
(
function
(){
check
.
apply
(
null
,
o
)},
timeout
);
return
;
}
f
.
apply
(
null
,
o
);
}
return
function
(){
check
.
apply
(
null
,
arguments
);
}
}
/**
* Loads the parent folder
* Loads the parent folder
*/
*/
self
.
jumpUp
=
function
()
{
self
.
jumpUp
=
function
()
{
...
@@ -353,7 +372,7 @@ $(function() {
...
@@ -353,7 +372,7 @@ $(function() {
/**
/**
* Uploads the specified file(s)
* Uploads the specified file(s)
*/
*/
function
readfiles
(
file
)
{
var
readfiles
=
delayUntil
(
function
(
file
)
{
//1 GB file limit
//1 GB file limit
if
(
file
.
size
>
1024
*
1024
*
1024
)
{
if
(
file
.
size
>
1024
*
1024
*
1024
)
{
$
(
'#upload-zone'
).
hide
();
$
(
'#upload-zone'
).
hide
();
...
@@ -416,7 +435,9 @@ $(function() {
...
@@ -416,7 +435,9 @@ $(function() {
}
}
xhr
.
send
(
formData
);
xhr
.
send
(
formData
);
}
}
}
},
function
()
{
return
self
.
uploadURL
()
!==
'/'
;
},
200
);
/**
/**
* Drag'n'drop listeners
* Drag'n'drop listeners
...
...
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