Created
January 10, 2016 21:44
-
-
Save level09/2e3f6955df5d8c84440f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#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