diff --git a/bower.json b/bower.json index 227e58987..042871b04 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.1.280", + "version": "1.1.284", "main": [ "build/pdf.js", "build/pdf.worker.js" diff --git a/build/pdf.combined.js b/build/pdf.combined.js index 366d0e9f5..8f08832b0 100644 --- a/build/pdf.combined.js +++ b/build/pdf.combined.js @@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.1.280'; -PDFJS.build = '7d4303b'; +PDFJS.version = '1.1.284'; +PDFJS.build = '535b7c2'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it diff --git a/build/pdf.js b/build/pdf.js index 57031872a..29500badd 100644 --- a/build/pdf.js +++ b/build/pdf.js @@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.1.280'; -PDFJS.build = '7d4303b'; +PDFJS.version = '1.1.284'; +PDFJS.build = '535b7c2'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it diff --git a/build/pdf.worker.js b/build/pdf.worker.js index 442d1f5e4..2d704de5a 100644 --- a/build/pdf.worker.js +++ b/build/pdf.worker.js @@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.1.280'; -PDFJS.build = '7d4303b'; +PDFJS.version = '1.1.284'; +PDFJS.build = '535b7c2'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it diff --git a/package.json b/package.json index 61423a3bf..a5106daed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.1.280", + "version": "1.1.284", "description": "Generic build of Mozilla's PDF.js library.", "keywords": [ "Mozilla", diff --git a/web/pdf_viewer.css b/web/pdf_viewer.css index e5671e4f0..592583b92 100644 --- a/web/pdf_viewer.css +++ b/web/pdf_viewer.css @@ -62,6 +62,58 @@ .textLayer ::selection { background: rgb(0,0,255); } .textLayer ::-moz-selection { background: rgb(0,0,255); } + +.annotationLayer .annotLink > a:hover { + opacity: 0.2; + background: #ff0; + box-shadow: 0px 2px 10px #ff0; +} + +.annotationLayer .annotText > img { + position: absolute; + cursor: pointer; +} + +.annotationLayer .annotTextContentWrapper { + position: absolute; + width: 20em; +} + +.annotationLayer .annotTextContent { + z-index: 200; + float: left; + max-width: 20em; + background-color: #FFFF99; + box-shadow: 0px 2px 5px #333; + border-radius: 2px; + padding: 0.6em; + cursor: pointer; +} + +.annotationLayer .annotTextContent > h1 { + font-size: 1em; + border-bottom: 1px solid #000000; + padding-bottom: 0.2em; +} + +.annotationLayer .annotTextContent > p { + padding-top: 0.2em; +} + +.annotationLayer .annotLink > a { + position: absolute; + font-size: 1em; + top: 0; + left: 0; + width: 100%; + height: 100%; +} + +.annotationLayer .annotLink > a /* -ms-a */ { + background: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAA\ + LAAAAAABAAEAAAIBRAA7") 0 0 repeat; +} + .pdfViewer .canvasWrapper { overflow: hidden; } @@ -99,12 +151,6 @@ background: url('images/loading-icon.gif') center no-repeat; } -.pdfViewer .page .annotLink > a:hover { - opacity: 0.2; - background: #ff0; - box-shadow: 0px 2px 10px #ff0; -} - .pdfPresentationMode:-webkit-full-screen .pdfViewer .page { margin-bottom: 100%; border: 0; @@ -124,48 +170,3 @@ margin-bottom: 100%; border: 0; } - -.pdfViewer .page .annotText > img { - position: absolute; - cursor: pointer; -} - -.pdfViewer .page .annotTextContentWrapper { - position: absolute; - width: 20em; -} - -.pdfViewer .page .annotTextContent { - z-index: 200; - float: left; - max-width: 20em; - background-color: #FFFF99; - box-shadow: 0px 2px 5px #333; - border-radius: 2px; - padding: 0.6em; - cursor: pointer; -} - -.pdfViewer .page .annotTextContent > h1 { - font-size: 1em; - border-bottom: 1px solid #000000; - padding-bottom: 0.2em; -} - -.pdfViewer .page .annotTextContent > p { - padding-top: 0.2em; -} - -.pdfViewer .page .annotLink > a { - position: absolute; - font-size: 1em; - top: 0; - left: 0; - width: 100%; - height: 100%; -} - -.pdfViewer .page .annotLink > a /* -ms-a */ { - background: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAA\ - LAAAAAABAAEAAAIBRAA7") 0 0 repeat; -} diff --git a/web/pdf_viewer.js b/web/pdf_viewer.js index e8022e503..3dc049ce2 100644 --- a/web/pdf_viewer.js +++ b/web/pdf_viewer.js @@ -1962,7 +1962,8 @@ DefaultAnnotationsLayerFactory.prototype = { createAnnotationsLayerBuilder: function (pageDiv, pdfPage) { return new AnnotationsLayerBuilder({ pageDiv: pageDiv, - pdfPage: pdfPage + pdfPage: pdfPage, + linkService: new SimpleLinkService(), }); } }; @@ -2024,7 +2025,7 @@ var PDFViewer = (function pdfViewer() { function PDFViewer(options) { this.container = options.container; this.viewer = options.viewer || options.container.firstElementChild; - this.linkService = options.linkService || new SimpleLinkService(this); + this.linkService = options.linkService || new SimpleLinkService(); this.removePageBorders = options.removePageBorders || false; this.defaultRenderingQueue = !options.renderingQueue; @@ -2399,14 +2400,14 @@ var PDFViewer = (function pdfViewer() { var pageView = this._pages[pageNumber - 1]; if (this.isInPresentationMode) { - if (this.linkService.page !== pageView.id) { + if (this._currentPageNumber !== pageView.id) { // Avoid breaking getVisiblePages in presentation mode. - this.linkService.page = pageView.id; + this.currentPageNumber = pageView.id; return; } dest = null; // Fixes the case when PDF has different page sizes. - this._setScale(this.currentScaleValue, true); + this._setScale(this._currentScaleValue, true); } if (!dest) { scrollIntoView(pageView.div); @@ -2454,13 +2455,12 @@ var PDFViewer = (function pdfViewer() { y = dest[3]; width = dest[4] - x; height = dest[5] - y; - var viewerContainer = this.container; var hPadding = this.removePageBorders ? 0 : SCROLLBAR_PADDING; var vPadding = this.removePageBorders ? 0 : VERTICAL_PADDING; - widthScale = (viewerContainer.clientWidth - hPadding) / + widthScale = (this.container.clientWidth - hPadding) / width / CSS_UNITS; - heightScale = (viewerContainer.clientHeight - vPadding) / + heightScale = (this.container.clientHeight - vPadding) / height / CSS_UNITS; scale = Math.min(Math.abs(widthScale), Math.abs(heightScale)); break; @@ -2689,22 +2689,19 @@ var PDFViewer = (function pdfViewer() { })(); var SimpleLinkService = (function SimpleLinkServiceClosure() { - function SimpleLinkService(pdfViewer) { - this.pdfViewer = pdfViewer; - } + function SimpleLinkService() {} + SimpleLinkService.prototype = { /** * @returns {number} */ get page() { - return this.pdfViewer.currentPageNumber; + return 0; }, /** * @param {number} value */ - set page(value) { - this.pdfViewer.currentPageNumber = value; - }, + set page(value) {}, /** * @param dest - The PDF destination object. */