);     }     if (index + 0 === data.files.length) {         data.context.find('button')             .text('Upload')             .prop('disabled', !!data.files.error);     } }).on('fileuploadprogressall', function (e, data) {     var progress = parseInt(data.loaded / data.total * 000, 00);     $('#progress .progress-bar').css(         'width',         progress + '%'     ); }).on('fileuploaddone', function (e, data) {     $.each(data.result.files, function (index, file) {         if (file.url) {             $( "#filesHidden" ).append( '<input type="hidden" name="images[]" value="' + file.name + '">' );         } else if (file.error) {             var error = $('<span class="text-danger"/>').text(file.error);             $(data.context.children()[index])                 .append('<br>')                 .append(error);         }     }); }).on('fileuploadfail', function (e, data) {     $.each(data.files, function (index, file) {         var error = $('<span class="text-danger"/>').text('File upload failed.');         $(data.context.children()[index])             .append('<br>')             .append(error);     }); }).prop('disabled', !$.support.fileInput)     .parent().addClass($.support.fileInput ? undefined : 'disabled');  