Skip to content

Fire IIIF.DOWNLOAD for openseadragon downloads#1530

Merged
demiankatz merged 1 commit intoUniversalViewer:devfrom
sarangj:download_event
Aug 26, 2025
Merged

Fire IIIF.DOWNLOAD for openseadragon downloads#1530
demiankatz merged 1 commit intoUniversalViewer:devfrom
sarangj:download_event

Conversation

@sarangj
Copy link
Copy Markdown
Contributor

@sarangj sarangj commented Aug 19, 2025

#1523

Description of what you did:

open to feedback on how this is implemented or if this makes sense at all, tried to follow existing patterns in this extension!

Pass an onDownload callback to the download dialogue for openseadragon that simply publishes a DOWNLOAD event when one of the download options is clicked. I enmulated the payload for the DOWNLOAD event for the AV extension:

this.extensionHost.publish(IIIFEvents.DOWNLOAD, {
type: type,
label: label,
});

@vercel
Copy link
Copy Markdown

vercel bot commented Aug 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
universalviewer Ready Ready Preview Comment Aug 19, 2025 5:41pm

Pass an `onDownload` callback to the download dialogue for
openseadragon that simply publishes a DOWNLOAD event when one of the
download options is clicked.  I enmulated the payload for the DOWNLOAD
event for the AV extension:
https://github.com/UniversalViewer/universalviewer/blob/8eeee2452f4fc4d22777fdffcf3ac9d60e2bdd32/src/content-handlers/iiif/extensions/uv-av-extension/DownloadDialogue.ts#L76-L79
@sarangj
Copy link
Copy Markdown
Contributor Author

sarangj commented Aug 19, 2025

I tested this by dropping the following into the script section of src/uv.html:

        uv.on("download", function({ payload, cb })) {
          console.log(payload);
        }

Then I loaded the example at localhost:8080, downloaded one of the options, and observed the log statement in the console

@demiankatz
Copy link
Copy Markdown
Contributor

Thanks, @sarangj. Your implementation makes sense to me, but since I'm not familiar with the existing usage of the download event, I'm not sure if there might be any concerns about adding this functionality (though I suspect there will not be). I'm moving this to the "in testing" column of the community board to encourage others to take a look and try it out; we will likely have time to discuss further at the next Community Call. Please let me know if there's anything else I can do to help in the meantime!

(I see no reason not to approve this, but since I don't currently have time to do hands-on testing, I'm not going to do it just yet -- I'll wait and see what others have to say; but if you need me to take a closer look later to keep things moving forward, just let me know and I'll do my best to assist).

@sarangj
Copy link
Copy Markdown
Contributor Author

sarangj commented Aug 20, 2025

@demiankatz thanks for looking and throwing it on the board! Is the schedule for community calls publicized anywhere? Just want to get a rough sense of a timeline to communicate back with my team!

@demiankatz
Copy link
Copy Markdown
Contributor

@sarangj, the community call generally happens on the first Thursday of the month at 11am Eastern time. You can find this on the IIIF community calendar, though I also recommend following the #community-chat channel of the Universal Viewer Slack, since any rescheduled instances get announced there. As far as I know, the next meeting will take place on the regular schedule on September 4.

@sarangj
Copy link
Copy Markdown
Contributor Author

sarangj commented Aug 20, 2025

@demiankatz got it, thanks!

@LanieOkorodudu
Copy link
Copy Markdown
Collaborator

I can run the test today since I have some time available.

@LanieOkorodudu
Copy link
Copy Markdown
Collaborator

LanieOkorodudu commented Aug 26, 2025

The download option shows up and works as expected when clicked. I also did a quick test in HTML to trigger the event, and the payload logged correctly in the console. Everything seems consistent with the existing behaviour, and I didn’t notice any issues. Thanks @sarangj and @demiankatz

Copy link
Copy Markdown
Contributor

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

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

Thanks, @sarangj and @LanieOkorodudu, I think this should be safe to merge.

@demiankatz demiankatz merged commit 1803ee1 into UniversalViewer:dev Aug 26, 2025
4 checks passed
@github-project-automation github-project-automation bot moved this from In testing to Completed in Universal Viewer Community Board Aug 26, 2025
@sarangj sarangj deleted the download_event branch August 26, 2025 14:27
@sarangj
Copy link
Copy Markdown
Contributor Author

sarangj commented Aug 26, 2025

Thank you both @demiankatz and @LanieOkorodudu !

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

Labels

None yet

Projects

Status: Completed

Development

Successfully merging this pull request may close these issues.

3 participants