readium/readium-shared-js — pull request #11 by JCCR (2014-01-24 19:15:24+00:00)
Title: Annotations refactor & more

The purpose of these changes are to reintroduce annotation functionality to the reader view public API. It was previously removed in order for it to be refactored.

Some new functions were also added to facilitate navigation and visibility checking of elements/spine idrefs and partial CFIs.

Theres also new logic in loading iframes: The need for an error callback is no longer necessary, because in the way it was handled before there was an iframe load callback with a false success flag fired earlier than a true successful iframe callback that took longer to load than the explicitly set 500ms timeout. This is now handled differently by passing a pageRequest to the iframe load function, and passing it back as attachedData to the callback handler. There's new logic that uses this attachedData to keep the similar functionality from before when there was an error callback.

I've also added a new event called CONTENT_DOCUMENT_LOAD_START that triggers when an iframeload is called. This can be used by reader clients to start doing something when a content document begins to load in an iframe.