3
var dropbox = $('#dropbox'),
4
message = $('.message', dropbox);
7
// The name of the $_FILES entry:
10
url: '../../../uploadfile/'+$('input[name="cid"]').val()+'/'+$('input[name="example"]').val()+'/'+$('input[name="page"]').val(),
12
uploadFinished:function(i,file,response){
13
$('.progress').addClass('done');
15
html += '<div class="file">';
16
html += "<strong>"+file.name+"</strong>";
17
html += '<input type="hidden" value="'+file.name+'">';
18
html += '<label>Language</label><input type="text" name="'+file.name.replace(/\s/g,"")+'_lang" onChange="fileupdated()">';
19
html += '<label>Type</label><input type="text" name="'+file.name.replace(/\s/g,"")+'_type" onChange="fileupdated()">';
21
$('#filelist').append(html);
25
error: function(err, file) {
27
case 'BrowserNotSupported':
28
showMessage('Your browser does not support HTML5 file uploads!');
35
// Called before each upload is started
36
beforeEach: function(file){
40
uploadStarted:function(i, file, len){
44
progressUpdated: function(i, file, progress) {
45
$('.progress').width(progress);
51
function showMessage(msg){
57
function fileupdated(){
59
$('.file').each(function() {
60
inputs = $(this).find("input");
61
fileinfo.push({"filename":inputs.get(0).value, "lang": inputs.get(1).value, "type": inputs.get(2).value});
63
$("input[name='files']").val(JSON.stringify(fileinfo));
b'\\ No newline at end of file'