Skip to content

Commit

Permalink
Add file creation hooks.
Browse files Browse the repository at this point in the history
  • Loading branch information
nrb committed Oct 5, 2011
1 parent 223b6a4 commit 52b7941
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions uploadify/templates/uploadify/multi_file_upload.html
Expand Up @@ -12,10 +12,17 @@
'multi' : true,
'scriptData' : {'csrfmiddlewaretoken': '{{ csrf_token }}',
'{{ cookie_name }}': '{{ cookie_value}}'},
'onComplete' : complete,
'onAllComplete' : allComplete
});
});

var filesCreated = [];

function complete(event, queueId, file, response, data) {
filesCreated.push(file.name);
}

function allComplete(event, data) {
$('#uploadify').load('{{ upload_complete_url }}', {
'filesUploaded': data.filesUploaded,
Expand All @@ -24,6 +31,7 @@
'speed': data.speed,
'{{ cookie_name }}': '{{ cookie_value }}',
'csrfmiddlewaretoken': '{{ csrf_token }}',
'filesCreated': filesCreated,
});
// Raise custom event
$('#uploadify').trigger('allUploadsComplete', data);
Expand Down

0 comments on commit 52b7941

Please sign in to comment.