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

[api-minor] Let getAnnotations fetch all annotations by default, unless an intent is specified #6675

Merged
merged 1 commit into from
Nov 24, 2015
Merged

[api-minor] Let getAnnotations fetch all annotations by default, unless an intent is specified #6675

merged 1 commit into from
Nov 24, 2015

Conversation

Snuffleupagus
Copy link
Collaborator

Currently getAnnotations will only fetch annotations that are either viewable or printable. This is "hidden" inside the core.js file, meaning that API consumers might be confused as to why they are not recieving all the annotations present for a page.

I thus think that the API should, by default, return all available annotations unless specifically told otherwise. In e.g. the default viewer, we obviously only want to display annotations that are viewable, hence this patch adds an intent parameter to getAnnotations that makes it possible to decide if only viewable or printable annotations should be fetched.

@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/8604db59a6a778d/output.txt

@timvandermeij
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_test from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/5c2bd4b090f4d48/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @timvandermeij received. Current queue size: 0

Live output at: http://107.22.172.223:8877/51363e54897bea7/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://107.22.172.223:8877/51363e54897bea7/output.txt

Total script time: 19.71 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/5c2bd4b090f4d48/output.txt

Total script time: 19.72 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

* Page annotation parameters.
*
* @typedef {Object} GetAnnotationsParameters
* @param {string} intent - Determines which annotations that will be fetched,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: change this to either "Determines the annotations that will be fetched" or "Determines which annotations will be fetched"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@timvandermeij
Copy link
Contributor

Looks good to me with the nit addressed. I'll leave the final review for @yurydelendik or @brendandahl as this is an API change.

…less an intent is specified

Currently `getAnnotations` will *only* fetch annotations that are either `viewable` or `printable`. This is "hidden" inside the `core.js` file, meaning that API consumers might be confused as to why they are not recieving *all* the annotations present for a page.

I thus think that the API should, by default, return *all* available annotations unless specifically told otherwise. In e.g. the default viewer, we obviously only want to display annotations that are `viewable`, hence this patch adds an `intent` parameter to `getAnnotations` that makes it possible to decide if only `viewable` or `printable` annotations should be fetched.
@yurydelendik
Copy link
Contributor

API changes look good. Thanks.

yurydelendik added a commit that referenced this pull request Nov 24, 2015
[api-minor] Let `getAnnotations` fetch all annotations by default, unless an intent is specified
@yurydelendik yurydelendik merged commit 4b243cd into mozilla:master Nov 24, 2015
@Snuffleupagus Snuffleupagus deleted the getAnnotations-intent branch November 24, 2015 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants