comparison OrthancServer/OrthancExplorer/explorer.js @ 4461:22abc6851191

The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 20 Jan 2021 14:51:48 +0100
parents d9473bd5ed43
children 8262ffb393ff
comparison
equal deleted inserted replaced
4460:6831de40acd9 4461:22abc6851191
96 RefreshInstance(); 96 RefreshInstance();
97 } 97 }
98 98
99 99
100 $(document).ready(function() { 100 $(document).ready(function() {
101 var $tree = $('#dicom-tree'); 101 var trees = [ '#dicom-tree', '#dicom-metaheader' ];
102 $tree.tree({ 102
103 autoEscape: false 103 for (var i = 0; i < trees.length; i++) {
104 }); 104 $(trees[i]).tree({
105 105 autoEscape: false
106 $('#dicom-tree').bind( 106 });
107 'tree.click', 107
108 function(event) { 108 $(trees[i]).bind(
109 if (event.node.is_open) 109 'tree.click',
110 $tree.tree('closeNode', event.node, true); 110 function(event) {
111 else 111 if (event.node.is_open)
112 $tree.tree('openNode', event.node, true); 112 $(trees[i]).tree('closeNode', event.node, true);
113 } 113 else
114 ); 114 $(trees[i]).tree('openNode', event.node, true);
115 }
116 );
117 }
115 118
116 // Inject the template of the warning about insecure setup as the 119 // Inject the template of the warning about insecure setup as the
117 // first child of each page 120 // first child of each page
118 var insecure = $('#template-insecure').html(); 121 var insecure = $('#template-insecure').html();
119 $('[data-role="page"]>[data-role="content"]').prepend(insecure); 122 $('[data-role="page"]>[data-role="content"]').prepend(insecure);
898 .append(FormatInstance(instance)) 901 .append(FormatInstance(instance))
899 .listview('refresh'); 902 .listview('refresh');
900 903
901 GetResource('/instances/' + instance.ID + '/tags', function(s) { 904 GetResource('/instances/' + instance.ID + '/tags', function(s) {
902 $('#dicom-tree').tree('loadData', ConvertForTree(s)); 905 $('#dicom-tree').tree('loadData', ConvertForTree(s));
906 });
907
908 GetResource('/instances/' + instance.ID + '/header', function(s) {
909 $('#dicom-metaheader').tree('loadData', ConvertForTree(s));
910 });
911
912 $('#transfer-syntax').hide();
913 GetResource('/instances/' + instance.ID + '/metadata?expand', function(s) {
914 transferSyntax = s['TransferSyntax'];
915 if (transferSyntax !== undefined) {
916 $('#transfer-syntax').show();
917 $('#transfer-syntax-text').text(transferSyntax);
918 }
903 }); 919 });
904 920
905 SetupAnonymizedOrModifiedFrom('#instance-anonymized-from', instance, 'instance', 'AnonymizedFrom'); 921 SetupAnonymizedOrModifiedFrom('#instance-anonymized-from', instance, 'instance', 'AnonymizedFrom');
906 SetupAnonymizedOrModifiedFrom('#instance-modified-from', instance, 'instance', 'ModifiedFrom'); 922 SetupAnonymizedOrModifiedFrom('#instance-modified-from', instance, 'instance', 'ModifiedFrom');
907 923