Skip to content

Wire up Diva v7 viewer events, page tracking, and manifest info - #971

Open
etosphere wants to merge 2 commits into
diva/2-vendor-v7from
diva/3-v7-read-path
Open

Wire up Diva v7 viewer events, page tracking, and manifest info#971
etosphere wants to merge 2 commits into
diva/2-vendor-v7from
diva/3-v7-read-path

Conversation

@etosphere

Copy link
Copy Markdown
Contributor

Closes #965.

This commit gives the v7 backend its read path. After previous commits
the v7 backend only proved the wiring and emitted no events,
which kept DivaView's downstream folio code dormant; it now drives the
viewer's lifecycle and page state through the adapter's existing,
backend-neutral interface.

DivaBackendV7 listens for v7's diva-page-change DOM event on the
(viewer:loaded, document:loaded, page:changed). v7 has no public
readiness signal, so the first diva-page-change stands in for
viewer:loaded / document:loaded. The backend tracks the current page
index from that event and derives the page image URIs from the viewer's
tile sources, which keeps getCurrentPageURI / getAllPageURIs /
getCurrentPageIndex working as before.

This commit contains only the JavaScript source; the built bundles under
nginx/static are not regenerated in this commit.
The v7 backend now provides the manifest's image attribution. v7 has
no ManifestDidLoad event, so DivaBackendV7 fetches the manifest itself
and emits manifest:loaded with the attribution, logo, and licence.

A shared manifestMetadata helper flattens both IIIF v2 and v3 manifests
into { imageAttribution, imageLogoUrl, imageLicence }.

The "Manuscript info" button doesn't exist on v7 this yet, which will be
implemented in future commits.

This commit contains only the JavaScript source; the built bundles under
nginx/static are not regenerated in this commit.

@kyrieb-ekat kyrieb-ekat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants