Repository navigation
Conversation
# Conflicts: # resources/js/edirom-verovio-renderer
Veroviointegration
|
Opened PR #276 to extract the duplicated ImageViewer host-side setup into a shared ImageViewerHost.js helper. |
|
@DennisFriedl, can you have a look at this PR and the corresponding PRs? |
#275) * Remove FontAwesome dependency from edirom-image-viewer by making annotation stylesheet injection and category icons fully host-driven; closes #271. * populate iconHtml for the beschreibung/rasurTektur annotation zones when building zones-data * remove OpednSeadragon from resources and update the styling of annotations
…m-Online-Frontend into image-component-integration
[ftr]: ImageViewer host wiring into a shared helper
|
this PR points to an old submodule version of the image-viewer (commit 7613617. Could you update it to point to the newest commit d8b80d564e9cfb08833a87aa82dc7aa73e9bf07d? Could you also please update this PR to be up to date with |
…tegration # Conflicts: # app/controller/window/source/SourceView.js # app/view/window/image/ImageViewer.js # app/view/window/image/OpenSeaDragonViewer.js # app/view/window/source/MeasureBasedView.js # app/view/window/source/PageBasedView.js # app/view/window/source/SourceView.js # app/view/window/text/TextFacsimileSplitView.js
|
@DennisFriedl, now the merge conflict is resolved, and the submodule is up to date |
|
I noticed the following issues:
|
Thank you @DennisFriedl, fixed with commit c3f6ee2 |
|
Thank you, @hizclick. These issues seem to be resolved now! While testing this PR I had the following thoughts about old behaviour of the Image Viewer that your PR did not introduce but that we could maybe think about solving with it? 1. Are the annotation icons centered correctly?
Here the icons seem to be centered horizontally but the first icon is cut off at the bottom, isn't it?
But here the same icons seem to be aligned more to the right.
And here the icons seem to move even further to the right and get cut off at the right side. 2. The annotations are covering the measure numbersCurrently the annotations are fully overlaying the measure numbers, making the measure numbers unreadable. Would it be a complicated to e.g. place the measure number below the annotations column? 3. Switching between the Page Based View and Measure Based ViewAt the moment, the Page Based View and Measure Based View have two distinct counters of the "current page". When I start the Image Viewer on the Page Based View on page 1, then switch to the Measure Based View and move to another page (let's say page 2), a switch back to the Page Based View leads me back to page 1 even though the "current page" is page 2, isn't it? In my optinion a switch between the views should not disturb the currently opened page. Navigating to page 2 in the Measure Paged View a switch to the Page Based View should also show me the second page but fully zoomed out. The same happens the other way around. Navigating to page 3 in the Page Based View and then switching to the Measure Based View shows me the last selected measure OR the first measure of the document which can be on completely different pages. Instead, I would expect a measure view of the first measure of the currently selected page (if this page contains a measure), wouldn't I? |
|
I created a PR to fix the centering issue: #325 |



Integration of the
edirom-image-viewerweb componentDescription, Context and related Issue
This PR integrates the new OpenSeadragon-based
edirom-image-viewerweb component into the Edirom Online Frontend and rewires the existing ExtJS image window to drive it. It replaces the previous tightly-coupled OpenSeadragon usage with a reusable, attribute-driven custom element (rendered in its own Shadow DOM), so the facsimile viewer can be developed and reused independently of the ExtJS application.The result is a clean split of responsibilities: the component owns all viewer rendering (tiles, pagination, and every overlay — measures, measure labels, movements, annotation badges, and their tooltips), while ExtJS only provides data and the surrounding window UI. The host communicates with the component purely through attributes and custom events — no direct OpenSeadragon API calls remain in the ExtJS layer.
What this PR delivers:
resources/js/edirom-image-viewer/): a self-containededirom-image-viewer.jscustom element built on OpenSeadragon, with IIIF manifest / tile-source loading, sequence & collection modes, zoom/pan/rotation, configurable native controls, and a fully attribute-driven API plus custom events. Includes component metadata (README.md,LICENSE,CITATION.cff,CODE_OF_CONDUCT.md). The component is included as a git submodule.OpenSeaDragonViewer.js): the ExtJS image viewer now instantiates the custom element and communicates with it purely through attributes/events instead of direct OpenSeadragon API calls — keeping all viewer state (page, zoom, rotation, controls) in sync with the surrounding Edirom UI (page spinner, top bar, source views).zones-dataoverlay model: every overlay type — annotations, measures, measure labels, and movements (mdivs) — is now pushed through onezones-datamap keyed by a namespaced zone key (measure:<key>,mdiv:<key>,annotation:<…>). Each zone entry carries itstype, optionalpage, rectangle (ulx/uly/lrx/lry), CSS classes (containerClass/innerClass), an optionallabel, agroup(so badges on the same region stack), a preloadedtooltipHTML, a clickfn, and genericfilterstokens. Each sub-map (measures / mdivs / annotations) is merged on its own push, so re-pushing one type never drops the others. This replaces the former separatemeasures-data/mdivs-data/annotations-data/measure-numbers-dataattributes.zonenavigation attribute: navigation to any zone (a bar, a movement, or a generic region) goes through the single semanticzoneattribute, set to the namespaced key with an optional|<nonce>token so repeated jumps to the same key re-fire. Same-page jumps fit the region directly; cross-page jumps switch page, wait for tiles, then fit — enabling the source / concordance views to jump the facsimile to a specific bar or movement, including across pages. Wired throughPageBasedView/MeasureBasedView/SourceView.annotation-typed entries inzones-data; the component renders the clickable badges in its Shadow DOM and fires azone-clickevent back to the host for the click action. The annotation tooltip is rendered by the component itself from a per-zonetooltipHTML field — the host preloads each annotation's server-rendered tooltip HTML up front (fetched in parallel, with a safety-net timeout) and pushes it intozones-data, and the relevant edition / overlay CSS is injected into the Shadow DOM so the tooltip is styled correctly.visible-types: whole overlay types are shown/hidden through thevisible-typesattribute (a JSON array of the zone types to render, e.g.["annotation","measure"]), without discarding the pushedzones-data. This is a pure visibility switch (no re-fetch / re-push) and replaces the former per-featureshow-annotations/show-measure-numbersbooleans.hidden-filters(two-way sync): category & priority filtering now uses a single generichidden-filtersset — the union of the taxonomy tokens the user has unchecked; the component hides any annotation carrying one of them. "No filter" is the empty set and "hide all" is every token, so the old["undefined"]/[]sentinels and the separatevisible-categories/visible-prioritiesattributes are gone. The component emits afilter-changedevent (carryingdetail.hiddenFilters) whenever the filter changes — including whenhidden-filtersis set externally (e.g. via DevTools) — so the host keeps its filter-menu checkboxes in sync with no feedback loop.labeland label CSS class (measureInner/measureInnerEmpty), and they show/hide with themeasuretype viavisible-types, re-applied on every page render.total-pages-changedevent when its tile-source set shrinks (e.g. a page is removed), so the host trims its page list / spinner bounds and notifies the owning view.setZoomnow clamps to[minzoomlevel, maxzoomlevel]— fixing zoom-bar overshoot beyond the configured maximum and jump/zoom spring-back.setFullScreento use the standard Fullscreen API on the component host element.view-mode: the active source view mode is pushed to the component via theview-modeattribute so host code can react.README.mddocuments all attributes (incl.preserveviewport,minzoomlevel,maxzoomlevel,zones-data,zone,visible-types,hidden-filters,fitrect,triggerhome,sequencemode,view-mode), public methods, events (page-changed,total-pages-changed,zone-click,filter-changed,zoom,image-ready), and the "Zones", "Region Navigation" and "Annotation Overlays" guides.Refs #12
How Has This Been Tested?
Tested locally with the full Edirom Online stack via Docker Compose, building the frontend from this branch against the
developbackend:Manual verification in the running app (eXist-db at
localhost:8080, app at/exist/apps/Edirom-Online-Frontend/):true) loads a single page item and collection mode (false) loads all images. Removing a page firestotal-pages-changedand trims the host page list / spinner.zones-data, then triggerzone="measure:<key>|<nonce>". Verified both same-page and cross-page jumps firepage-changedand fit the region aspect-correctly and centered (e.g. a measure on page 2 with rect1170,240 → 1360,1180).zones-dataand triggerzone="mdiv:<key>|<nonce>"to jump to a movement's first page; verified correct page/movement navigation from the source views.maxzoomlevel=5,setZoom(10)clamps to 5; withminzoomlevel=0.5,setZoom(0.01)clamps to 0.5; no jump/zoom spring-back.zones-data(each carrying itstype:'annotation', rect,innerClass, preloadedtooltipHTML, clickfn, andfilterstokens) and make them visible viaviewer.setAttribute('visible-types', '["annotation"]'); the badge renders, hovering shows the component-rendered tooltip (styled via the injected CSS), and clicking fireszone-clickso the host runs the action.visible-typesbetween["annotation","measure"]and[]shows/hides whole overlay types without re-pushingzones-data, and the chosen state persists across page changes.hidden-filters):viewer.setAttribute('hidden-filters', '["ediromAnnotPrio1"]')hides annotations carrying that token;'[]'shows all. Setting the attribute externally re-checks/unchecks the matching host menu items via thefilter-changedevent, with no feedback loop.labelrender the numbered box and empty ones usemeasureInnerEmpty; visibility follows themeasuretype invisible-typesand persists across page changes.zone="",visible-types="[]",hidden-filters="[]",view-mode=""produces no console warnings.Types of changes
Overview