52 lines
1.0 KiB
JavaScript
52 lines
1.0 KiB
JavaScript
function init_upload_fields(id)
|
|
{
|
|
|
|
$('#note_file_upload_field_'+id).fileUploadUI({
|
|
uploadTable: $('#files_'+id),
|
|
namespace : "note_file_upload_"+id,
|
|
downloadTable: $('#files'+id),
|
|
dragDropSupport : true,
|
|
onLoad : function (event, files, index, xhr, handler){
|
|
|
|
var json;
|
|
if (typeof xhr.responseText !== "undefinied") {
|
|
eval(xhr.responseText);
|
|
|
|
} else {
|
|
|
|
eval(xhr.contents().text());
|
|
}
|
|
handler.uploadRow.remove();
|
|
|
|
|
|
},
|
|
onLoadAll: function (){
|
|
|
|
$('#data_files_'+id+' .new').each(function (){
|
|
|
|
$(this).removeClass("new");
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
buildUploadRow: function (files, index) {
|
|
|
|
return $('<tr><td>' + files[index].name + '<\/td>' +
|
|
'<td class="file_upload_progress"><div><\/div><\/td>' +
|
|
'<td class="file_upload_cancel">' +
|
|
'annuler' +
|
|
|
|
'<\/td><\/tr>');
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
$(document).ready(function ($) {
|
|
//init_upload_fields();
|
|
|
|
|
|
});
|