Mercurial > hg > orthanc
diff OrthancExplorer/file-upload.js @ 3102:9b18c8d4d459
'fix' for Orthanc issue #21: added a select file button + a warning specific for Firefox users
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Thu, 10 Jan 2019 10:10:26 +0100 |
parents | c9c2faf76bec |
children | 81b58b549845 |
line wrap: on
line diff
--- a/OrthancExplorer/file-upload.js Sat Dec 29 14:21:43 2018 +0100 +++ b/OrthancExplorer/file-upload.js Thu Jan 10 10:10:26 2019 +0100 @@ -27,11 +27,7 @@ $('#progress .label').text('Failure'); }) .bind('fileuploaddrop', function (e, data) { - let target = $('#upload-list'); - $.each(data.files, function (index, file) { - target.append('<li class="pending-file">' + file.name + '</li>'); - }); - target.listview('refresh'); + appendFilesToUploadList(data.files); }) .bind('fileuploadsend', function (e, data) { // Update the progress bar. Note: for some weird reason, the @@ -45,14 +41,28 @@ }); }); +function appendFilesToUploadList(files) { + let target = $('#upload-list'); + $.each(files, function (index, file) { + target.append('<li class="pending-file">' + file.name + '</li>'); + }); + target.listview('refresh'); +} +$('#fileupload').live('change', function (e) { + appendFilesToUploadList(e.target.files); +}) $('#upload').live('pageshow', function() { - alert('WARNING - This page is currently affected by Orthanc issue #21: ' + - '"DICOM files might be missing after uploading with Mozilla Firefox." ' + - 'Do not use this upload feature for clinical uses, or carefully ' + - 'check that all instances have been properly received by Orthanc. ' + - 'Please use the command-line "ImportDicomFiles.py" script to circumvent this issue.'); + if (navigator.userAgent.toLowerCase().indexOf('firefox') == -1) { + $("#issue-21-warning").css('display', 'none'); + } + + // alert('WARNING - This page is currently affected by Orthanc issue #21: ' + + // '"DICOM files might be missing after uploading with Mozilla Firefox." ' + + // 'Do not use this upload feature for clinical uses, or carefully ' + + // 'check that all instances have been properly received by Orthanc. ' + + // 'Please use the command-line "ImportDicomFiles.py" script to circumvent this issue.'); $('#fileupload').fileupload('enable'); });