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

Extracts PDFLinkService and PDFHistory APIs #5971

Merged
merged 2 commits into from
May 29, 2015

Conversation

yurydelendik
Copy link
Contributor

Subset of #5947

@timvandermeij
Copy link
Contributor

Returning to the previous position in the document appears to be broken.

Steps to reproduce:

  1. Open http://107.21.233.14:8877/dc48345fcb000e1/web/viewer.html and scroll down.
  2. Refresh the page and notice that the viewer is not restored to the previous position (but at the top).

@timvandermeij timvandermeij added this to the 2015 Q2 milestone Apr 27, 2015
@yurydelendik
Copy link
Contributor Author

@timvandermeij history will work only if the same viewer.html domain is used -- verify with different preview at http://107.21.233.14:8877/ (instead of mozilla.github.io)

if (!PDFViewerApplication.isInitialViewSet) {
PDFViewerApplication.initialBookmark = hash;
} else {
PDFViewerApplication.linkService.setHash(hash);
Copy link
Collaborator

Choose a reason for hiding this comment

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

There's a typo on this line: it should be pdfLinkService instead of linkService.

@Snuffleupagus
Copy link
Collaborator

https://github.com/yurydelendik/pdf.js/blob/refact-hist-link/web/viewer.js#L1170 needs to be changed as well, PDFViewerApplication.parseQueryString -> parseQueryString.

return anchor;
//#endif
//#if (FIREFOX || MOZCENTRAL)
// return this.url.split('#')[0] + anchor;
Copy link
Collaborator

Choose a reason for hiding this comment

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

this.url is undefined in PDFLinkService, so this will not work in the Firefox addon/built-in version (in the current code it points to PDFViewerApplication.url).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, fixed.

# Conflicts:
#	web/viewer.js
# Conflicts:
#	extensions/b2g/viewer.js
#	web/pdf_history.js
#	web/pdf_viewer.component.js
#	web/viewer.js
@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/718b14e544f1721/output.txt

@Snuffleupagus Snuffleupagus self-assigned this May 28, 2015
Snuffleupagus added a commit that referenced this pull request May 29, 2015
Extracts PDFLinkService and PDFHistory APIs
@Snuffleupagus Snuffleupagus merged commit 189ef97 into mozilla:master May 29, 2015
@Snuffleupagus
Copy link
Collaborator

Looks good, thank you for re-factoring this!

@timvandermeij
Copy link
Contributor

Nice work!

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

Successfully merging this pull request may close these issues.

4 participants