Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 04-02-2012, 06:02 PM   #1
dhunter
Junior Member
dhunter began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Mar 2012
Device: none
viewer questions

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?
dhunter is offline   Reply With Quote
Old 04-03-2012, 12:39 AM   #2
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 6,090
Karma: 6238033
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo Touch, Kobo Glo
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.
davidfor is offline   Reply With Quote
Old 04-03-2012, 01:09 AM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,463
Karma: 5383257
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
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.
kovidgoyal is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Kindle Touch] No Image viewer and pdf viewer with white margins MaxPowerITA Kindle Developer's Corner 7 04-24-2012 06:27 AM
[old-topic]ebook-viewer: Open source, crossplatform viewer for EPUB, LIT, MOBI, etc kovidgoyal Calibre 68 05-30-2011 09:46 PM
E-Book Viewer as standalone viewer Peter Swallow Library Management 3 05-15-2011 01:06 PM
# user css for viewer.py/ ebook-viewer/ prs-650 tscamera Calibre 0 01-02-2011 07:28 PM
Ebook Viewer formatting questions danwdoo Calibre 2 03-19-2009 10:06 PM


All times are GMT -4. The time now is 12:36 PM.


MobileRead.com is a privately owned, operated and funded community.