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

Added Element relative Highlighter Range. #367

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Cavva79
Copy link

@Cavva79 Cavva79 commented Jan 15, 2016

Uses a DOM element as doc. This is more failsafe at HTML structure
changes.

Now you can specify a DOM object in which you have to highlight. Highlighter start counting just inside this DOM object and not from the beginning of the page. With TextRange and this feature you can safely highlight and store it for different devices even if you have separate menus for those.

We are using this initialization:

rangy.createHighlighter(document.getElementById("selectableTextContainer"),"TextRange");

Uses a DOM element as doc. This is more failsafe at HTML structure
changes.
@writer0713
Copy link

NAVER - http://www.naver.com/

[email protected] 님께 보내신 메일 <[rangy] Added Element relative Highlighter Range. (#367)> 이 다음과 같은 이유로 전송 실패했습니다.


받는 사람이 회원님의 메일을 수신차단 하였습니다.


Serialize has highlights sorting but Deserialize, added it.
getHighlightPositionForElement it is similar to
getHighlightForElement but return the index of the
highlights array
@e1024kb
Copy link

e1024kb commented Oct 2, 2018

@Cavva79 thanks for your work! I'm going to use your code base.

@Cavva79
Copy link
Author

Cavva79 commented Oct 2, 2018

@ebaranov you are welcome.
I was hoping this pull request merged cause I used in a project where Mobile and Desktop site version had different HTML but the div containing the highlightable text.

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

Successfully merging this pull request may close these issues.

3 participants