dbmdz / mirador-textoverlay

Text Overlay plugin for Mirador 3
https://mirador-textoverlay.netlify.com/
MIT License
50 stars 14 forks source link

Support for IIIF Presentation API 3.0 #224

Open joesong168 opened 2 years ago

joesong168 commented 2 years ago

Based on sauterl's work. Passed test for following kind of annotation.

{
            "id": `${this.baseUrl}/c/3/${canvasUuid}/ap/c/a/${annoUuid}`,
            "type": "Annotation",
            "motivation": "supplementing",
            "body": {
                "type": "TextualBody",
                "value": comment,
                "format": "text/plain",
                "language": "zh-Hants"
            },
            "target": `${this.baseUrl}/c/3/${canvasUuid}#${fragmentSelector}`,
}

Although not sure what following code means in hasExternalResourceV3

Object.keys(anno.body).length === 1 
jbaiter commented 2 years ago

Thank you for the PR! And sorry it took so long to review :-(

A few things in addition to the line-comments:

As for the length-check on the body, I think the purpose is to check if the resource needs to be fetched from an external URI (in this case the body has a single key, id with the URI).