mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
elofgren: ENHANCEMENT: Added support for canceling and starting upload.
(merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@42064 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
d445e1d462
commit
5c89bbcb58
@ -7,8 +7,8 @@ Upload.prototype = {
|
|||||||
this.uploadInProgress = false;
|
this.uploadInProgress = false;
|
||||||
this.uploadMessage = '';
|
this.uploadMessage = '';
|
||||||
if(typeof params.fileSizeLimit != 'undefined') this.setFileSizeLimit = params.fileSizeLimit; else this.fileSizeLimit = '30720';
|
if(typeof params.fileSizeLimit != 'undefined') this.setFileSizeLimit = params.fileSizeLimit; else this.fileSizeLimit = '30720';
|
||||||
if(typeof params.fileTypes != 'undefined') this.fileTypes = params.fileTypes; else params.fileTypes = '*.*';
|
if(typeof params.fileTypes != 'undefined') this.fileTypes = params.fileTypes; else this.fileTypes = '*.*';
|
||||||
if(typeof params.fileTypesDescription != 'underfined') this.fileTypesDescription = params.fileTypesDescription; else this.fileTypesDescription = 'All Files';
|
if(typeof params.fileTypesDescription != 'undefined') this.fileTypesDescription = params.fileTypesDescription; else this.fileTypesDescription = 'All Files';
|
||||||
if(typeof params.fileUploadLimit != 'undefined') this.fileUploadLimit = params.fileUploadLimit; else this.fileUploadLimit = '6';
|
if(typeof params.fileUploadLimit != 'undefined') this.fileUploadLimit = params.fileUploadLimit; else this.fileUploadLimit = '6';
|
||||||
if(typeof params.beginUploadOnQueue != 'undefined') this.beginUploadOnQueue = params.beginUploadOnQueue; else this.beginUploadOnQueue = false;
|
if(typeof params.beginUploadOnQueue != 'undefined') this.beginUploadOnQueue = params.beginUploadOnQueue; else this.beginUploadOnQueue = false;
|
||||||
if(typeof params.fileQueued != 'undefined') this.fileQueued = params.fileQueued;
|
if(typeof params.fileQueued != 'undefined') this.fileQueued = params.fileQueued;
|
||||||
@ -28,7 +28,7 @@ Upload.prototype = {
|
|||||||
file_post_name: 'Files',
|
file_post_name: 'Files',
|
||||||
file_size_limit : this.fileSizeLimit, // 30 MB
|
file_size_limit : this.fileSizeLimit, // 30 MB
|
||||||
file_types : this.fileTypes, // or you could use something like: '*.doc;*.wpd;*.pdf',
|
file_types : this.fileTypes, // or you could use something like: '*.doc;*.wpd;*.pdf',
|
||||||
file_types_description : this.fileTypeDescription,
|
file_types_description : this.fileTypesDescription,
|
||||||
file_upload_limit : this.fileUploadLimit,
|
file_upload_limit : this.fileUploadLimit,
|
||||||
begin_upload_on_queue : this.beginUploadOnQueue,
|
begin_upload_on_queue : this.beginUploadOnQueue,
|
||||||
use_server_data_event : true,
|
use_server_data_event : true,
|
||||||
@ -140,6 +140,15 @@ Upload.prototype = {
|
|||||||
this.swfu.browse();
|
this.swfu.browse();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
startUpload: function() {
|
||||||
|
this.swfu.startUpload();
|
||||||
|
},
|
||||||
|
|
||||||
|
cancelUpload: function(fileId) {
|
||||||
|
this.filesToUpload--;
|
||||||
|
this.swfu.cancelUpload(fileId);
|
||||||
|
},
|
||||||
|
|
||||||
setFolderID: function(id) {
|
setFolderID: function(id) {
|
||||||
this.folderID = id;
|
this.folderID = id;
|
||||||
},
|
},
|
||||||
@ -152,6 +161,10 @@ Upload.prototype = {
|
|||||||
return this.filesToUpload;
|
return this.filesToUpload;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getUploadMessage: function() {
|
||||||
|
return this.uploadMessage;
|
||||||
|
},
|
||||||
|
|
||||||
isUploadInProgress: function() {
|
isUploadInProgress: function() {
|
||||||
return this.uploadInProgress;
|
return this.uploadInProgress;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user