-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Refactoring text layer builder and converting text layer builder to a class #4991
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
Refactoring text layer builder and converting text layer builder to a class #4991
Conversation
var textDiv = textDivs[i]; | ||
if ('isWhitespace' in textDiv.dataset) { | ||
if (textDiv.dataset.isWhitespace) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if it matters in this particular instance, but these expressions aren't actually equal. It needs to be: textDiv.dataset.isWhitespace !== undefined
(or textDiv.dataset['isWhitespace'] !== undefined
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it does not matter in this case, but to be sure to not change the viewer's behavior I will change it. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in new commit.
can you refactor it to be in the following format:
After that it's easy step/commit to replace PDFFindController to |
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/3351d620a825bbb/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/3351d620a825bbb/output.txt Total script time: 0.75 mins Published
|
Looks good. Can you see if you can change text-selection example to remove findbar and findcontroller links? |
…oring Refactoring text layer builder and converting text layer builder to a class
Thank you |
This work is needed for cleaning up the text layer and for separating the text layer builder from the PDF find controller. This PR consists of four commits for easier reviewing.
The first commit:
typeof
usage;in
usage;highlightDiv
andappendText
functions asappendText
was just a direct call toappendTextToDiv
andhighlightDiv
has been inlined because in code it is clear what is does, so this saves some function calls.The second commit:
The third commit:
typeof
in this file.The fourth commit: