From c4ffe4ff8fa0dcf09d59f28e8a6cc6ffa5dab65c Mon Sep 17 00:00:00 2001 From: Michael Ang Date: Fri, 17 Sep 2010 23:10:11 +0000 Subject: [PATCH] Override image directory in BookReaderJSSimple.js for the standalone BookReader. Thanks to Michael Howard for the bug report (https://bugs.edge.launchpad.net/bookreader/+bug/641011). Add demo CSS showing how to override the BookReader CSS. Hide print and embed buttons in standalone since they aren't functional. --- BookReader/BookReader.js | 6 +++++- BookReaderDemo/BookReaderDemo.css | 8 ++++++++ BookReaderDemo/BookReaderJSSimple.js | 5 ++++- BookReaderDemo/index.html | 6 +++++- 4 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 BookReaderDemo/BookReaderDemo.css diff --git a/BookReader/BookReader.js b/BookReader/BookReader.js index a7162a2..d0eb83d 100644 --- a/BookReader/BookReader.js +++ b/BookReader/BookReader.js @@ -72,9 +72,13 @@ function BookReader() { this.lastDisplayableIndex2up = null; // We link to index.php to avoid redirect which breaks back button + // Should be overriden (before init) by custom implmentations. this.logoURL = 'http://www.archive.org/index.php'; - // Base URL for images + // Base URL for UI images - should be overriden (before init) by + // custom implementations. + // $$$ This is the same directory as the images referenced by relative + // path in the CSS. Would be better to automagically find that path. this.imagesBaseURL = '/bookreader/images/'; // Mode constants diff --git a/BookReaderDemo/BookReaderDemo.css b/BookReaderDemo/BookReaderDemo.css new file mode 100644 index 0000000..6d88d64 --- /dev/null +++ b/BookReaderDemo/BookReaderDemo.css @@ -0,0 +1,8 @@ +/* + * Custom overrides for BookReader Demo. + */ + +/* Hide print and embed functionality */ +#BRtoolbar .embed, .print { + display: none; +} diff --git a/BookReaderDemo/BookReaderJSSimple.js b/BookReaderDemo/BookReaderJSSimple.js index baa0741..fe3219a 100644 --- a/BookReaderDemo/BookReaderJSSimple.js +++ b/BookReaderDemo/BookReaderJSSimple.js @@ -80,8 +80,11 @@ br.getPageNum = function(index) { br.numLeafs = 15; // Book title and the URL used for the book title link -br.bookTitle= 'Open Library Bookreader Presentation'; +br.bookTitle= 'Open Library BookReader Presentation'; br.bookUrl = 'http://openlibrary.org'; +// Override the path used to find UI images +br.imagesBaseURL = '../BookReader/images/'; + // Let's go! br.init(); diff --git a/BookReaderDemo/index.html b/BookReaderDemo/index.html index 6dcc1da..12932fe 100644 --- a/BookReaderDemo/index.html +++ b/BookReaderDemo/index.html @@ -3,7 +3,11 @@ bookreader demo - + + + + + -- 2.20.1