@@ -4,11 +4,6 @@ import { clamp } from './utils.js';
44/** @typedef {import('./options.js').PageData } PageData */
55/** @typedef {import('../BookReader.js').default } BookReader */
66
7- // URI to display when a page is not viewable.
8- // TODO Render configurable html for the user instead.
9- // FIXME Don't reference files on archive.org
10- const UNVIEWABLE_PAGE_URI = '/bookreader/static/preview-default.png' ;
11-
127/**
138 * Contains information about the Book/Document independent of the way it is
149 * being rendering. Nothing here should reference e.g. the mode, zoom, etc.
@@ -160,7 +155,17 @@ export class BookModel {
160155 */
161156 // eslint-disable-next-line no-unused-vars
162157 getPageURI ( index , reduce , rotate ) {
163- return ! this . getPageProp ( index , 'viewable' , true ) ? UNVIEWABLE_PAGE_URI : this . getPageProp ( index , 'uri' ) ;
158+ if ( ! this . getPageProp ( index , 'viewable' , true ) ) {
159+ const uri = this . br . options . unviewablePageURI ;
160+ if ( uri . startsWith ( '.' ) ) {
161+ // It's a relative path, so make it relative to the images path
162+ return this . br . options . imagesBaseURL + uri ;
163+ } else {
164+ return uri ;
165+ }
166+ } else {
167+ return this . getPageProp ( index , 'uri' ) ;
168+ }
164169 }
165170
166171 /**
0 commit comments