-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Epub.js demo does not work #4283
Comments
@markjohngraham at IA is inquiring about this wrt to their own Hypothesis implementation. |
From a quick look:
|
These demos are now working again as a result of #3599 and #3611. These are steps in an ongoing overhaul of how different frames in the client communicate. There are remaining issues with what happens when multiple frames have annotation enabled at once - annotations can sometimes show up as orphans even if they aren't. This issue however always existed and needs to be fixed. |
The Epub.js demo at https://web.hypothes.is/demos/epubjs/ is no longer working. The main issue is to do with how the client is configured in the different frames of the viewer and how that affects the first chapter. The Epub.js viewer has two frames - an outer "container" frame and an inner "content" frame. What needs to happen is for the client to load into the outer "container" frame in "host" mode and the inner "content" frame in "guest" mode. See the logic related to You can see the issue if you examine the document URLs in the client's Help panel: The first URL is for the container frame. The second URL is for the content frame. Annotations that should be sent to the content frame get sent to the container frame instead. If you go to a later chapter in the book and make an annotation, things work better, as the content and container frames then have different URLs. In addition to this issue, there is also some other issues that have always existed:
Current example of a payload sent when creating an annotation on a chapter later in the book: {
"created": "2022-03-07T08:50:08.419Z",
"group": "__world__",
"permissions": {
"read": [
"group:__world__"
],
"update": [
"acct:robertknight@hypothes.is"
],
"delete": [
"acct:robertknight@hypothes.is"
]
},
"tags": [],
"text": "Quick test",
"updated": "2022-03-07T08:50:08.419Z",
"user": "acct:robertknight@hypothes.is",
"user_info": {
"display_name": "Robert Knight"
},
"hidden": false,
"links": {},
"document": {
"title": "Moby-Dick",
"link": [
{
"href": "https://cdn.hypothes.is/OPS/chapter_011.xhtml"
},
{
"href": "https://cdn.hypothes.is/demos/epub/epub.js/index.html?loc=chapter_011.xhtml",
"rel": "canonical",
"type": ""
},
{
"href": "urn:x-dc:org.example.hypothesis.demo.epub-samples.moby-dick-basic/xchapter_011"
}
],
"dc": {
"identifier": [
"xchapter_011"
],
"relation.ispartof": [
"org.example.hypothesis.demo.epub-samples.moby-dick-basic"
]
},
"eprints": {},
"facebook": {},
"highwire": {},
"prism": {},
"twitter": {},
"documentFingerprint": "urn:x-dc:org.example.hypothesis.demo.epub-samples.moby-dick-basic/xchapter_011"
},
"uri": "https://cdn.hypothes.is/demos/epub/epub.js/index.html?loc=chapter_011.xhtml",
"target": [
{
"source": "https://cdn.hypothes.is/demos/epub/epub.js/index.html?loc=chapter_011.xhtml",
"selector": [
{
"type": "RangeSelector",
"startContainer": "/section[1]/header[1]/h1[1]",
"startOffset": 0,
"endContainer": "/section[1]/header[1]/h1[1]",
"endOffset": 22
},
{
"type": "TextPositionSelector",
"start": 3,
"end": 25
},
{
"type": "TextQuoteSelector",
"exact": "Chapter 11. Nightgown.",
"prefix": "\n\n\n",
"suffix": "\nWe had lain thus in bed, chatti"
}
]
}
]
} |
Bug report form
Steps to reproduce
Expected behaviour
You should see highlights from existing annotations
You should be able to make an annotation
Clicking the book text should close the sidebar
The text was updated successfully, but these errors were encountered: