Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting the html source from the selection #11

Open
davidemora opened this issue Feb 18, 2013 · 7 comments
Open

getting the html source from the selection #11

davidemora opened this issue Feb 18, 2013 · 7 comments

Comments

@davidemora
Copy link

very good work with this library!
Is there a way to get the html source of the highlighted text?

@spdeepa
Copy link

spdeepa commented Mar 18, 2013

I too dont understand how to get the highlighted text from html source? if you know please post the answer.

@btate
Copy link
Owner

btate commented Mar 18, 2013

The highlighted text is being passed in to the app in the javascript interface method selectionChanged(rangyRange, text, handleBounds, menuBounds); If you were going to change the way the selection works i.e. plain text vs html, etc. You would do that in the javascript.

@spdeepa
Copy link

spdeepa commented Mar 19, 2013

Thank you for your response. i am developing epub reader. In this user will select the text with the long press once the action complete. i need to highlight the selected text .i can get the text and rangyRange as 2/9/2:0,0/15/2:734 With the rangy value how can i keep selected text with the highlighten? Can you please help me?

@btate
Copy link
Owner

btate commented Mar 19, 2013

I'm not sure what you're asking.

@spdeepa
Copy link

spdeepa commented Mar 20, 2013

Let me explain in detail. I am developing epub reader which contains html to load in webview. When user long press the text in webview, i nee to hightlight the text where user press and it should ask the option to hightlight. Once user came back to particular point where user selected already it should highlight remains same. As now i can take the selected text and rangy value but i dont know how to hightlight once again when the user comes to particular page where he already highlighted.

@btate
Copy link
Owner

btate commented Mar 20, 2013

You'll have to add some javascript to highlight a given rangy range, then store the rangy range given by the selection process in a database. When the page loads, redo the highlighting and unhighlighting in the order it was originally done.

Or, you could take the html contents of the page after each highlighting action and overwrite your stored file with it.

@spdeepa
Copy link

spdeepa commented Mar 21, 2013

Thanks for your response.

     "When the page loads, redo the highlighting and unhighlighting in the order it was originally done."

I dont know how to proceed the above things in coding. Can you please help me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants