Commit 84867512 authored by Nick Stenning's avatar Nick Stenning

Fix detection of PDF URIs

70c9b9b broke a number of features of the h client that were toggled on
for PDF documents, by renaming the Annotator PDF plugin from
`Annotator.Plugin.PDF` to `Annotator.Plugin.Pdf`.

While it's certainly an ugly side-effect of a straightforward rename,
the problem is that `Guest#getDocumentInfo` (to pick one example) used
`@plugins.PDF?` to determine whether to use the PDF metadata
(provided by the PDF.js `PDFViewerApplication`).

In the absence of PDF metadata, `getDocumentInfo` falls back to using
`window.location.href`, which explains the behaviour identified
in #2506.

Fixes #2506.
parent 87665a80
...@@ -18,7 +18,7 @@ Annotator.Plugin.BucketBar = require('./plugin/bucket-bar'); ...@@ -18,7 +18,7 @@ Annotator.Plugin.BucketBar = require('./plugin/bucket-bar');
Annotator.Plugin.Toolbar = require('./plugin/toolbar'); Annotator.Plugin.Toolbar = require('./plugin/toolbar');
// Document type plugins // Document type plugins
Annotator.Plugin.Pdf = require('./plugin/pdf'); Annotator.Plugin.PDF = require('./plugin/pdf');
require('../vendor/annotator.document'); // Does not export the plugin :( require('../vendor/annotator.document'); // Does not export the plugin :(
// Selection plugins // Selection plugins
......
...@@ -4,7 +4,7 @@ Sidebar = require('./sidebar') ...@@ -4,7 +4,7 @@ Sidebar = require('./sidebar')
module.exports = class PdfSidebar extends Sidebar module.exports = class PdfSidebar extends Sidebar
options: options:
TextSelection: {} TextSelection: {}
Pdf: {} PDF: {}
BucketBar: BucketBar:
container: '.annotator-frame' container: '.annotator-frame'
scrollables: ['#viewerContainer'] scrollables: ['#viewerContainer']
......
...@@ -2,7 +2,7 @@ extend = require('extend') ...@@ -2,7 +2,7 @@ extend = require('extend')
Annotator = require('annotator') Annotator = require('annotator')
module.exports = class Pdf extends Annotator.Plugin module.exports = class PDF extends Annotator.Plugin
documentLoaded: null documentLoaded: null
observer: null observer: null
pdfViewer: null pdfViewer: null
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment