# HG changeset patch
# User Sebastien Jodogne
# Date 1689002192 -7200
# Node ID 0040ce361d4cdeb992a14e703adabc0b84a03a4d
# Parent 30fb01ce97a380919fa1d897e7c625b9d4619ed8
serving openseadragon
diff -r 30fb01ce97a3 -r 0040ce361d4c ViewerPlugin/CMakeLists.txt
--- a/ViewerPlugin/CMakeLists.txt Mon Jul 10 16:23:46 2023 +0200
+++ b/ViewerPlugin/CMakeLists.txt Mon Jul 10 17:16:32 2023 +0200
@@ -170,10 +170,11 @@
EmbedResources(
${OPENLAYERS_RESOURCES}
- ORTHANC_EXPLORER ${CMAKE_SOURCE_DIR}/OrthancExplorer.js
- VIEWER_HTML ${CMAKE_SOURCE_DIR}/viewer.html
- VIEWER_JS ${CMAKE_SOURCE_DIR}/viewer.js
- MIRADOR_HTML ${CMAKE_SOURCE_DIR}/mirador.html
+ ORTHANC_EXPLORER ${CMAKE_SOURCE_DIR}/OrthancExplorer.js
+ VIEWER_HTML ${CMAKE_SOURCE_DIR}/viewer.html
+ VIEWER_JS ${CMAKE_SOURCE_DIR}/viewer.js
+ MIRADOR_HTML ${CMAKE_SOURCE_DIR}/mirador.html
+ OPEN_SEADRAGON_HTML ${CMAKE_SOURCE_DIR}/openseadragon.html
)
diff -r 30fb01ce97a3 -r 0040ce361d4c ViewerPlugin/OrthancExplorer.js
--- a/ViewerPlugin/OrthancExplorer.js Mon Jul 10 16:23:46 2023 +0200
+++ b/ViewerPlugin/OrthancExplorer.js Mon Jul 10 17:16:32 2023 +0200
@@ -24,6 +24,7 @@
var seriesId = $.mobile.pageData.uuid;
$('#mirador-button').remove();
+ $('#openseadragon-button').remove();
$('#wsi-button').remove();
$('#series-iiif-button').remove();
@@ -54,6 +55,23 @@
}
});
+ if (${SERVE_OPEN_SEADRAGON}) {
+ var b = $('')
+ .attr('id', 'openseadragon-button')
+ .attr('data-role', 'button')
+ .attr('href', '#')
+ .attr('data-icon', 'search')
+ .attr('data-theme', 'e')
+ .text('Test IIIF in OpenSeadragon')
+ .button();
+
+ b.insertAfter($('#series-info'));
+ b.click(function() {
+ if ($.mobile.pageData) {
+ window.open('../wsi/app/openseadragon.html?image=../iiif/tiles/' + seriesId + '/info.json');
+ }
+ });
+ }
}
if (${SERVE_IIIF}) {
@@ -86,7 +104,7 @@
.attr('href', '#')
.attr('data-icon', 'search')
.attr('data-theme', 'e')
- .text('Open IIIF in Mirador')
+ .text('Test IIIF in Mirador')
.button();
b.insertAfter($('#series-info'));
diff -r 30fb01ce97a3 -r 0040ce361d4c ViewerPlugin/Plugin.cpp
--- a/ViewerPlugin/Plugin.cpp Mon Jul 10 16:23:46 2023 +0200
+++ b/ViewerPlugin/Plugin.cpp Mon Jul 10 17:16:32 2023 +0200
@@ -221,6 +221,11 @@
resource = Orthanc::EmbeddedResources::MIRADOR_HTML;
mime = "text/html";
}
+ else if (f == "openseadragon.html")
+ {
+ resource = Orthanc::EmbeddedResources::OPEN_SEADRAGON_HTML;
+ mime = "text/html";
+ }
else
{
throw Orthanc::OrthancException(Orthanc::ErrorCode_UnknownResource);
@@ -289,6 +294,7 @@
OrthancPlugins::RegisterRestCallback("/wsi/tiles/([0-9a-f-]+)/([0-9-]+)/([0-9-]+)/([0-9-]+)", true);
bool serveMirador;
+ bool serveOpenSeadragon;
bool serveIIIF = true; // TODO => CONFIG
std::string iiifPublicUrl;
@@ -306,15 +312,22 @@
InitializeIIIF(iiifPublicUrl);
serveMirador = true; // TODO => CONFIG
+ serveOpenSeadragon = true; // TODO => CONFIG
if (serveMirador)
{
OrthancPlugins::RegisterRestCallback("/wsi/app/(mirador.html)", true);
}
+
+ if (serveOpenSeadragon)
+ {
+ OrthancPlugins::RegisterRestCallback("/wsi/app/(openseadragon.html)", true);
+ }
}
else
{
serveMirador = false;
+ serveOpenSeadragon = false;
}
{
@@ -326,6 +339,7 @@
std::map dictionary;
dictionary["SERVE_IIIF"] = (serveIIIF ? "true" : "false");
dictionary["SERVE_MIRADOR"] = (serveMirador ? "true" : "false");
+ dictionary["SERVE_OPEN_SEADRAGON"] = (serveOpenSeadragon ? "true" : "false");
dictionary["IIIF_PUBLIC_URL"] = iiifPublicUrl;
explorer = Orthanc::Toolbox::SubstituteVariables(explorer, dictionary);
diff -r 30fb01ce97a3 -r 0040ce361d4c ViewerPlugin/mirador.html
--- a/ViewerPlugin/mirador.html Mon Jul 10 16:23:46 2023 +0200
+++ b/ViewerPlugin/mirador.html Mon Jul 10 17:16:32 2023 +0200
@@ -20,7 +20,7 @@
}
var miradorInstance = Mirador.viewer({
id: 'mirador',
- windows: windows,
+ windows: windows
});
+
+
+
diff -r 30fb01ce97a3 -r 0040ce361d4c ViewerPlugin/openseadragon.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ViewerPlugin/openseadragon.html Mon Jul 10 17:16:32 2023 +0200
@@ -0,0 +1,24 @@
+
+