comparison OrthancServer/OrthancExplorer/explorer.js @ 4860:3e9a76464e8a openssl-3.x

integration mainline->openssl-3.x
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 24 Dec 2021 16:52:51 +0100
parents 2e71a08eea15 b3d0a3a4d890
children 6eff25f70121
comparison
equal deleted inserted replaced
4832:2e71a08eea15 4860:3e9a76464e8a
687 { 687 {
688 $(buttonSelector).closest('li').hide(); 688 $(buttonSelector).closest('li').hide();
689 } 689 }
690 } 690 }
691 691
692 692 function SetupAttachments(accessSelector, liClass, resourceId, resourceType) {
693 GetResource('/' + resourceType + '/' + resourceId + '/attachments?full', function(attachments) {
694 target = $(accessSelector);
695 $('.' + liClass).remove();
696 for (var key in attachments) {
697 if (attachments[key] >= 1024) {
698 target.append('<li data-icon="gear" class="' + liClass + '"><a href="#" id="' + attachments[key] + '">Download ' + key + '</a></li>')
699 }
700 }
701 target.listview('refresh');
702 });
703
704 }
693 705
694 function RefreshPatient() 706 function RefreshPatient()
695 { 707 {
696 var pageData, target, v; 708 var pageData, target, v;
697 709
724 target.append(FormatStudy(studies[i], '#study?uuid=' + studies[i].ID)); 736 target.append(FormatStudy(studies[i], '#study?uuid=' + studies[i].ID));
725 } 737 }
726 738
727 SetupAnonymizedOrModifiedFrom('#patient-anonymized-from', patient, 'patient', ANONYMIZED_FROM); 739 SetupAnonymizedOrModifiedFrom('#patient-anonymized-from', patient, 'patient', ANONYMIZED_FROM);
728 SetupAnonymizedOrModifiedFrom('#patient-modified-from', patient, 'patient', MODIFIED_FROM); 740 SetupAnonymizedOrModifiedFrom('#patient-modified-from', patient, 'patient', MODIFIED_FROM);
741 SetupAttachments('#patient-access', 'patient-attachment', pageData.uuid, 'patients');
729 742
730 target.listview('refresh'); 743 target.listview('refresh');
731 744
732 // Check whether this patient is protected 745 // Check whether this patient is protected
733 $.ajax({ 746 $.ajax({
771 .append(FormatStudy(study)) 784 .append(FormatStudy(study))
772 .listview('refresh'); 785 .listview('refresh');
773 786
774 SetupAnonymizedOrModifiedFrom('#study-anonymized-from', study, 'study', ANONYMIZED_FROM); 787 SetupAnonymizedOrModifiedFrom('#study-anonymized-from', study, 'study', ANONYMIZED_FROM);
775 SetupAnonymizedOrModifiedFrom('#study-modified-from', study, 'study', MODIFIED_FROM); 788 SetupAnonymizedOrModifiedFrom('#study-modified-from', study, 'study', MODIFIED_FROM);
789 SetupAttachments('#study-access', 'study-attachment', pageData.uuid, 'studies');
776 790
777 target = $('#list-series'); 791 target = $('#list-series');
778 $('li', target).remove(); 792 $('li', target).remove();
779 for (var i = 0; i < series.length; i++) { 793 for (var i = 0; i < series.length; i++) {
780 if (i == 0 || 794 if (i == 0 ||
788 802
789 target.append(FormatSeries(series[i], '#series?uuid=' + series[i].ID)); 803 target.append(FormatSeries(series[i], '#series?uuid=' + series[i].ID));
790 } 804 }
791 target.listview('refresh'); 805 target.listview('refresh');
792 806
807
793 currentPage = 'study'; 808 currentPage = 'study';
794 currentUuid = pageData.uuid; 809 currentUuid = pageData.uuid;
795 }); 810 });
796 }); 811 });
797 }); 812 });
825 .append(FormatSeries(series)) 840 .append(FormatSeries(series))
826 .listview('refresh'); 841 .listview('refresh');
827 842
828 SetupAnonymizedOrModifiedFrom('#series-anonymized-from', series, 'series', ANONYMIZED_FROM); 843 SetupAnonymizedOrModifiedFrom('#series-anonymized-from', series, 'series', ANONYMIZED_FROM);
829 SetupAnonymizedOrModifiedFrom('#series-modified-from', series, 'series', MODIFIED_FROM); 844 SetupAnonymizedOrModifiedFrom('#series-modified-from', series, 'series', MODIFIED_FROM);
845 SetupAttachments('#series-access', 'series-attachment', pageData.uuid, 'series');
830 846
831 target = $('#list-instances'); 847 target = $('#list-instances');
832 $('li', target).remove(); 848 $('li', target).remove();
833 for (var i = 0; i < instances.length; i++) { 849 for (var i = 0; i < instances.length; i++) {
834 target.append(FormatInstance(instances[i], '#instance?uuid=' + instances[i].ID)); 850 target.append(FormatInstance(instances[i], '#instance?uuid=' + instances[i].ID));
963 } 979 }
964 }); 980 });
965 981
966 SetupAnonymizedOrModifiedFrom('#instance-anonymized-from', instance, 'instance', ANONYMIZED_FROM); 982 SetupAnonymizedOrModifiedFrom('#instance-anonymized-from', instance, 'instance', ANONYMIZED_FROM);
967 SetupAnonymizedOrModifiedFrom('#instance-modified-from', instance, 'instance', MODIFIED_FROM); 983 SetupAnonymizedOrModifiedFrom('#instance-modified-from', instance, 'instance', MODIFIED_FROM);
984
985 SetupAttachments('#instance-access', 'instance-attachment', pageData.uuid, 'instances');
968 986
969 currentPage = 'instance'; 987 currentPage = 'instance';
970 currentUuid = pageData.uuid; 988 currentUuid = pageData.uuid;
971 }); 989 });
972 }); 990 });
1333 $('#series-media').live('click', function(e) { 1351 $('#series-media').live('click', function(e) {
1334 e.preventDefault(); //stop the browser from following 1352 e.preventDefault(); //stop the browser from following
1335 window.location.href = '../series/' + $.mobile.pageData.uuid + '/media'; 1353 window.location.href = '../series/' + $.mobile.pageData.uuid + '/media';
1336 }); 1354 });
1337 1355
1338 1356 $('.patient-attachment').live('click', function(e) {
1357 e.preventDefault(); //stop the browser from following
1358 window.location.href = '../patients/' + $.mobile.pageData.uuid + '/attachments/' + e.target.id + '/data';
1359 });
1360
1361 $('.study-attachment').live('click', function(e) {
1362 e.preventDefault(); //stop the browser from following
1363 window.location.href = '../studies/' + $.mobile.pageData.uuid + '/attachments/' + e.target.id + '/data';
1364 });
1365
1366 $('.series-attachment').live('click', function(e) {
1367 e.preventDefault(); //stop the browser from following
1368 window.location.href = '../series/' + $.mobile.pageData.uuid + '/attachments/' + e.target.id + '/data';
1369 });
1370
1371 $('.instance-attachment').live('click', function(e) {
1372 e.preventDefault(); //stop the browser from following
1373 window.location.href = '../instances/' + $.mobile.pageData.uuid + '/attachments/' + e.target.id + '/data';
1374 });
1339 1375
1340 $('#protection').live('change', function(e) { 1376 $('#protection').live('change', function(e) {
1341 var isProtected = e.target.value == "on"; 1377 var isProtected = e.target.value == "on";
1342 $.ajax({ 1378 $.ajax({
1343 url: '../patients/' + $.mobile.pageData.uuid + '/protected', 1379 url: '../patients/' + $.mobile.pageData.uuid + '/protected',