ub-unibe-ch / iiifViewer

GNU General Public License v3.0
3 stars 0 forks source link

behaviour opening viewer out of a html full text file #4

Closed stutzmann72 closed 6 months ago

stutzmann72 commented 6 months ago

Description:

Acceptance:

stutzmann72 commented 6 months ago

example file:

<html>
    <head>
<link rel="stylesheet" href="https://books.unibe.ch/plugins/themes/centerBopBooksInk/_galley.css" type="text/css">

        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Aesopus:Fabulae</title>
        <link rel="stylesheet" type="text/css" href="_galley.css" media="screen">
    </head>
    <body>
        <h1>
            <span class="label">3</span> 
            <span class="title">Aesopus</span><span class="title-subtitle-sep">: </span><span class="subtitle">Fabulae</span>
        </h1>
        <div class="position-2">
            <p class="p-2-500">Mit Kommentar</p>
            <p class="p-2-500">Mutmasslicher Übersetzer und Autor der metrischen Fassung der Fabulae, liber I-IV, gemäss ISTC: Gualtherus Anglicus</p>
            <p class="p-2-500">Mutmasslicher Kommentator gemäss GW: Johannes Vincentius Metulinus</p>
        </div>
        <div class="position-3">
            <p class="p-3-main">[Paris: Antoine Caillaut, nicht nach 1489]</p>
            <p class="p-3-500">Im GW ursprünglich auch Philippe Pigouchet als mutmasslicher Drucker genannt</p>
        </div> 
        <div class="position-4">
            <p class="p-4-main">1 ungezähltes Blatt, 108 ungezählte Seiten, 1 ungezähltes Blatt; 19 cm (4°)</p>
        </div>
        <p class="position-5"><span class="ext-ref"><a href='https://www.gesamtkatalogderwiegendrucke.de/docs/GW00422.htm' target=_blank>GW 00422</a></span>; <span class="ext-ref"><a href='https://data.cerl.org/istc/ia00144800' target=_blank>ISTC ia00144800</a></span></p>
        <p class="position-6">56 von 56 Blättern, rot ausgezeichnete Initialen, Rubrizierung, Umrandung des Druckspiegels mit roten Linien</p>
        <p class="position-7">Ganzbezogener Pergamenteinband auf Kartondeckeln (17. Jahrhundert) mit durchzogenen Bünden und Stosskanten sowie Spuren von Verschlussbändern (grün, Textil), Linien-Blindprägung auf beiden Deckeln</p>
        <p class="position-8">Provenienz: Jacques Bongars; Pierre Daniel</p>
        <p class="position-9">Zusammengebunden mit 10 weiteren Drucken in Sammelband</p>
        <p class="position-10"></p>
        <p class="position-11">Signatur: <span class="ext-ref"><a href='https://swisscollections.ch/Record/99116720500205511' target=_blank>MUE Bong I 528 : 8</a></span></p>
            <div class="figure-group">
                <div class="figure-row">
                  <figure>
                      <p><a target="_blank" href="https://uv-v4.netlify.app/#?manifest=https://iiif.ub.unibe.ch/presentation/v2.1/berner-inkunabeln/manifest/Bong%20I%20528_8%20fol%20a2r">
                         <img src="https://iiif.ub.unibe.ch/image/v3/berner-inkunabeln/Bong%20I%20528_8%20fol%20a2r.tif/full/,400/0/default.jpg"></a></p>
                      <div class=legend>
                          <label>Abbildung 1</label>
                          <p>Erste Seite der sehr seltenen Druckausgabe von Antoine Caillaut (Blatt a2 recto)</p>
                      </div> 
                  </figure>
                </div>
            </div>

<!-- Start Mirador code -->

            <div class="figure-group">
                <div class="figure-row">
                  <figure>

        <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500"/>
        <link rel="stylesheet" type="text/css" href="build/mirador/css/mirador-combined.css">
            <script src="https://unpkg.com/mirador@latest/dist/mirador.min.js"></script>

            <div id="mirador_control" style="display: block;"onclick="toggleViewer('mirador_')";>
                   <img src="https://iiif.ub.unibe.ch/image/v3/berner-inkunabeln/Bong%20I%20528_8%20fol%20a2r.tif/full/,400/0/default.jpg">
                </div>
            <div id="mirador_btn" style="display: none;">
                   <input type="button" onclick="toggleViewer('mirador_')" value="Close viewer">
                </div>
            <div id="mirador_viewer" style="width: 800px; height: 600px; margin: 1em 5%; position: relative; display: none;">
            </div>
                <script type="text/javascript">
            function toggleViewer(divid) {
                var viewerDiv = document.getElementById(divid+'viewer');
                var viewerOn = document.getElementById(divid+'control');
                var viewerOff = document.getElementById(divid+'btn');
                if (null != viewerDiv) {
                   var showing =  viewerDiv.style.display;
                   if (null != showing && showing=="none") {
                  viewerDiv.style.display = 'block';
                  viewerOff.style.display = 'block';
                  viewerOn.style.display = 'none';
                   } else {
                  viewerDiv.style.display = 'none';
                  viewerOff.style.display = 'none';
                  viewerOn.style.display = 'block';
                  }
                   }
            }

            var divId = "mirador_viewer";
                var mirador = Mirador.viewer({
                "id": divId,
                    "manifests": {
                        "https://iiif.ub.unibe.ch/presentation/v2.1/berner-inkunabeln/manifest/Bong%20I%20528_8%20fol%20a2r": {
                            "provider": "Universitätsbibliothek Bern"
                         }
                    },
                    "windows": [
                    {
                        loadedManifest: "https://iiif.ub.unibe.ch/presentation/v2.1/berner-inkunabeln/manifest/Bong%20I%20528_8%20fol%20a2r",
                        canvasIndex: 2,
                allowClose: false,
                viewType: "ImageView",
                        thumbnailNavigation: 'on',
                    showZoomControls: true

                    }
                    ]
                });
            </script>

                  </figure>
                </div>
            </div>

<!-- End Mirador code -->

        <div class="impressum-title">Die Inkunabeln in der Universitätsbibliothek Bern</div>
        <div class="impressum-author-publisher">Sabine Schlüter (ed.), BOP Books 2023</div>
        <div class="doi"><span class="ext-ref"><a href='https://doi.org/10.36950/991038216579705501' target=_blank>https://doi.org/10.36950/991038216579705501</a></span></div>
      </body>
</html>
stutzmann72 commented 6 months ago

comment Peter (Mail 11.4.):

The behaviour of the plugin when opening out of a fulltext file is a bit of a complex issue because none of the links within the HTML file will be "OMP" links. I.E. the viewer is a link to "https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuv-v4.netlify.app%2F&data=05%7C02%7Cjan.stutzmann%40unibe.ch%7C0cb08932efa4431c062a08dc59fc6248%7Cd400387a212f43eaac7f77aa12d7977e%7C1%7C0%7C638484188650549784%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C60000%7C%7C%7C&sdata=Vud1Vs1FTkeWeYnf4u1y1mMt%2BS59Ze70cmYqfPJs1TY%3D&reserved=0" and the manifest file is a link to "https://iiif.ub.unibe.ch/...". Thus when a user clicks on the link the request can't be intercepted and routed to the plugin very easily.

A solution would be to change the format of the link. If the HTML is constructed by hand that will be quite easy. If, however, you are using a tool to construct the HTML then I would need to know how you have configured it to generate the current format for the links and from that we should be able to work out how to reconfigure it to generate links that result in an embedded Mirador viewer.