# HG changeset patch # User Alain Mazy # Date 1547113896 -3600 # Node ID 81b58b54984523adfa380af29024b66951a3aa3d # Parent 9b18c8d4d45981d69c9eff8e8e4dbfb44762efe8 back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function diff -r 9b18c8d4d459 -r 81b58b549845 OrthancExplorer/explorer.js --- a/OrthancExplorer/explorer.js Thu Jan 10 10:10:26 2019 +0100 +++ b/OrthancExplorer/explorer.js Thu Jan 10 10:51:36 2019 +0100 @@ -27,10 +27,12 @@ function ChangePage(page, options) { - let first = true; + var first = true; + var value; + if (options) { - for (let key in options) { - let value = options[key]; + for (var key in options) { + value = options[key]; if (first) { page += '?'; first = false; @@ -63,7 +65,7 @@ $(document).ready(function() { - let $tree = $('#dicom-tree'); + var $tree = $('#dicom-tree'); $tree.tree({ autoEscape: false }); @@ -124,7 +126,7 @@ if (s == undefined) return "No date"; - let d = ParseDicomDate(s); + var d = ParseDicomDate(s); if (d == null) return '?'; else @@ -134,16 +136,16 @@ function Sort(arr, fieldExtractor, isInteger, reverse) { - let defaultValue; + var defaultValue; if (isInteger) defaultValue = 0; else defaultValue = ''; arr.sort(function(a, b) { - let ta = fieldExtractor(a); - let tb = fieldExtractor(b); - let order; + var ta = fieldExtractor(a); + var tb = fieldExtractor(b); + var order; if (ta == undefined) ta = defaultValue; @@ -226,11 +228,13 @@ function FormatMainDicomTags(target, tags, tagsToIgnore) { - for (let i in tags) + var v; + + for (var i in tags) { if (tagsToIgnore.indexOf(i) == -1) { - let v = tags[i]; + v = tags[i]; if (i == "PatientBirthDate" || i == "StudyDate" || @@ -254,7 +258,7 @@ function FormatPatient(patient, link, isReverse) { - let node = $('
').append($('

').text(patient.MainDicomTags.PatientName)); + var node = $('
').append($('

').text(patient.MainDicomTags.PatientName)); FormatMainDicomTags(node, patient.MainDicomTags, [ "PatientName" @@ -268,7 +272,8 @@ function FormatStudy(study, link, isReverse, includePatient) { - let label; + var label; + var node; if (includePatient) { label = study.Label; @@ -276,7 +281,7 @@ label = study.MainDicomTags.StudyDescription; } - let node = $('
').append($('

').text(label)); + node = $('
').append($('

').text(label)); if (includePatient) { FormatMainDicomTags(node, study.PatientMainDicomTags, [ @@ -296,7 +301,9 @@ function FormatSeries(series, link, isReverse) { - let c; + var c; + var node; + if (series.ExpectedNumberOfInstances == null || series.Instances.length == series.ExpectedNumberOfInstances) { @@ -307,7 +314,7 @@ c = series.Instances.length + '/' + series.ExpectedNumberOfInstances; } - let node = $('
') + node = $('
') .append($('

').text(series.MainDicomTags.SeriesDescription)) .append($('

').append($('') .text('Status: ') @@ -328,7 +335,7 @@ function FormatInstance(instance, link, isReverse) { - let node = $('

').append($('

').text('Instance: ' + instance.IndexInSeries)); + var node = $('
').append($('

').text('Instance: ' + instance.IndexInSeries)); FormatMainDicomTags(node, instance.MainDicomTags, [ "AcquisitionNumber", @@ -364,7 +371,7 @@ $('#lookup').live('pagebeforeshow', function() { // NB: "GenerateDicomDate()" is defined in "query-retrieve.js" - let target = $('#lookup-study-date'); + var target = $('#lookup-study-date'); $('option', target).remove(); target.append($('