Skip to content

Commit

Permalink
translations, iiif viewer changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nczirjak-acdh committed Feb 21, 2025
1 parent d3ac77a commit 5c60308
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 55 deletions.
4 changes: 2 additions & 2 deletions js/arche_detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@ jQuery(function ($) {
$('#expertdt-container').fadeIn(200);
$(this).removeClass('basic');
$(this).addClass('expert');
$(this).text(Drupal.t('Basic-View'));
$(this).text(Drupal.t('Basic view'));
} else {
$('#expertdt-container').hide();
$('#meta-content-container').fadeIn(200);
$(this).removeClass('expert');
$(this).addClass('basic');
$(this).text(Drupal.t('Expert-View'));
$(this).text(Drupal.t('Expert view'));
}
});
/*
Expand Down
60 changes: 7 additions & 53 deletions templates/disseminations/metadata-iiif-viewer.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
<div class="col-lg-6 text-start" id="previous-child-url-iiif-btn"></div>
<div class="col-lg-6 text-end" id="next-child-url-iiif-btn"></div>
</div>
<!--
<button id="prevButton" class="btn btn-arche-blue">Previous</button>
<span id="currentPage-iiif"></span>
<button id="nextButton" class="btn btn-arche-blue">Next</button>-->

</div>
<br>
<div id="iiif_viewer" style="width:80%; height:750px;"></div>
Expand All @@ -20,10 +17,8 @@
jQuery(function ($) {
$('.card.metadata.titleimage').hide();
"use strict";
var currentPage = 0;
var totalPages = 0;
var canvases = [];
var imageUrl = "https://arche-iiifmanifest.acdh.oeaw.ac.at/?id={{ data.getRepoUrl() }}&mode=images";
var imageUrl = "https://arche-iiifmanifest.acdh.oeaw.ac.at/?id={{ data.getRepoUrl() }}&mode=image";
//var imageUrl = "https://arche-iiifmanifest.acdh.oeaw.ac.at/?id=https%3A%2F%2Farche-curation.acdh-dev.oeaw.ac.at%2Fapi%2F2352&mode=images";
var viewer = OpenSeadragon({
Expand All @@ -37,52 +32,11 @@
"tiles": [{
"scaleFactors": [1, 2, 4, 8, 16, 32],
"width": 1024
}]
}],
tileSources: [
imageUrl
]
});
$.getJSON(imageUrl, function (data) {
// Extract the tile source from the IIIF manifest
currentPage = data.index;
//totalPages = data.images.length;
totalPages = 1;
canvases = data.images;
loadPage(currentPage);
// Update page number display
updatePageNumber();
}).fail(function () {
console.log("Failed to load IIIF manifest");
});
// Update the page number display
function updatePageNumber() {
$('#currentPage-iiif').text((currentPage + 1) + ' / ' + totalPages);
}
// Load a specific page
function loadPage(pageIndex) {
var tileSource = canvases[pageIndex];
// Update OpenSeadragon with the new page
viewer.open(tileSource);
}
// Previous button click event
$('#prevButton').click(function () {
if (currentPage > 0) {
currentPage--;
loadPage(currentPage);
updatePageNumber();
}
});
// Next button click event
$('#nextButton').click(function () {
if (currentPage < totalPages - 1) {
currentPage++;
loadPage(currentPage);
updatePageNumber();
}
});
});
</script>
</div>
Expand Down
12 changes: 12 additions & 0 deletions translations/arche_core_gui-de.po
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,21 @@ msgstr "Ressourcenlink kopieren"
msgid "Switch to Expert-View"
msgstr "Zur Expertenansicht wechseln"

msgid "Expert view"
msgstr "Expertenansicht"

msgid "Switch to Expert view"
msgstr "Zur Expertenansicht wechseln"

msgid "Refine your search using filters"
msgstr "Suchergebnisse filtern"

msgid "Basic view"
msgstr "Basisansicht"

msgid "Switch to Basic view"
msgstr "Zur Basisansicht wechseln"

msgid "Switch to Basic-View"
msgstr "Zur Basisansicht wechseln"

Expand Down

0 comments on commit 5c60308

Please sign in to comment.