1 // Defines common variables for testing
3 // $$$ TODO make test host auto-magic
5 testHost: 'http://www-testflip.archive.org'
6 //testHost: 'http://www-mang.archive.org'
9 // Set up dummy BookReader class for JSLocate
10 function BookReader() {
13 BookReader.prototype.init = function() {
18 // Returns locator URL for the given id
19 function jsLocateURL(identifier, book) {
20 var bookURL = common.testHost + '/bookreader/BookReaderJSLocate.php?id=' + identifier;
22 bookURL += '&book=' + book;
27 // Page should be in ['cover','title','preview']
28 function previewURL(identifier, subPrefix, page) {
29 var bookPrefix = subPrefix || identifier;
30 var previewPage = bookPrefix + '_' + page;
31 return imagePermalink(identifier, subPrefix, previewPage);
34 // Page should be e.g. page5.jpg, n4.jpg, cover_t.jpg, n4_r3.jpg
35 function imagePermalink(identifier, subPrefix, page) {
36 var imageURL = common.testHost + '/download/' + identifier;
38 imageURL += '/' + subPrefix;
40 imageURL += '/page/' + page;