Skip to content

Commit dc1aefd

Browse files
author
Jane
committed
Merge branch 'viewer-poc' into feature/image-viewer
* viewer-poc: update manifest for uv player Format JS, ignore mirador.min.js Add Mirador to image viewers comparison page
2 parents fad463f + a33c88c commit dc1aefd

10 files changed

+182
-19
lines changed

.eslintrc.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,6 @@ module.exports = {
3333
react: {
3434
version: "detect"
3535
}
36-
}
36+
},
37+
ignorePatterns: ["mirador.min.js"]
3738
};

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
mirador.min.js

sass/etna.scss

+1
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ These are Etna specific components, created using BEM and following our guidelin
147147
@import "includes/record-creator-description";
148148
@import "includes/record-creator-collections";
149149
@import "includes/universal-viewer";
150+
@import "includes/mirador";
150151

151152
/*
152153

sass/includes/_mirador.scss

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.mirador {
2+
position: relative;
3+
width: 100%;
4+
height: 80vh;
5+
}

scripts/src/viewers/mirador.js

+35-15
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,45 @@
1-
import Mirador from "mirador/dist/es/src/index";
2-
import { miradorImageToolsPlugin } from "mirador-image-tools";
1+
import Mirador from "./mirador.min.js";
32

43
const viewer = document.getElementById("mirador-viewer");
5-
const manifestID = viewer.getAttribute("data-id");
4+
const manifestId = viewer.getAttribute("data-id");
65

7-
const config = {
8-
id: "mirador-viewer",
9-
windows: [
10-
{
11-
imageToolsEnabled: true,
12-
imageToolsOpen: true,
13-
manifestId: manifestID,
14-
},
15-
],
6+
Mirador.viewer({
7+
// see https://github.com/ProjectMirador/mirador/blob/5cb692ed31480c1e130f4a8715726688cb35796d/src/config/settings.js#L264 for config options
8+
id: "mirador-viewer", // id selector where Mirador should be instantiated
169
theme: {
1710
palette: {
1811
primary: {
1912
main: "#1967d2",
2013
},
2114
},
2215
},
23-
};
24-
25-
Mirador.viewer(config, [...miradorImageToolsPlugin]);
16+
windows: [
17+
{
18+
manifestId,
19+
view: "single",
20+
},
21+
],
22+
window: {
23+
allowClose: false, // Prevent the user from closing this window
24+
allowMaximize: false,
25+
allowFullscreen: true,
26+
defaultSideBarPanel: "info",
27+
sideBarOpenByDefault: false,
28+
highlightAllAnnotations: true,
29+
views: [
30+
// Only allow the user to select single and gallery view
31+
{ key: "single" },
32+
{ key: "gallery" },
33+
],
34+
},
35+
thumbnailNavigation: {
36+
defaultPosition: "far-bottom",
37+
},
38+
workspace: {
39+
type: "mosaic",
40+
showZoomControls: true,
41+
},
42+
workspaceControlPanel: {
43+
enabled: false, // Remove extra workspace settings
44+
},
45+
});

scripts/src/viewers/mirador.min.js

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
/*
2+
object-assign
3+
(c) Sindre Sorhus
4+
@license MIT
5+
*/
6+
7+
/*!
8+
Copyright (c) 2018 Jed Watson.
9+
Licensed under the MIT License (MIT), see
10+
http://jedwatson.github.io/classnames
11+
*/
12+
13+
/*! @license DOMPurify 2.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.3/LICENSE */
14+
15+
/*! https://mths.be/punycode v1.4.1 by @mathias */
16+
17+
/**
18+
* @license
19+
* Copyright 2019 Kevin Verdieck, originally developed at Palantir Technologies, Inc.
20+
*
21+
* Licensed under the Apache License, Version 2.0 (the "License");
22+
* you may not use this file except in compliance with the License.
23+
* You may obtain a copy of the License at
24+
*
25+
* http://www.apache.org/licenses/LICENSE-2.0
26+
*
27+
* Unless required by applicable law or agreed to in writing, software
28+
* distributed under the License is distributed on an "AS IS" BASIS,
29+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
30+
* See the License for the specific language governing permissions and
31+
* limitations under the License.
32+
*/
33+
34+
/**
35+
* A better abstraction over CSS.
36+
*
37+
* @copyright Oleg Isonen (Slobodskoi) / Isonen 2014-present
38+
* @website https://github.com/cssinjs/jss
39+
* @license MIT
40+
*/
41+
42+
/** @license React v0.19.1
43+
* scheduler.production.min.js
44+
*
45+
* Copyright (c) Facebook, Inc. and its affiliates.
46+
*
47+
* This source code is licensed under the MIT license found in the
48+
* LICENSE file in the root directory of this source tree.
49+
*/
50+
51+
/** @license React v16.13.1
52+
* react-is.production.min.js
53+
*
54+
* Copyright (c) Facebook, Inc. and its affiliates.
55+
*
56+
* This source code is licensed under the MIT license found in the
57+
* LICENSE file in the root directory of this source tree.
58+
*/
59+
60+
/** @license React v16.14.0
61+
* react-dom.production.min.js
62+
*
63+
* Copyright (c) Facebook, Inc. and its affiliates.
64+
*
65+
* This source code is licensed under the MIT license found in the
66+
* LICENSE file in the root directory of this source tree.
67+
*/
68+
69+
/** @license React v16.14.0
70+
* react.production.min.js
71+
*
72+
* Copyright (c) Facebook, Inc. and its affiliates.
73+
*
74+
* This source code is licensed under the MIT license found in the
75+
* LICENSE file in the root directory of this source tree.
76+
*/
77+
78+
/** @license React v17.0.2
79+
* react-is.production.min.js
80+
*
81+
* Copyright (c) Facebook, Inc. and its affiliates.
82+
*
83+
* This source code is licensed under the MIT license found in the
84+
* LICENSE file in the root directory of this source tree.
85+
*/
86+
87+
/**!
88+
* @fileOverview Kickass library to create and place poppers near their reference elements.
89+
* @version 1.16.1-lts
90+
* @license
91+
* Copyright (c) 2016 Federico Zivolo and contributors
92+
*
93+
* Permission is hereby granted, free of charge, to any person obtaining a copy
94+
* of this software and associated documentation files (the "Software"), to deal
95+
* in the Software without restriction, including without limitation the rights
96+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
97+
* copies of the Software, and to permit persons to whom the Software is
98+
* furnished to do so, subject to the following conditions:
99+
*
100+
* The above copyright notice and this permission notice shall be included in all
101+
* copies or substantial portions of the Software.
102+
*
103+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
104+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
105+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
106+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
107+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
108+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
109+
* SOFTWARE.
110+
*/
111+
112+
//! Built on 2020-03-05
113+
114+
//! Git commit: v2.4.2-0-c450749
115+
116+
//! License: http://openseadragon.github.io/license/
117+
118+
//! http://openseadragon.github.io
119+
120+
//! openseadragon 2.4.2

scripts/src/viewers/mirador.min.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

templates/images/image_viewer_page.html

+13-2
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,22 @@ <h2 class="heading heading--two">
2828
<div class="uv" id="uv"></div>
2929
</div>
3030
</article>
31+
32+
33+
<article class="tna-container tna-!--margin-top-l">
34+
<div class="tna-column tna-column--full">
35+
<h2 class="heading heading--two">
36+
Mirador
37+
</h2>
38+
<div class="mirador" id="mirador-viewer" data-id="https://iiif.bodleian.ox.ac.uk/iiif/manifest/60834383-7146-41ab-bfe1-48ee97bc04be.json"></div>
39+
</div>
40+
</article>
41+
3142
{% endblock content %}
3243

3344
{% block extra_js %}
3445
<script src="{% static 'scripts/clover.js' %}"></script>
35-
{% comment %} <script src="{% static 'scripts/mirador.js' %}"></script> {% endcomment %}
46+
<script src="{% static 'scripts/mirador.js' %}"></script>
3647
<script src="{% static 'tify/tify.js' %}"></script>
3748
<script>
3849
new Tify({
@@ -45,7 +56,7 @@ <h2 class="heading heading--two">
4556
</script>
4657
<script>
4758
const data = {
48-
manifest: "{{ page.iiif_manifest_id }}",
59+
manifest: "https://iiif.bodleian.ox.ac.uk/iiif/manifest/60834383-7146-41ab-bfe1-48ee97bc04be.json",
4960
};
5061

5162
uv = UV.init("uv", data);

webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = {
1010
gtm_script: "./scripts/src/gtm-script.js",
1111
image_viewer: "./scripts/src/image-viewer.js",
1212
home_page: "./scripts/src/home-page.js",
13-
// mirador: "./scripts/src/viewers/mirador.js",
13+
mirador: "./scripts/src/viewers/mirador.js",
1414
explorer: "./scripts/src/explorer.js",
1515
article: "./scripts/src/article.js",
1616
article_index_page: "./scripts/src/article-index-page.js",

0 commit comments

Comments
 (0)