Skip to content

Conversation

@yurydelendik
Copy link
Contributor

The dom_utils.js may use global PDFJS to pull values (if the object exists), see getDefaultSetting.

Also, exposed more functions/classes for generic viewer and examples and changed PDFJS object access for these.

Partially addresses #6779

deprecated('PDFJS.openExternalLinksInNewWindow, please use ' +
'"PDFJS.externalLinkTarget = PDFJS.LinkTarget.BLANK" instead.');
}
PDFJS.externalLinkTarget = value ? LinkTarget.BLANK : LinkTarget.NONE;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: It might not matter too much given that we should completely remove PDFJS.openExternalLinksInNewWindow at some point, but note that in the current code setting PDFJS.openExternalLinksInNewWindow = true; is respected if and only if PDFJS.externalLinkTarget === LinkTarget.NONE, and not unconditionally like this (since PDFJS.externalLinkTarget should always take precedence).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

link.target = LinkTargetStringMap[PDFJS.externalLinkTarget];
var target = params.target;
if (typeof target === 'undefined') {
target = getDefaultSetting('externalLinkTarget');
Copy link
Collaborator

Choose a reason for hiding this comment

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

PDFJS.externalLinkTarget is an enumeration value, so LinkTargetStringMap still needs to be used, otherwise link.target isn't set correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

web/viewer.js Outdated
this.pdfSidebar.onToggled = this.forceRendering.bind(this);

var self = this;
var PDFJS = pdfjsLib.PDFJS;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why can't we get rid of this? If we keep it around, we should also use it, e.g. at https://github.com/mozilla/pdf.js/pull/7126/files#diff-dd42e9b2d2a652b8e312efa567698aa6R832

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's used below a lot.

this.commonObjs = new PDFObjects();
this.fontLoader = new FontLoader(loadingTask.docId);
this.fontLoader = new FontLoader(loadingTask.docId, {
isEvalSupported: getDefaultSetting('isEvalSupported'),
Copy link
Collaborator

Choose a reason for hiding this comment

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

In https://github.com/mozilla/pdf.js/pull/7126/files#diff-c0a7c347be94f54892dea2ead8b3df4cR39, there's no parameter that takes this isEvalSupported argument. And as far as I can tell, isEvalSupported is not used within FontLoader, so is this line really necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is not. Reverting the change.

@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

pdfjsbot commented Apr 6, 2016

From: Bot.io (Linux)


Received

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

Live output at: http://107.21.233.14:8877/baa7951d81369ff/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Apr 6, 2016

@timvandermeij
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

pdfjsbot commented Apr 6, 2016

From: Bot.io (Linux)


Received

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

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

@pdfjsbot
Copy link

pdfjsbot commented Apr 6, 2016

From: Bot.io (Windows)


Received

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

Live output at: http://107.22.172.223:8877/ae6fdf2adff0b68/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Apr 6, 2016

From: Bot.io (Windows)


Success

Full output at http://107.22.172.223:8877/ae6fdf2adff0b68/output.txt

Total script time: 20.35 mins

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

@pdfjsbot
Copy link

pdfjsbot commented Apr 6, 2016

From: Bot.io (Linux)


Success

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

Total script time: 22.61 mins

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

@brendandahl brendandahl merged commit 68e8f5f into mozilla:master Apr 7, 2016
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.

5 participants