diva.js 7.2.5 → 7.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -11
- package/build/diva.debug.js +29165 -0
- package/build/diva.esm.js +17 -0
- package/build/diva.js +17 -0
- package/package.json +15 -1
- package/.clang-format +0 -7
- package/.github/workflows/npm-publish.yml +0 -45
- package/Makefile +0 -75
- package/elm.json +0 -32
- package/review/elm.json +0 -52
- package/review/src/ReviewConfig.elm +0 -87
- package/scripts/elm-esm.sh +0 -40
- package/scripts/minify-css.mjs +0 -31
- package/src/Filters.elm +0 -1044
- package/src/Main.elm +0 -1217
- package/src/Model.elm +0 -213
- package/src/Msg.elm +0 -59
- package/src/Utilities.elm +0 -46
- package/src/View/CollectionExplorer.elm +0 -172
- package/src/View/Helpers.elm +0 -86
- package/src/View/HtmlRenderer.elm +0 -136
- package/src/View/Icons.elm +0 -159
- package/src/View/ManifestInfoModal.elm +0 -363
- package/src/View/PageViewModal.elm +0 -1046
- package/src/View/Sidebar.elm +0 -786
- package/src/View/Toolbar.elm +0 -189
- package/src/View.elm +0 -244
- package/src/diva.ts +0 -802
- package/src/filters.ts +0 -1843
- package/src/styles/app.css +0 -328
- package/src/styles/collection.css +0 -75
- package/src/styles/modal.css +0 -388
- package/src/styles/sidebar.css +0 -215
- package/src/styles/theme.css +0 -39
- package/src/styles/toolbar.css +0 -154
- package/src/viewer-element.ts +0 -1307
- package/testing/index.html +0 -52
- package/testing/testing.html +0 -231
- package/tsconfig.json +0 -12
package/testing/index.html
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
-
<title>Diva.js Viewer</title>
|
|
7
|
-
<!-- <link rel="stylesheet" href="../build/diva.css">-->
|
|
8
|
-
<style>
|
|
9
|
-
html,
|
|
10
|
-
body {
|
|
11
|
-
height: 100%;
|
|
12
|
-
}
|
|
13
|
-
body {
|
|
14
|
-
margin: 0;
|
|
15
|
-
font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
|
|
16
|
-
}
|
|
17
|
-
#diva-wrapper {
|
|
18
|
-
display: flex;
|
|
19
|
-
height: 100%;
|
|
20
|
-
width: 100%;
|
|
21
|
-
}
|
|
22
|
-
</style>
|
|
23
|
-
</head>
|
|
24
|
-
<body>
|
|
25
|
-
|
|
26
|
-
<div id="diva-wrapper"></div>
|
|
27
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/openseadragon/5.0.1/openseadragon.min.js"></script>
|
|
28
|
-
<!-- <script src="vendor/openseadragon.js"></script>-->
|
|
29
|
-
<script src="../build/diva.debug.js"></script>
|
|
30
|
-
<script>
|
|
31
|
-
const params = new URLSearchParams(window.location.search);
|
|
32
|
-
const manifestParam = params.get("manifest");
|
|
33
|
-
const objectData = manifestParam && manifestParam.trim()
|
|
34
|
-
? manifestParam.trim()
|
|
35
|
-
: "https://iiif.bodleian.ox.ac.uk/iiif/manifest/e32a277e-91e2-4a6d-8ba6-cc4bad230410.json";
|
|
36
|
-
|
|
37
|
-
new Diva("diva-wrapper", {
|
|
38
|
-
setLanguage: "ar",
|
|
39
|
-
objectData,
|
|
40
|
-
// objectData: "https://iiif.bodleian.ox.ac.uk/iiif/manifest/ae9f6cca-ae5c-4149-8fe4-95e6eca1f73c.json",
|
|
41
|
-
// objectData: "https://iiif.bodleian.ox.ac.uk/iiif/manifest/22baf2a5-5eb4-4c5b-b074-707aa29c83bc.json",
|
|
42
|
-
// objectData: "https://iiif.bodleian.ox.ac.uk/iiif/manifest/cbcbdb78-1f09-452c-8645-d77bcbf306f0.json",
|
|
43
|
-
// objectData: "https://www.diamm.ac.uk/sources/194/manifest/",
|
|
44
|
-
// objectData: "https://iiif.bodleian.ox.ac.uk/iiif/collection/top",
|
|
45
|
-
// objectData: "https://iiif.bodleian.ox.ac.uk/iiif/collection/all-souls",
|
|
46
|
-
// objectData: "https://iiif.io/api/cookbook/recipe/0033-choice/manifest.json",
|
|
47
|
-
// objectData: "./diamm-manifest.json",
|
|
48
|
-
acceptHeaders: ["application/ld+json;profile=http://iiif.io/api/presentation/3/context.json"],
|
|
49
|
-
});
|
|
50
|
-
</script>
|
|
51
|
-
</body>
|
|
52
|
-
</html>
|
package/testing/testing.html
DELETED
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
-
<title>IIIF Scroll POC - Testing</title>
|
|
7
|
-
<style>
|
|
8
|
-
body {
|
|
9
|
-
margin: 0;
|
|
10
|
-
font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
|
|
11
|
-
background: #f5f2ea;
|
|
12
|
-
color: #222322;
|
|
13
|
-
}
|
|
14
|
-
.controls {
|
|
15
|
-
display: grid;
|
|
16
|
-
grid-template-columns: 1fr;
|
|
17
|
-
gap: 12px;
|
|
18
|
-
padding: 16px 20px;
|
|
19
|
-
border-bottom: 1px solid #e2d9cf;
|
|
20
|
-
background: #fffaf2;
|
|
21
|
-
}
|
|
22
|
-
.controls-row {
|
|
23
|
-
display: flex;
|
|
24
|
-
gap: 12px;
|
|
25
|
-
align-items: center;
|
|
26
|
-
flex-wrap: wrap;
|
|
27
|
-
}
|
|
28
|
-
.controls label {
|
|
29
|
-
font-weight: 600;
|
|
30
|
-
text-transform: uppercase;
|
|
31
|
-
font-size: 12px;
|
|
32
|
-
letter-spacing: 0.08em;
|
|
33
|
-
color: #6a6257;
|
|
34
|
-
}
|
|
35
|
-
.controls input[type="text"],
|
|
36
|
-
.controls select {
|
|
37
|
-
padding: 8px 10px;
|
|
38
|
-
border-radius: 6px;
|
|
39
|
-
border: 1px solid #d6cbbb;
|
|
40
|
-
min-width: 280px;
|
|
41
|
-
font-size: 14px;
|
|
42
|
-
}
|
|
43
|
-
.controls button {
|
|
44
|
-
padding: 8px 16px;
|
|
45
|
-
border-radius: 6px;
|
|
46
|
-
border: 1px solid #9f8c73;
|
|
47
|
-
background: #f0e6d7;
|
|
48
|
-
font-weight: 600;
|
|
49
|
-
cursor: pointer;
|
|
50
|
-
}
|
|
51
|
-
html,
|
|
52
|
-
body {
|
|
53
|
-
height: 100%;
|
|
54
|
-
}
|
|
55
|
-
#diva-wrapper {
|
|
56
|
-
display: flex;
|
|
57
|
-
height: 100%;
|
|
58
|
-
width: 100%;
|
|
59
|
-
}
|
|
60
|
-
</style>
|
|
61
|
-
|
|
62
|
-
</head>
|
|
63
|
-
<body>
|
|
64
|
-
<div class="controls">
|
|
65
|
-
<div class="controls-row">
|
|
66
|
-
<label>Manifest Source</label>
|
|
67
|
-
<label>
|
|
68
|
-
<input type="radio" name="manifest-source" value="list" checked />
|
|
69
|
-
Choose from list
|
|
70
|
-
</label>
|
|
71
|
-
<label>
|
|
72
|
-
<input type="radio" name="manifest-source" value="url" />
|
|
73
|
-
Enter URL
|
|
74
|
-
</label>
|
|
75
|
-
</div>
|
|
76
|
-
<div class="controls-row">
|
|
77
|
-
<label for="version-select">IIIF Version</label>
|
|
78
|
-
<select id="version-select">
|
|
79
|
-
<option value="">Auto</option>
|
|
80
|
-
<option value="v2">IIIF v2</option>
|
|
81
|
-
<option value="v3">IIIF v3</option>
|
|
82
|
-
</select>
|
|
83
|
-
<label for="language-select">Language</label>
|
|
84
|
-
<select id="language-select">
|
|
85
|
-
<option value="auto">auto</option>
|
|
86
|
-
<option value="en">en</option>
|
|
87
|
-
<option value="de">de</option>
|
|
88
|
-
<option value="zh">zh</option>
|
|
89
|
-
</select>
|
|
90
|
-
</div>
|
|
91
|
-
<div class="controls-row" id="list-row">
|
|
92
|
-
<label for="manifest-select">Manifest</label>
|
|
93
|
-
<select id="manifest-select">
|
|
94
|
-
<option value="">(No manifests configured)</option>
|
|
95
|
-
</select>
|
|
96
|
-
</div>
|
|
97
|
-
<div class="controls-row" id="url-row" style="display:none;">
|
|
98
|
-
<label for="manifest-url">Manifest URL</label>
|
|
99
|
-
<input
|
|
100
|
-
id="manifest-url"
|
|
101
|
-
type="text"
|
|
102
|
-
placeholder="https://example.org/iiif/manifest.json"
|
|
103
|
-
/>
|
|
104
|
-
</div>
|
|
105
|
-
<div class="controls-row">
|
|
106
|
-
<button id="manifest-go" type="button">Go</button>
|
|
107
|
-
</div>
|
|
108
|
-
</div>
|
|
109
|
-
|
|
110
|
-
<div id="diva-wrapper"></div>
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/openseadragon/5.0.1/openseadragon.min.js"></script>
|
|
114
|
-
<script src="../build/diva.debug.js"></script>
|
|
115
|
-
<script>
|
|
116
|
-
const manifests = [
|
|
117
|
-
{ label: "GB-Ob MS Bodl. 264", url: "https://iiif.bodleian.ox.ac.uk/iiif/manifest/ae9f6cca-ae5c-4149-8fe4-95e6eca1f73c.json" },
|
|
118
|
-
{ label: "GB-Cu MS Add. 10062", url: "https://cudl.lib.cam.ac.uk//iiif/MS-ADD-10062" },
|
|
119
|
-
{ label: "GB-Och MS. Oppenheim Add. fol. 25 (RTL)", url: "https://iiif.bodleian.ox.ac.uk/iiif/manifest/22baf2a5-5eb4-4c5b-b074-707aa29c83bc.json" },
|
|
120
|
-
{ label: "All Souls collection", url: "https://iiif.bodleian.ox.ac.uk/iiif/collection/all-souls" },
|
|
121
|
-
{ label: "Madonna with Canon Joris", url: "https://dam.museabrugge.be/iiif/3/418/manifest.json" },
|
|
122
|
-
{ label: "Huntingdon 61667, Canterbury Tales", url: "https://hdl.huntington.org/iiif/info/p15150coll3/6983/manifest.json" },
|
|
123
|
-
{ label: "Adoration of the Magi, Ftizw. MAR.T.30-1912", url: "https://api.fitz.ms/data-distributor/iiif/object-110472/manifest" },
|
|
124
|
-
{ label: "Map of Asia, Quatar 2702", url: "https://www.qdl.qa/en/iiif/qnlhc/2702/manifest" },
|
|
125
|
-
{ label: "Wunder der Vererbung, Wellcome Collection", url: "https://iiif.wellcomecollection.org/presentation/b18035723" },
|
|
126
|
-
{ label: "Mahabharata Scroll, University of Edinburgh", url: "https://librarylabs.ed.ac.uk/iiif/manifest/mahabharataFinal.json" },
|
|
127
|
-
{ label: "Vatican Lat. 5757", url: "https://digi.vatlib.it/iiif/MSS_Vat.lat.5757/manifest.json" },
|
|
128
|
-
{ label: "Codex Sang. 194", url: "https://www.e-codices.unifr.ch/metadata/iiif/csg-0194/manifest.json" },
|
|
129
|
-
{ label: "San Lorenzo Palimpsest", url: "https://iiif.diamm.net/manifests/I-FL_MS2211/manifest.json" },
|
|
130
|
-
{ label: "Barocci 197*", url: "https://iiif.bodleian.ox.ac.uk/iiif/manifest/3a910d94-9e88-4207-9020-8ee0634b01ec.json" },
|
|
131
|
-
{ label: "Paris 12044", url: "https://gallica.bnf.fr/iiif/ark:/12148/btv1b8422976g/manifest.json" },
|
|
132
|
-
{ label: "HP Lovecraft", url: "https://repository.library.brown.edu/iiif/presentation/bdr:425489/manifest.json" },
|
|
133
|
-
{ label: "Onstage", url: "https://iiif.rism.digital/manifest/onstage/CH_Bm/CH_Bm_002/CH_Bm_prg-1391.json" },
|
|
134
|
-
{ label: "Durham Breviary", url: "https://iiif.durham.ac.uk/manifests/trifle/32150/t2/m7/w6/t2m7w62f844z/manifest" },
|
|
135
|
-
{ label: "Qatar Digital Library MS", url: "https://www.qdl.qa/en/iiif/81055/vdc_100098983347.0x000001/manifest" },
|
|
136
|
-
{ label: "U of T Manifest", url: "https://iiif.library.utoronto.ca/presentation/v2/fisherbooks:F10083/manifest" },
|
|
137
|
-
{ label: "BSB Manifest", url: "https://api.digitale-sammlungen.de/iiif/presentation/v2/bsb00087481/manifest" },
|
|
138
|
-
];
|
|
139
|
-
|
|
140
|
-
const selectEl = document.getElementById("manifest-select");
|
|
141
|
-
const urlInput = document.getElementById("manifest-url");
|
|
142
|
-
const versionSelect = document.getElementById("version-select");
|
|
143
|
-
const languageSelect = document.getElementById("language-select");
|
|
144
|
-
const listRow = document.getElementById("list-row");
|
|
145
|
-
const urlRow = document.getElementById("url-row");
|
|
146
|
-
const goButton = document.getElementById("manifest-go");
|
|
147
|
-
const viewerWrap = document.querySelector(".viewer-wrap");
|
|
148
|
-
let wrapper = document.getElementById("diva-wrapper");
|
|
149
|
-
|
|
150
|
-
function populateList() {
|
|
151
|
-
selectEl.innerHTML = "";
|
|
152
|
-
if (manifests.length === 0) {
|
|
153
|
-
const option = document.createElement("option");
|
|
154
|
-
option.value = "";
|
|
155
|
-
option.textContent = "(No manifests configured)";
|
|
156
|
-
selectEl.appendChild(option);
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
for (const manifest of manifests) {
|
|
160
|
-
const option = document.createElement("option");
|
|
161
|
-
option.value = manifest.url;
|
|
162
|
-
option.textContent = manifest.label || manifest.url;
|
|
163
|
-
selectEl.appendChild(option);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
function getSelectedSource() {
|
|
168
|
-
const selected = document.querySelector('input[name="manifest-source"]:checked');
|
|
169
|
-
return selected ? selected.value : "list";
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
function setSourceVisibility() {
|
|
173
|
-
const source = getSelectedSource();
|
|
174
|
-
listRow.style.display = source === "list" ? "flex" : "none";
|
|
175
|
-
urlRow.style.display = source === "url" ? "flex" : "none";
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
let currentInstance = null;
|
|
179
|
-
|
|
180
|
-
function buildAcceptHeaders() {
|
|
181
|
-
if (versionSelect.value === "v2") {
|
|
182
|
-
return ["application/ld+json;profile=http://iiif.io/api/presentation/2/context.json"];
|
|
183
|
-
}
|
|
184
|
-
if (versionSelect.value === "v3") {
|
|
185
|
-
return ["application/ld+json;profile=http://iiif.io/api/presentation/3/context.json"];
|
|
186
|
-
}
|
|
187
|
-
return [];
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
function loadManifest(url) {
|
|
191
|
-
if (!url) {
|
|
192
|
-
alert("Please select or enter a manifest URL.");
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
if (currentInstance && typeof currentInstance.destroy === "function") {
|
|
196
|
-
currentInstance.destroy();
|
|
197
|
-
}
|
|
198
|
-
if (viewerWrap) {
|
|
199
|
-
viewerWrap.innerHTML = '<div id="diva-wrapper"></div>';
|
|
200
|
-
wrapper = document.getElementById("diva-wrapper");
|
|
201
|
-
}
|
|
202
|
-
const config = {
|
|
203
|
-
objectData: url,
|
|
204
|
-
acceptHeaders: buildAcceptHeaders(),
|
|
205
|
-
};
|
|
206
|
-
if (languageSelect.value !== "auto") {
|
|
207
|
-
config.setLanguage = languageSelect.value;
|
|
208
|
-
}
|
|
209
|
-
currentInstance = new Diva("diva-wrapper", config);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
document.addEventListener("change", (event) => {
|
|
213
|
-
if (event.target && event.target.name === "manifest-source") {
|
|
214
|
-
setSourceVisibility();
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
|
|
218
|
-
goButton.addEventListener("click", () => {
|
|
219
|
-
const source = getSelectedSource();
|
|
220
|
-
if (source === "list") {
|
|
221
|
-
loadManifest(selectEl.value);
|
|
222
|
-
} else {
|
|
223
|
-
loadManifest(urlInput.value.trim());
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
|
|
227
|
-
populateList();
|
|
228
|
-
setSourceVisibility();
|
|
229
|
-
</script>
|
|
230
|
-
</body>
|
|
231
|
-
</html>
|
package/tsconfig.json
DELETED