# HG changeset patch # User Sebastien Jodogne # Date 1734693937 -3600 # Node ID 25630706f4ed22df1a849b81ae1b7d97838bf6e9 # Parent e722d8252522f3966a4059e045887430da2d89a7 clarifications in javascript diff -r e722d8252522 -r 25630706f4ed ViewerPlugin/OrthancExplorer.js --- a/ViewerPlugin/OrthancExplorer.js Fri Dec 20 12:13:01 2024 +0100 +++ b/ViewerPlugin/OrthancExplorer.js Fri Dec 20 12:25:37 2024 +0100 @@ -24,24 +24,22 @@ $('#series').live('pagebeforeshow', function() { var seriesId = $.mobile.pageData.uuid; - $('#mirador-button').remove(); - $('#openseadragon-button').remove(); - $('#wsi-button').remove(); + $('#wsi-series-button').remove(); + $('#wsi-series-mirador-button').remove(); + $('#wsi-series-openseadragon-button').remove(); + $('#wsi-series-iiif-button').remove(); - $('#series-iiif-button').remove(); - $('#series-access').listview("refresh"); + $('#series-access').listview('refresh'); // Test whether this is a whole-slide image by check the SOP Class // UID of one instance of the series GetResource('/series/' + seriesId, function(series) { GetResource('/instances/' + series['Instances'][0] + '/tags?simplify', function(instance) { - console.log(instance['SOPClassUID']); - if (instance['SOPClassUID'] == '1.2.840.10008.5.1.4.1.1.77.1.6') { // This is a whole-slide image, register the button var b = $('') - .attr('id', 'wsi-button') + .attr('id', 'wsi-series-button') .attr('data-role', 'button') .attr('href', '#') .attr('data-icon', 'search') @@ -56,9 +54,10 @@ } }); - if (${SERVE_OPEN_SEADRAGON}) { + if (${ENABLE_IIIF} && + ${SERVE_OPEN_SEADRAGON}) { var b = $('') - .attr('id', 'openseadragon-button') + .attr('id', 'wsi-series-openseadragon-button') .attr('data-role', 'button') .attr('href', '#') .attr('data-icon', 'search') @@ -82,11 +81,11 @@ .text('Copy link to IIIF manifest'); var li = $('
  • ') - .attr('id', 'series-iiif-button') + .attr('id', 'wsi-series-iiif-button') .attr('data-icon', 'gear') .append(b); - $('#series-access').append(li).listview("refresh"); + $('#series-access').append(li).listview('refresh'); b.click(function(e) { if ($.mobile.pageData) { @@ -98,9 +97,10 @@ }); } - if (${SERVE_MIRADOR}) { + if (${ENABLE_IIIF} && + ${SERVE_MIRADOR}) { var b = $('') - .attr('id', 'mirador-button') + .attr('id', 'wsi-series-mirador-button') .attr('data-role', 'button') .attr('href', '#') .attr('data-icon', 'search') @@ -124,7 +124,7 @@ var instanceId = $.mobile.pageData.uuid; $('#wsi-instance-button').remove(); - $('#openseadragon-instance-button').remove(); + $('#wsi-instance-openseadragon-button').remove(); var b = $('') .attr('id', 'wsi-instance-button') @@ -142,9 +142,10 @@ } }); - if (${SERVE_OPEN_SEADRAGON}) { + if (${ENABLE_IIIF} && + ${SERVE_OPEN_SEADRAGON}) { var b = $('') - .attr('id', 'openseadragon-instance-button') + .attr('id', 'wsi-instance-openseadragon-button') .attr('data-role', 'button') .attr('href', '#') .attr('data-icon', 'search')