Hi,
I'm using the uploadify plugin for uploading multiple files, it work pretty well but i'm stuck with jQuery UI Dialog.
In fact, I would like to queueing severals Dialog, one for each uploaded files.
Here my HTML :
- <div id="prompt" title="Ajouter une image">
- <form>
- <fieldset>
- <label for="name">Nom de l'image : </label>
- <input type="text" name="name" id="name" class="text ui-widget-content ui-corner-all" value="" /><br />
- <label for="description">Description de l'image : </label>
- <input type="text" name="description" id="description" value="" class="text ui-widget-content ui-corner-all" />
- <img id="image" src="" alt="" />
- </fieldset>
- </form>
- </div>
(It's in French).
And my JS :
- var imagesNames = [];
- var imagesDates = [];
- var images = [];
-
- $("#uploaderImages").uploadify({
- 'uploader' : getBaseURL()+'/public/scripts/uploadify.swf',
- 'script' : getBaseURL()+'/public/scripts/uploadGallery.php',
- 'queueID' : 'fileQueue',
- 'buttonText' : 'Parcourir',
- 'multi' : true,
- 'auto' : true,
- onComplete: function(event, queueId, fileObj, response, data) {
- imagesNames.push(fileObj.name);
- imagesDates.push(fileObj.name);
- images.push(getBaseURL()+'/public/pictures/'+fileObj.name);
- },
- onAllComplete: function(event, data) {
- uploadImages(data.filesUploaded);
- },
- });
-
- function uploadImages(nb)
- {
- for (var i = 0; i < nb ; i++){
- var image = images[i];
- var name = imagesNames[i];
- var date = imagesDates[i];
- var description;
- $('#image').attr({ 'src': image, 'alt': 'name' });
- $('#name').attr({ 'value': name });
- $('#prompt').dialog('open');
- };
- }
I would like to stop the for at the "$('#prompt').dialog('open');" and restart it when the prompt is close.
Any ideas ? Thanks :)