Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto submit once queue has finished processing #7

Open
KelsoField opened this issue Jan 18, 2014 · 3 comments
Open

auto submit once queue has finished processing #7

KelsoField opened this issue Jan 18, 2014 · 3 comments

Comments

@KelsoField
Copy link

Basically I am looking to auto submit the queue once finished image resizing.
I have tried many methods but always get the "The form can not be submitted yet because there are still files being resized. " message...
Any thoughts?

@tmaiaroto
Copy link
Owner

Have you tried listening for the "preview" event? Or perhaps the progress? Here's the default function handle for that: https://github.com/tmaiaroto/agile_uploader/blob/master/bin/agile-uploader-3.0.js#L174

All events are handled by this function:
https://github.com/tmaiaroto/agile_uploader/blob/master/bin/agile-uploader-3.0.js#L13

Set here in the configuration: https://github.com/tmaiaroto/agile_uploader/blob/master/bin/agile-uploader-3.0.js#L372

So if you set your own, and use the existing methods for everything else and for progress or preview, simply make your own. You can then at >= 100 for encoding progress or on preview, submit the form automatically.

Here's where the ActionScript is calling that event handler with the event names and any related data for progress and preview: https://github.com/tmaiaroto/agile_uploader/blob/master/src/Main.as#L429

You are also free to build your own JavaScript code or jQuery plugin (or modify the one I have in the repo) to work with the swf.

@KelsoField
Copy link
Author

Thanks for the reply, however.. I am using a heavily changed version of the original v3 script hosted at shift8.
I have added Exif parsing etc..
I have added previously a call to an external function to “submit” but this is executed in every loop when processing multiple images. This causes the script to hang.

//

        $.fn.agileUploaderCurrentEncodeProgress = function(file) {

                    //console.info(parseInt(file.percentEncoded));

                    if(opts.progressBar == 'percent') {                                          

                                $('#'+file.uid+'CurrentProgress').text(parseInt(file.percentEncoded)+'%');

                    } else {                                                

                                $('#'+file.uid+'CurrentProgress').css('width', parseInt(file.percentEncoded)+'%');

                                $('#agileUploaderProgressBar').css('width', parseInt(file.percentEncoded)+'%');

                    }



                    if(file.percentEncoded >= 100) {

                                $('#'+file.uid+'CurrentProgress').remove();



                                // add the file size



                                var sizeKb = ((file.finalSize / 1024) * 100) / 100;

                                $('#id-'+file.uid+' .agileUploaderFileSize').text('('+ sizeKb.toFixed(2) +'Kb)');



                                $('.agileUploaderFileName, .agileUploaderRemoveFile, .agileUploaderFileSize, .agileUploaderFilePreview').show();

                                // add remove all

                                $('#agileUploaderRemoveAll').html('<a href="#" onClick="document.getElementById(\'agileUploaderSWF\').removeAllFiles(); $(\'#agileUploaderFileList\').empty(); $(\'#agileUploaderRemoveAll\').empty(); return false;">'+opts.removeAllText+'</a>');

                    }



        fsub() //call to external script//

        }

//EXTERNAL SCRIPT//

function fsub(){

document.getElementById('agileUploaderSWF').submit();

}

///////////////////////////////////

How can I get this ti execute ONLY when the list has been processed ready to upload?

Your thoughts appreciated

Keith

From: Tom Maiaroto [mailto:notifications@github.com]
Sent: 18 January 2014 17:08
To: tmaiaroto/agile_uploader
Cc: KelsoField
Subject: Re: [agile_uploader] auto submit once queue has finished processing (#7)

Have you tried listening for the "preview" event? Or perhaps the progress? Here's the default function handle for that: https://github.com/tmaiaroto/agile_uploader/blob/master/bin/agile-uploader-3.0.js#L174

All events are handled by this function:
https://github.com/tmaiaroto/agile_uploader/blob/master/bin/agile-uploader-3.0.js#L13

Set here in the configuration: https://github.com/tmaiaroto/agile_uploader/blob/master/bin/agile-uploader-3.0.js#L372

So if you set your own, and use the existing methods for everything else and for progress or preview, simply make your own. You can then at >= 100 for encoding progress or on preview, submit the form automatically.

Here's where the ActionScript is calling that event handler with the event names and any related data for progress and preview: https://github.com/tmaiaroto/agile_uploader/blob/master/src/Main.as#L429

You are also free to build your own JavaScript code or jQuery plugin (or modify the one I have in the repo) to work with the swf.


Reply to this email directly or view it on GitHub #7 (comment) . https://github.com/notifications/beacon/6090513__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcwNTU5NzY2MCwiZGF0YSI6eyJpZCI6MjM3OTgzNzF9fQ==--5802b6055c7c69bbe286ff63185f36bfab397f2d.gif

@tmaiaroto
Copy link
Owner

Oh, you want to submit multiple files? Each time one is encoded? That's likely going to require some changes to the ActionScript. The uploader was built around a single submit process (after everything was all done - for a single or multiple files) triggered by a human. While we can look at the events and automatically try to submit...When we're dealing with multiple files I don't think there's anything telling it that there's other files still processing or being attached. I assumed you were just trying to auto submit a singe file.

You'll likely need to continue with more heavy changes here, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants