Created
October 28, 2009 22:26
-
-
Save mangtronix/220921 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gb = new GnuBook(); | |
gb.getPageWidth = function(index) { | |
return 800; | |
} | |
gb.getPageHeight = function(index) { | |
return 1200; | |
} | |
gb.getPageURI = function(index) { | |
var leafStr = '000'; | |
var imgStr = (index+1).toString(); | |
var re = new RegExp("0{"+imgStr.length+"}$"); | |
var url = 'img/page'+leafStr.replace(re, imgStr) + '.jpg'; | |
return url; | |
} | |
gb.getPageSide = function(index) { | |
if (0 == (index & 0x1)) { | |
return 'R'; | |
} else { | |
return 'L'; | |
} | |
} | |
gb.getPageNum = function(index) { | |
return index+1; | |
} | |
gb.numLeafs = 15; | |
gb.bookTitle= 'Open Library Bookreader Presentation'; | |
gb.bookUrl = 'http://openlibrary.org'; | |
gb.init(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment