function renderUploaderFiler(index, the_file, selector, uploadRoute, extensions, chooseText, that) {
$(selector + ' input[name="files[]"]').filer({
showThumbs: true,
addMore: true,
allowDuplicates: false,
limit: 1,
maxSize: null,
changeInput: '
',
extensions: extensions,
uploadFile: {
url: laroute.route(uploadRoute),
data: {
action: 'upload',
extensions: extensions,
sub_folder: that.subFolder
},
type: 'POST',
enctype: 'multipart/form-data',
synchron: true,
beforeSend: function() {
that.activeJConfirmButtons(false);
$(selector + ' .contract-file-upload').hide();
},
success: function(data, itemEl, listEl, boxEl, newInputEl, inputEl, id) {
// console.log('upload');
// console.log(data);
// console.log(id);
// var index = getIndexOf(that.currentSelected, the_file.id);
// var parent = itemEl.find(".jFiler-jProgressBar").parent();
var new_file_name = JSON.parse(data);
var filerKit = inputEl.prop("jFiler");
filerKit.files_list[id].name = new_file_name;
itemEl.find(".jFiler-jProgressBar").fadeOut("slow");
that.createFile(itemEl, index, new_file_name);
},
error: function(el) {
el.find(".jFiler-jProgressBar").fadeOut("slow");
el.find('.jFiler-item-others').html('\
'+translate.getText.type+': '+strtoupper(new_file_name.extension)+'\
\
');
},
statusCode: null,
onProgress: null,
onComplete: function() {
that.activeJConfirmButtons(true);
}
},
files: null,
clipBoardPaste: true,
excludeName: null,
beforeRender: null,
afterRender: null,
beforeShow: null,
beforeSelect: null,
onSelect: null,
afterShow: null,
onRemove: function(itemEl, file, id, listEl, boxEl, newInputEl, inputEl) {
var index = getIndexOf(that.currentSelected, the_file.id);
that.currentSelected[index].pdfFile = {};
$(selector + ' .contract-file-upload').show();
},
onEmpty: null,
options: null,
dialogs: {
alert: function(text) {
$.dialog({ title: translate.getText.warning, content: text });
},
confirm: function (text, callback) {
$.confirm({
title: translate.getText.warning,
content: text,
buttons: {
confirm: {
text: translate.getText.confirm,
btnClass: 'btn-danger',
action: function() {
callback()
}
},
cancel: {
text: translate.getText.cancel
}
}
});
}
},
captions: {
button: translate.getText.choose_files,
feedback: "",
feedback2: translate.getText.selected_files,
removeConfirmation: translate.getText.are_you_sure_you_want_to_remove_this_file,
errors: {
filesLimit: translate.getText.file_number_authorized+": {{fi-limit}}",
filesType: translate.getText.file_extension_authorized+": .{{fi-extensions}}",
filesSize: translate.getText.file_max_size_authorized+": {{fi-maxSize}} MB."
}
}
});
}