cosmetic changes
This commit is contained in:
parent
0bc7cfdd30
commit
8e40262ab1
1 changed files with 16 additions and 14 deletions
|
@ -27,7 +27,7 @@
|
|||
*/
|
||||
pandora.chunkupload = function(options) {
|
||||
var chunkSize = options.size || 1024 * 1024,
|
||||
chunkUrl,
|
||||
chunkURL,
|
||||
file = options.file,
|
||||
maxRetry = -1,
|
||||
retries = 0,
|
||||
|
@ -63,11 +63,11 @@ pandora.chunkupload = function(options) {
|
|||
if (response.maxRetry) {
|
||||
maxRetry = response.maxRetry;
|
||||
}
|
||||
chunkUrl = response.uploadUrl;
|
||||
chunkURL = response.uploadUrl;
|
||||
if (document.location.protocol == 'https:') {
|
||||
chunkUrl = chunkUrl.replace(/http:\/\//, 'https://');
|
||||
chunkURL = chunkURL.replace(/http:\/\//, 'https://');
|
||||
}
|
||||
if (chunkUrl) {
|
||||
if (chunkURL) {
|
||||
that.status = 'uploading';
|
||||
that.progress = 0.0;
|
||||
// start upload
|
||||
|
@ -119,7 +119,7 @@ pandora.chunkupload = function(options) {
|
|||
chunk = file.slice(chunkOffset, chunkOffset+chunkSize, file.type);
|
||||
} else {
|
||||
that.status = 'Sorry, your browser is currently not supported.';
|
||||
done()
|
||||
done();
|
||||
}
|
||||
|
||||
progress(parseFloat(chunkOffset)/bytesAvailable);
|
||||
|
@ -191,7 +191,7 @@ pandora.chunkupload = function(options) {
|
|||
formData.append('done', 1);
|
||||
}
|
||||
formData.append('chunk', chunk);
|
||||
request.open('POST', chunkUrl, true);
|
||||
request.open('POST', chunkURL, true);
|
||||
request.send(formData);
|
||||
}
|
||||
|
||||
|
@ -201,5 +201,7 @@ pandora.chunkupload = function(options) {
|
|||
request = null;
|
||||
}
|
||||
};
|
||||
|
||||
return that;
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue