3d6d396f8524c6278f244a97309b98fd0ab8c79e
[bookreader.git] / BookReaderIA / test / unit / Common.js
1 // Defines common variables for testing
2
3 // $$$ TODO make test host auto-magic
4 common = {
5     // testHost: 'http://www-testflip.archive.org'
6     testHost: 'http://www-mang.archive.org'    
7 }
8
9 // Set up dummy BookReader class for JSLocate
10 function BookReader() {
11 };
12
13 BookReader.prototype.init = function() {
14     return true;
15 };
16
17
18 // Returns locator URL for the given id
19 function jsLocateURL(identifier, book) {
20     var bookURL = common.testHost + '/bookreader/BookReaderJSLocate.php?id=' + identifier;
21     if (book) {
22         bookURL += '&book=' + book;
23     }
24     return bookURL;
25 }
26
27 function previewURL(identifier, bookId, page) {
28     return common.testHost + '/download/' + identifier + '/page/' + bookId + '_' + page + '.jpg';
29 }