Mercurial > hg > orthanc
comparison OrthancExplorer/file-upload.js @ 3111:495ec3d3893d
fix
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 11 Jan 2019 10:59:49 +0100 |
parents | 7047222cfa96 |
children | fc9a4a2dad63 |
comparison
equal
deleted
inserted
replaced
3110:7047222cfa96 | 3111:495ec3d3893d |
---|---|
1 var pendingUploads = []; | 1 var pendingUploads = []; |
2 var currentUpload = 0; | 2 var currentUpload = 0; |
3 var totalUpload = 0; | 3 var totalUpload = 0; |
4 | 4 |
5 $(document).ready(function() { | 5 $(document).ready(function() { |
6 var progress; | |
7 | |
8 // Initialize the jQuery File Upload widget: | 6 // Initialize the jQuery File Upload widget: |
9 $('#fileupload').fileupload({ | 7 $('#fileupload').fileupload({ |
10 //dataType: 'json', | 8 //dataType: 'json', |
11 //maxChunkSize: 500, | 9 //maxChunkSize: 500, |
12 //sequentialUploads: true, | 10 //sequentialUploads: true, |
33 appendFilesToUploadList(data.files); | 31 appendFilesToUploadList(data.files); |
34 }) | 32 }) |
35 .bind('fileuploadsend', function (e, data) { | 33 .bind('fileuploadsend', function (e, data) { |
36 // Update the progress bar. Note: for some weird reason, the | 34 // Update the progress bar. Note: for some weird reason, the |
37 // "fileuploadprogressall" does not work under Firefox. | 35 // "fileuploadprogressall" does not work under Firefox. |
38 progress = parseInt(currentUpload / totalUploads * 100, 10); | 36 var progress = parseInt(currentUpload / totalUploads * 100, 10); |
39 currentUpload += 1; | 37 currentUpload += 1; |
40 $('#progress .label').text('Uploading: ' + progress + '%'); | 38 $('#progress .label').text('Uploading: ' + progress + '%'); |
41 $('#progress .bar') | 39 $('#progress .bar') |
42 .css('width', progress + '%') | 40 .css('width', progress + '%') |
43 .css('background-color', 'green'); | 41 .css('background-color', 'green'); |