$(function(){
$('#fileupload').fileupload({
fail: function(e, data) {
$.each(data.files, function(i,f) {
localStorage['failed_uploads'] =
(localStorage['failed_uploads']||'
') +
('"' + f.name + '" - ' + data.errorThrown + '
');
});
},
start: function() {
$('#progress_modal').modal({keyboard: false, backdrop: 'static'});
},
stop: function() {
var fuel = this;
window.setTimeout(function() {
$('#progress_modal').modal('hide');
if(typeof fileupload_callback === 'function')
fileupload_callback();
else window.location.reload(true);
}, 600);
},
progressall: function (e, data) {
var progress = parseInt(data.loaded / data.total * 100, 10);
$('#progress_bar .bar').css('width', progress + '%');
}
});
if(localStorage['failed_uploads']) {
ELFinder.sticky_warn(localStorage['failed_uploads']);
localStorage.removeItem('failed_uploads');
}
});