@@ -5,6 +5,13 @@ import { extraVolOptions, custvolumesManifest } from './ia-multiple-volumes-mani
55 * This is how Internet Archive loads bookreader
66 */
77const urlParams = new URLSearchParams ( window . location . search ) ;
8+ function getFromUrl ( name , def ) {
9+ if ( urlParams . has ( name ) ) {
10+ return urlParams . get ( name ) ;
11+ } else {
12+ return def ;
13+ }
14+ }
815
916const ocaid = urlParams . get ( 'ocaid' ) ;
1017const openFullImmersionTheater = urlParams . get ( 'view' ) === 'theater' ;
@@ -41,8 +48,8 @@ const initializeBookReader = (brManifest) => {
4148
4249 const customAutoflipParams = {
4350 autoflip : ! ! autoflip ,
44- flipSpeed : urlParams . flipSpeed || 2000 ,
45- flipDelay : urlParams . flipDelay || 5000
51+ flipSpeed : parseFloat ( getFromUrl ( ' flipSpeed' , ' 2000' ) ) ,
52+ flipDelay : parseFloat ( getFromUrl ( ' flipDelay' , ' 5000' ) ) ,
4653 } ;
4754
4855 const options = {
@@ -62,7 +69,7 @@ const initializeBookReader = (brManifest) => {
6269 initialSearchTerm : searchTerm ? searchTerm : '' ,
6370 // leaving this option commented out bc we change given user agent on archive.org
6471 // onePage: { autofit: <?=json_encode($this->ios ? 'width' : 'auto')?> },
65- showToolbar : false ,
72+ showToolbar : getFromUrl ( 'options.showToolbar' , ' false' ) === 'true' ,
6673 /* Multiple volumes */
6774 // To show multiple volumes:
6875 enableMultipleBooks : false , // turn this on
0 commit comments