function initialize_uploads() { $('#data_file_upload_field').fileUploadUI({ uploadTable: $('#files'), namespace : "data_file_upload", downloadTable: $('#files'), 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 .new').each(function (){ $(this).removeClass("new"); }); update_multiple_selection_text(); }, buildUploadRow: function (files, index) { return $('' + files[index].name + '<\/td>' + '
<\/div><\/td>' + '' + 'Pen_alt_stroke_16x16' + '<\/td><\/tr>'); } }); $('#image_upload_field').fileUploadUI({ uploadTable: $('#files'), downloadTable: $('#files'), namespace : "image_file_upload", 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 (){ $('#image_files .new').each(function (){ $(this).removeClass("new"); }); update_multiple_selection_text(); }, buildUploadRow: function (files, index) { return $('' + files[index].name + '<\/td>' + '
<\/div><\/td>' + '' + 'Pen_alt_stroke_16x16' + '<\/td><\/tr>'); } }); }; $(document).ready(function ($) { initialize_uploads(); });