Skip to content

Instantly share code, notes, and snippets.

@level09
Created January 10, 2016 21:44
Show Gist options
  • Save level09/2e3f6955df5d8c84440f to your computer and use it in GitHub Desktop.
Save level09/2e3f6955df5d8c84440f to your computer and use it in GitHub Desktop.
$('#process-btn').on('click', function (e) {
if ($(this).hasClass('disabled') || ($('.dz-complete').length != $('.dz-processing').length)) {
e.preventDefault();
}
else {
e.preventDefault();
//construct array from filenames
var videos = [];
$('#dz-video .dz-complete').each(function (i, d) {
videos.push($(d).data('filename'));
});
var audio = ''
$('#dz-audio .dz-complete').each(function (i, d) {
audio = $(d).data('filename');
});
$.ajax({
url: '/process',
method: 'POST',
contentType: 'application/json',
beforeSend: function () {
$.blockUI({message: $('#loader').show().clone().html() + '<h1> Just a moment...</h1>'})
},
data: JSON.stringify({videos: videos, audio: audio})
}).done(function (result) {
location.href = '/';
}).fail(function() {
alert('Error 3204: Error starting the process. ')
})
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment