-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Group popup creation code and apply it to more annotation types #7016
Group popup creation code and apply it to more annotation types #7016
Conversation
Maybe Highlight/Underline/Squiggly/StrikeOut annotations should have a common base class? Identical code over four classes is not ideal. |
Now that you brought this up, there are more types that have popups (almost all actually), so I'll update the patch to move most popup handling to the AnnotationElement base class. Thank you! |
295a15c
to
3cd0731
Compare
|
||
this.data.hasPopup = dict.has('Popup'); | ||
this.data.title = stringToPDFString(dict.get('T') || ''); | ||
this.data.contents = stringToPDFString(dict.get('Contents') || ''); |
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.
So, it appears that this code is repeated six times throughout the file. Would it be possible to re-factor into a helper function instead (similar to the other file)?
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.
Yes, I've done that in the new commit.
3f617a4
to
c7e61e3
Compare
this.data.hasPopup = dict.has('Popup'); | ||
this.data.title = stringToPDFString(dict.get('T') || ''); | ||
this.data.contents = stringToPDFString(dict.get('Contents') || ''); | ||
this._preparePopup(dict); |
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.
Nit: I think that you can now remove the variable and simply use parameters.dict
here.
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 the new commit.
c7e61e3
to
ad31e52
Compare
/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/ff467292ebce8cc/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/ff467292ebce8cc/output.txt Total script time: 0.88 mins Published |
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.22.172.223:8877/ca5bc4ff931c980/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/d7bcd5ad30b9474/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/ca5bc4ff931c980/output.txt Total script time: 20.24 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/d7bcd5ad30b9474/output.txt Total script time: 21.79 mins
|
Looks good, and much better with the helper methods added, thank you for the patch! /botio makeref |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.22.172.223:8877/11da4056ff46ac2/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_makeref from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.21.233.14:8877/bd0b7a4f9f19e24/output.txt |
Group popup creation code and apply it to more annotation types
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/11da4056ff46ac2/output.txt Total script time: 20.09 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/bd0b7a4f9f19e24/output.txt Total script time: 21.18 mins
|
Fixes #7014.