Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

start and complete callbacks;

  • Loading branch information...
commit d3dc6175831141479824594a45a24bd183344596 1 parent 6bfb9af
@chrisrhoden chrisrhoden authored
View
11 flex_src/src/org/prx/uploader/MultipleFileS3Uploader.as
@@ -68,6 +68,8 @@ package org.prx.uploader {
public var s3onCancelCall:String;
public var s3onRemoveCall:String;
public var s3onClearCall:String;
+ public var s3onStartCall:String;
+ public var s3onCompleteCall:String;
public function MultipleFileS3Uploader(signatureUrl:String,
initialMessage:String,
@@ -109,6 +111,8 @@ package org.prx.uploader {
s3onCancelCall = "s3_swf.onCancel";
s3onClearCall = "s3_swf.onClear";
s3onRemoveCall = "s3_swf.onRemove";
+ s3onStartCall = "s3_swf.onStart";
+ s3onCompleteCall = "s3_swf.onComplete";
ExternalInterface.call(s3onInfoCall, initialMessage);
@@ -268,7 +272,6 @@ package org.prx.uploader {
// called after the file is opened before upload
private function s3OpenHandler(event:Event):void{
- ExternalInterface.call(s3onInfoCall, "");
trace(event);
trace('openHandler triggered');
_files;
@@ -310,10 +313,11 @@ package org.prx.uploader {
trace(event);
_files.removeItemAt(0);
if (_files.length > 0){
- _totalbytes = 0;
+ _totalbytes = 0;
uploadFiles(null);
} else {
setupCancelButton(false);
+ ExternalInterface.call(s3onCompleteCall);
_uploadProgressBar.label = "Uploads complete";
ExternalInterface.call(s3onInfoCall, "All uploads complete");
/* not sure these next 2 lines are necessary... */
@@ -357,6 +361,9 @@ package org.prx.uploader {
}
private function uploadFiles(event:Event):void{
+ if (event != null) {
+ ExternalInterface.call(s3onStartCall);
+ }
if (_files.length > 0){
ExternalInterface.call(s3onInfoCall, 'Initiating...');
_file = FileReference(_files.getItemAt(0));
View
BIN  generators/s3_swf_upload/templates/s3_upload.swf
Binary file not shown
View
8 lib/s3_swf_upload/view_helpers.rb
@@ -11,6 +11,8 @@ def s3_swf_upload_tag(options = {})
canceled = options[:canceled] || ''
info = options[:info] || ''
prefix = options[:prefix] || ''
+ uploadStart = options[:started] || ''
+ uploadComplete = options[:completed] || ''
upload = options[:upload] || 'Upload'
initial_message = options[:initial_message] || 'Select file to upload...'
max_file_size = options[:max_file_size] || '524288000'
@@ -59,6 +61,12 @@ def s3_swf_upload_tag(options = {})
},
onRemove: function(){
#{remove}
+ },
+ onStart: function(){
+ #{uploadStart}
+ },
+ onComplete: function(){
+ #{uploadComplete}
}
});
</script>
Please sign in to comment.
Something went wrong with that request. Please try again.