mardi 5 avril 2016

What is the best way to serialize - deserialize user elements in epub (html) reader app

We are developing epub reader library. Our users will be able to synchronize their reading (through the server api) on any devices (web browser, android app, ios app etc). And we should support synchronization of user notes, quotations, read positions, bookmarks. We support text size changing also. And we use css columns for book paggination.

Now for serialization we are trying to use timdown/rangy library (TextRange module): http://ift.tt/1VDVLWO to determine text positions relative to book chapter (html body).

But we note:

  • js functions like selectCharacters(Node containerNode, Number startIndex, Number endIndex) works very slowly
  • text-position mismatch after text size changing

We are thinking about using the same rangy functions but relative to nearest dom element (p). But in this case we'll have to identify dom elements each time in some universal for all clients way.

What is the best way to serialize - deserialize user elements in our case ?

Of course, it's our work and so our problems, but we'll be very grateful for your any advice !




Aucun commentaire:

Enregistrer un commentaire