Skip to content

Commit 6ae3b20

Browse files
committed
Upgrade Mirador to version 4
replaces both Mirador 3 and the customized Mirador 2 previously used for palimpsests
1 parent 6b94c08 commit 6ae3b20

File tree

303 files changed

+7840
-108445
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

303 files changed

+7840
-108445
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ node_modules
99
/cypress/videos
1010

1111

12+
# mirador annotation editor, temporarily copied while I wait for a fix on the npm package exports
13+
/mae
14+
15+
1216
# local env files
1317
.env.local
1418
.env.*.local

cypress/e2e/manuscript.spec.js

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,67 @@
11
describe('A manuscript', () => {
2-
const URL_PARAMETERS = '#?manifest=https%3A%2F%2Fiiif.library.ucla.edu%2Fark%253A%252F21198%252Fzz0009gx6g%2Fmanifest'
2+
const URL_PARAMETERS =
3+
'#?manifest=https%3A%2F%2Fiiif.library.ucla.edu%2Fark%253A%252F21198%252Fzz0009gx6g%2Fmanifest'
34

45
it('loads Universal Viewer in an iframe', () => {
56
cy.visit('/' + URL_PARAMETERS)
67

78
// UV loads inside an iframe
8-
cy.frameLoaded("#universalviewer-iframe", {
9+
cy.frameLoaded('#universalviewer-iframe', {
910
url: '/uv.html' + URL_PARAMETERS,
10-
});
11+
})
1112
})
1213

1314
it('loads in Universal Viewer!', () => {
1415
cy.visit('/uv.html' + URL_PARAMETERS)
1516

1617
// Shows title
17-
cy.contains('.title', "Manuscript No. 1: Gladzor Gospels").should("exist").should("be.visible")
18+
cy.contains('.title', 'Manuscript No. 1: Gladzor Gospels').should('exist').should('be.visible')
1819

1920
// Settings Button
20-
cy.get("button.settings").should("exist").should("be.visible")
21+
cy.get('button.settings').should('exist').should('be.visible')
2122

2223
// left panel
2324
// is visible, first page selected
24-
cy.get(".leftPanel").should("exist").should("be.visible")
25-
.get("#thumb-0 > .thumb").should("have.class", "selected")
25+
cy.get('.leftPanel')
26+
.should('exist')
27+
.should('be.visible')
28+
.get('#thumb-0 > .thumb')
29+
.should('have.class', 'selected')
2630
// navigate to 3rd page by clicking thumbnail
27-
cy.get("#thumb-2 > .thumb").should("not.have.class", "selected")
28-
.get("#thumb-2 img").click()
29-
.get("#thumb-0 > .thumb").should("not.have.class", "selected")
30-
.get("#thumb-1 > .thumb").should("have.class", "selected")
31-
.get("#thumb-2 > .thumb").should("have.class", "selected")
31+
cy.get('#thumb-2 > .thumb').should('not.have.class', 'selected').get('#thumb-2 img').click()
32+
cy.get('#thumb-0 > .thumb')
33+
.should('not.have.class', 'selected')
34+
.get('#thumb-2 > .thumb')
35+
.should('have.class', 'selected')
3236
// navigate to 4th page by clicking thumbnail
33-
cy.get("#thumb-3 > .thumb").should("not.have.class", "selected")
34-
.contains("[Gladzor Gospels: page 2]").click()
35-
.get("#thumb-2 > .thumb").should("not.have.class", "selected")
36-
.get("#thumb-3 > .thumb").should("have.class", "selected")
37-
.get("#thumb-4 > .thumb").should("have.class", "selected")
37+
cy.get('#thumb-3 > .thumb')
38+
.should('not.have.class', 'selected')
39+
.contains('[Gladzor Gospels: page 2]')
40+
.click()
41+
cy.get('#thumb-2 > .thumb')
42+
.should('not.have.class', 'selected')
43+
.get('#thumb-3 > .thumb')
44+
.should('have.class', 'selected')
3845
// collapse left panel
39-
cy.get(".expandFullButton").should("exist").should("not.be.visible")
40-
.get(".collapseButton").should("exist").should("be.visible").click()
41-
.get(".leftPanel > .main").should("exist").should("not.be.visible")
46+
cy.get('.expandFullButton')
47+
.should('exist')
48+
.should('not.be.visible')
49+
.get('.collapseButton')
50+
.should('exist')
51+
.should('be.visible')
52+
.click()
53+
cy.get('.leftPanel > .main').should('exist').should('not.be.visible')
4254

4355
// "Print" is disabled
44-
cy.contains("Print").should("exist").should("not.be.visible")
56+
cy.contains('Print').should('exist').should('not.be.visible')
4557

4658
// "Share" is disabled
47-
cy.contains("Share").should("exist").should("not.be.visible")
59+
cy.contains('Share').should('exist').should('not.be.visible')
4860

4961
// Fullscreen button
50-
cy.contains("Full Screen").should("exist").should("be.visible")
62+
cy.contains('Full Screen').should('exist').should('be.visible')
5163

5264
// Download button
53-
cy.contains('Download').should("exist").should("be.visible")
65+
cy.contains('Download').should('exist').should('be.visible')
5466
})
5567
})
Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
describe('With the `site=sinai` parameter set', () => {
2-
const URL_PARAMETERS = `?site=sinai&manifest=${encodeURIComponent("https://iiif.library.ucla.edu/ark%3A%2F21198%2Fz18w4z1w/manifest")}`
3-
4-
it('loads Mirador 3 in an iframe', () => {
2+
const URL_PARAMETERS = `?site=sinai&manifest=${encodeURIComponent('https://iiif.library.ucla.edu/ark%3A%2F21198%2Fz18w4z1w/manifest')}`
3+
4+
it('loads in Mirador', () => {
55
// http://localhost:8080/?site=sinai&manifest=https%3A%2F%2Fiiif.library.ucla.edu%2Fark%253A%252F21198%252Fz18w4z1w%2Fmanifest
66
cy.visit('/' + URL_PARAMETERS)
7-
8-
cy.frameLoaded("#mirador-iframe", {
9-
url: '/mirador3.html' + URL_PARAMETERS,
10-
});
11-
})
12-
13-
it('loads in Mirador 3', () => {
14-
// http://localhost:8080/mirador3.html?site=sinai&manifest=https%3A%2F%2Fiiif.library.ucla.edu%2Fark%253A%252F21198%252Fz18w4z1w%2Fmanifest
15-
cy.visit('/mirador3.html' + URL_PARAMETERS)
167

17-
// Shows title
18-
cy.get(".mirador-viewer").should("exist").should("be.visible")
19-
cy.contains("h2", "Sinai, St. Catherine’s Monastery, Arabic 1").should("exist").should("be.visible")
8+
cy.get('.mirador-viewer').should('exist').should('be.visible')
9+
10+
// Image tools loaded
11+
cy.get('[aria-label="Expand image tools"]').should('exist').should('be.visible')
12+
13+
// Annotations plugin loaded
14+
cy.get('button[aria-label="Annotations"]').should('exist').should('be.visible')
15+
16+
// index panel open on load
17+
cy.get('.mirador-companion-area-left')
18+
.contains('h3', 'Index')
19+
.should('exist')
20+
.should('be.visible')
21+
22+
// close window button is present
23+
cy.get('button[aria-label="Close window"').should('exist').should('be.visible')
2024
})
2125
})
Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,30 @@
11
describe('With the `viewer=mirador` parameter set', () => {
2-
const URL_PARAMETERS = `?viewer=mirador&manifest=${encodeURIComponent("https://sinai-images.library.ucla.edu/iiif/ark:%2F21198%2Fz1bc4wfw/manifest")}`
3-
4-
it('loads Mirador 2 in an iframe', () => {
5-
// http://localhost:8080/?viewer=mirador&manifest=https%3A%2F%2Fsinai-images.library.ucla.edu%2Fiiif%2Fark%3A%252F21198%252Fz1bc4wfw%2Fmanifest
2+
const URL_PARAMETERS =
3+
'?site=sinai&manifest=https%3A%2F%2Fsinai-images.library.ucla.edu%2Fiiif%2Fark%3A%252F21198%252Fz1ft92mh%2Fmanifest'
4+
5+
it('loads in Mirador', () => {
6+
// http://localhost:8080/?site=sinai&manifest=https%3A%2F%2Fiiif.library.ucla.edu%2Fark%253A%252F21198%252Fz18w4z1w%2Fmanifest
67
cy.visit('/' + URL_PARAMETERS)
7-
8-
cy.frameLoaded("#mirador-iframe", {
9-
url: '/palimpsest/viewer.html' + URL_PARAMETERS,
10-
});
11-
})
12-
13-
it('loads in Mirador2 Viewer!', () => {
14-
// http://localhost:8080/mirador3.html?viewer=mirador&manifest=https%3A%2F%2Fsinai-images.library.ucla.edu%2Fiiif%2Fark%3A%252F21198%252Fz1bc4wfw%2Fmanifest
15-
cy.visit('/palimpsest/viewer.html' + URL_PARAMETERS)
168

17-
// Shows title
18-
cy.contains('.window-manifest-title', "Arabic 514").should("exist").should("be.visible")
9+
cy.get('.mirador-viewer').should('exist').should('be.visible')
10+
11+
cy.contains('CPA NF fragment 13').should('exist')
12+
13+
// Image tools loaded
14+
cy.get('[aria-label="Expand image tools"]').should('exist').should('be.visible')
15+
16+
// Annotations plugin loaded
17+
cy.get('button[aria-label="Annotations"]').should('exist').should('be.visible')
18+
19+
// index panel open on load
20+
cy.get('.mirador-companion-area-left')
21+
.contains('h3', 'Index')
22+
.should('exist')
23+
.should('be.visible')
24+
25+
// close window button is present
26+
cy.get('button[aria-label="Close window"').should('exist').should('be.visible')
27+
28+
cy.contains('An error occurred').should('not.exist')
1929
})
2030
})

0 commit comments

Comments
 (0)