View Full Version : viewer questions


dhunter
04-02-2012, 05:02 PM
Is it possible to get the position or the reference (paragraph number) of a book's selectedText?

Also, is it possible to get the text of the paragraph that the selectedText is located within?

Also, i'd like to be able to highlight the selectedText in a different color, and have that persist while the book is open. My assumption is that i would have to insert a <span></span> around the selectedText. Would this be something I'd do via Qt or javascript?

davidfor
04-02-2012, 11:39 PM
An indirect answer to your question...

The viewer has a "Reference Mode" that can be turned on with the icon that looks like a tin of paint. When it is on and you put the cursor over a paragraph, it highlights the text and then displays a hint with the paragraph number. The code behind that should answer part of your question.

kovidgoyal
04-03-2012, 12:09 AM
Alll these things are possible using javascript, just google for how to do them and you will find plenty of hints. And you can change selection color using a special selection CSS selector, again googling will tell you how.