How do I load the Monocle Web eBook/ePub Reader without an iFrame?

1k Views Asked by At

I am using the Monocle Web eBook Reader (https://github.com/joseph/monocle & http://monocle.inventivelabs.com.au/) and am looking to add the following functionality to it:

1) Text Highlighting 2) Bookmarks 3) Notes

The main question I have is: How do you load this eBook reader without an iFrame?

The reason I want this is because I want to edit the contents of this iframe to be able to add Highlights, Notes, Bookmarks, etc.

Also "mouseup/click" events are not working on the contents of the iframe... they are working on the other elements monocle plugin is creating but not on the contents of the iframe.

Any help would be appreciated. Thank you for your time!

2

There are 2 best solutions below

0
Suresh Muttagi On

Using Iframe is to make content safer side. For highlighting and other things which u need, you can make use of google's Rangy javascript. Just have some buttons (for highlight) outside the Iframe and whenever user selects a text in iframe and clicks highlight button, call a highlight function from Rangy javascript. https://code.google.com/p/rangy/

the above link will help u.....

0
AbhilashThomas On

As per this

http://test.monoclejs.com/test/selection/index.html

the reader supports selection. Use it with the Magic Panel.

For bookmarks see this:

https://github.com/joseph/Monocle/issues/244