@@ -47,11 +47,11 @@ var PDFViewerApplication = {
4747 * @returns {Promise } - Returns the promise, which is resolved when document
4848 * is opened.
4949 */
50- open : function ( params ) {
50+ open : function ( params ) {
5151 if ( this . pdfLoadingTask ) {
5252 // We need to destroy already opened document
5353 return this . close ( ) . then (
54- function ( ) {
54+ function ( ) {
5555 // ... and repeat the open() call.
5656 return this . open ( params ) ;
5757 } . bind ( this )
@@ -71,12 +71,12 @@ var PDFViewerApplication = {
7171 } ) ;
7272 this . pdfLoadingTask = loadingTask ;
7373
74- loadingTask . onProgress = function ( progressData ) {
74+ loadingTask . onProgress = function ( progressData ) {
7575 self . progress ( progressData . loaded / progressData . total ) ;
7676 } ;
7777
7878 return loadingTask . promise . then (
79- function ( pdfDocument ) {
79+ function ( pdfDocument ) {
8080 // Document loaded, specifying document for the viewer.
8181 self . pdfDocument = pdfDocument ;
8282 self . pdfViewer . setDocument ( pdfDocument ) ;
@@ -86,7 +86,7 @@ var PDFViewerApplication = {
8686 self . loadingBar . hide ( ) ;
8787 self . setTitleUsingMetadata ( pdfDocument ) ;
8888 } ,
89- function ( exception ) {
89+ function ( exception ) {
9090 var message = exception && exception . message ;
9191 var l10n = self . l10n ;
9292 var loadingErrorMessage ;
@@ -119,7 +119,7 @@ var PDFViewerApplication = {
119119 ) ;
120120 }
121121
122- loadingErrorMessage . then ( function ( msg ) {
122+ loadingErrorMessage . then ( function ( msg ) {
123123 self . error ( msg , { message : message } ) ;
124124 } ) ;
125125 self . loadingBar . hide ( ) ;
@@ -132,7 +132,7 @@ var PDFViewerApplication = {
132132 * @returns {Promise } - Returns the promise, which is resolved when all
133133 * destruction is completed.
134134 */
135- close : function ( ) {
135+ close : function ( ) {
136136 var errorWrapper = document . getElementById ( "errorWrapper" ) ;
137137 errorWrapper . setAttribute ( "hidden" , "true" ) ;
138138
@@ -175,9 +175,9 @@ var PDFViewerApplication = {
175175 this . setTitle ( title ) ;
176176 } ,
177177
178- setTitleUsingMetadata : function ( pdfDocument ) {
178+ setTitleUsingMetadata : function ( pdfDocument ) {
179179 var self = this ;
180- pdfDocument . getMetadata ( ) . then ( function ( data ) {
180+ pdfDocument . getMetadata ( ) . then ( function ( data ) {
181181 var info = data . info ,
182182 metadata = data . metadata ;
183183 self . documentInfo = info ;
@@ -275,27 +275,27 @@ var PDFViewerApplication = {
275275 errorMessage . textContent = message ;
276276
277277 var closeButton = document . getElementById ( "errorClose" ) ;
278- closeButton . onclick = function ( ) {
278+ closeButton . onclick = function ( ) {
279279 errorWrapper . setAttribute ( "hidden" , "true" ) ;
280280 } ;
281281
282282 var errorMoreInfo = document . getElementById ( "errorMoreInfo" ) ;
283283 var moreInfoButton = document . getElementById ( "errorShowMore" ) ;
284284 var lessInfoButton = document . getElementById ( "errorShowLess" ) ;
285- moreInfoButton . onclick = function ( ) {
285+ moreInfoButton . onclick = function ( ) {
286286 errorMoreInfo . removeAttribute ( "hidden" ) ;
287287 moreInfoButton . setAttribute ( "hidden" , "true" ) ;
288288 lessInfoButton . removeAttribute ( "hidden" ) ;
289289 errorMoreInfo . style . height = errorMoreInfo . scrollHeight + "px" ;
290290 } ;
291- lessInfoButton . onclick = function ( ) {
291+ lessInfoButton . onclick = function ( ) {
292292 errorMoreInfo . setAttribute ( "hidden" , "true" ) ;
293293 moreInfoButton . removeAttribute ( "hidden" ) ;
294294 lessInfoButton . setAttribute ( "hidden" , "true" ) ;
295295 } ;
296296 moreInfoButton . removeAttribute ( "hidden" ) ;
297297 lessInfoButton . setAttribute ( "hidden" , "true" ) ;
298- Promise . all ( moreInfoText ) . then ( function ( parts ) {
298+ Promise . all ( moreInfoText ) . then ( function ( parts ) {
299299 errorMoreInfo . value = parts . join ( "\n" ) ;
300300 } ) ;
301301 } ,
@@ -369,29 +369,31 @@ var PDFViewerApplication = {
369369 } ) ;
370370 linkService . setHistory ( this . pdfHistory ) ;
371371
372- document . getElementById ( "previous" ) . addEventListener ( "click" , function ( ) {
372+ document . getElementById ( "previous" ) . addEventListener ( "click" , function ( ) {
373373 PDFViewerApplication . page -- ;
374374 } ) ;
375375
376- document . getElementById ( "next" ) . addEventListener ( "click" , function ( ) {
376+ document . getElementById ( "next" ) . addEventListener ( "click" , function ( ) {
377377 PDFViewerApplication . page ++ ;
378378 } ) ;
379379
380- document . getElementById ( "zoomIn" ) . addEventListener ( "click" , function ( ) {
380+ document . getElementById ( "zoomIn" ) . addEventListener ( "click" , function ( ) {
381381 PDFViewerApplication . zoomIn ( ) ;
382382 } ) ;
383383
384- document . getElementById ( "zoomOut" ) . addEventListener ( "click" , function ( ) {
384+ document . getElementById ( "zoomOut" ) . addEventListener ( "click" , function ( ) {
385385 PDFViewerApplication . zoomOut ( ) ;
386386 } ) ;
387387
388- document . getElementById ( "pageNumber" ) . addEventListener ( "click" , function ( ) {
389- this . select ( ) ;
390- } ) ;
388+ document
389+ . getElementById ( "pageNumber" )
390+ . addEventListener ( "click" , function ( ) {
391+ this . select ( ) ;
392+ } ) ;
391393
392394 document
393395 . getElementById ( "pageNumber" )
394- . addEventListener ( "change" , function ( ) {
396+ . addEventListener ( "change" , function ( ) {
395397 PDFViewerApplication . page = this . value | 0 ;
396398
397399 // Ensure that the page number input displays the correct value,
@@ -402,14 +404,14 @@ var PDFViewerApplication = {
402404 }
403405 } ) ;
404406
405- eventBus . on ( "pagesinit" , function ( ) {
407+ eventBus . on ( "pagesinit" , function ( ) {
406408 // We can use pdfViewer now, e.g. let's change default scale.
407409 pdfViewer . currentScaleValue = DEFAULT_SCALE_VALUE ;
408410 } ) ;
409411
410412 eventBus . on (
411413 "pagechanging" ,
412- function ( evt ) {
414+ function ( evt ) {
413415 var page = evt . pageNumber ;
414416 var numPages = PDFViewerApplication . pagesCount ;
415417
@@ -424,7 +426,7 @@ var PDFViewerApplication = {
424426
425427document . addEventListener (
426428 "DOMContentLoaded" ,
427- function ( ) {
429+ function ( ) {
428430 PDFViewerApplication . initUI ( ) ;
429431 } ,
430432 true
@@ -433,13 +435,15 @@ document.addEventListener(
433435( function animationStartedClosure ( ) {
434436 // The offsetParent is not set until the PDF.js iframe or object is visible.
435437 // Waiting for first animation.
436- PDFViewerApplication . animationStartedPromise = new Promise ( function ( resolve ) {
438+ PDFViewerApplication . animationStartedPromise = new Promise ( function (
439+ resolve
440+ ) {
437441 window . requestAnimationFrame ( resolve ) ;
438442 } ) ;
439443} ) ( ) ;
440444
441445// We need to delay opening until all HTML is loaded.
442- PDFViewerApplication . animationStartedPromise . then ( function ( ) {
446+ PDFViewerApplication . animationStartedPromise . then ( function ( ) {
443447 PDFViewerApplication . open ( {
444448 url : DEFAULT_URL ,
445449 } ) ;
0 commit comments