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

Add a BasePreferences.getAll method and use it to fetch all Preferences at once in PDFViewerApplication._readPreferences; ensure that the externalLinkTarget option is correctly set when the viewer is embedded #9917

Merged
merged 3 commits into from
Jul 25, 2018

Commits on Jul 25, 2018

  1. Ensure that the externalLinkTarget option is correctly set when the…

    … viewer is embedded (PR 9479 follow-up)
    
    *This was a stupid error on my part; sorry about breaking this!*
    
    With the current code, the value of the `externalLinkTarget` option is now (potentially) updated *after* the viewer components have been initialized. For the "viewer in iframe/object tag" case, the result is that the value of the `externalLinkTarget` option isn't adjusted as intended any more.
    Snuffleupagus committed Jul 25, 2018
    Configuration menu
    Copy the full SHA
    c6a0ae0 View commit details
    Browse the repository at this point in the history
  2. Remove a (now) unnecessary externalLinkTarget check in `PDFViewerAp…

    …plication._readPreferences`
    
    The only reason that this check ever existed in the first place, is that originally there was a global `PDFJS.openExternalLinkInNewWindow` option which was then subsumed by the (more generic) `PDFJS.externalLinkTarget` option. (The `externalLinkTarget` has since been moved into a `PDFLinkService` option, as part of PDF.js version `2.0`.)
    
    Hence, during the period where both `PDFJS.openExternalLinkInNewWindow` and `PDFJS.externalLinkTarget` existed side-by-side, there was a need to allow the former one to override the latter one (for backward compatibility purposes). However, that's no longer the case, and this extra `externalLinkTarget` check can now be removed.
    Snuffleupagus committed Jul 25, 2018
    Configuration menu
    Copy the full SHA
    c3433ae View commit details
    Browse the repository at this point in the history
  3. Add a BasePreferences.getAll method and use it to fetch all Prefere…

    …nces at once in `PDFViewerApplication._readPreferences`
    
    Given that *all* Preferences are already fetched in `PDFViewerApplication._readPreferences`, the amount of boilerplate/duplication can be considerably reduced with the addition of a `BasePreferences.getAll` method.
    Snuffleupagus committed Jul 25, 2018
    Configuration menu
    Copy the full SHA
    34957ec View commit details
    Browse the repository at this point in the history