CCA Libraries Bookreader
If you have
npm you can run
npm run demo to open a sample artist book on a Python server running locally. You will need to be signed into VAULT as an account with permission to see the book in order for images to load.
grunt tasks are available:
grunt buildminifies JS, CSS, & copies production files in a "dist" directory
grunt watchwatches the JS, CSS, & index.html files for changes & then builds
Our Customizations live primarily in the js/app.js file, which is based off of bookreader/BookReaderDemo/BookReaderJSAdvanced.js, and in the SCSS files in the "css" directory.
VAULT & File URLs
VAULT interacts with the Bookreader by constructing special links filled with item metadata that tell the Bookreader how to render a particular item's attachments as a book. Here's an example:
I've made the keys italics in the query string and their values bold to highlight what information is passed. Here are the meanings of these fields and how the bookreader uses them:
- title is used to render a link in the upper left & set the
<title>of the page
- id is the VAULT item's UUID
- version is the VAULT item's version
- filenames are the filename prefixes in front of each page number, e.g. for files like "page1.jpg" they would be "page"
- pages is the number of pages (indexed from 1, not 0)
Most of these pieces of information are used to determine what VAULT file URL corresponds to which book page number. The information is parsed out of the URL's query string and serialized in a global
vaultItem object which app.js then uses to set certain configurations for the Open Library Bookreader.