// reset the bottom position based on thumbnails
$('#BRpageview').height(bottomPos);
- var pageViewBuffer = Math.floor(($('#BRcontainer').attr('scrollWidth') - maxRight) / 2) - 14;
+ var pageViewBuffer = Math.floor(($('#BRcontainer').attr('scrollWidth') - maxRight) / 2) - 14;
var scrollTop = $('#BRcontainer').attr('scrollTop');
var scrollBottom = scrollTop + $('#BRcontainer').height();
div = document.createElement("div");
div.id = 'pagediv'+leaf;
div.style.position = "absolute";
- div.className = "BRpagedivthumb";
+ div.className = "BRpagedivthumb";
left += this.padding;
$(div).css('top', leafTop + 'px');
//$(div).text('loading...');
// link to page in single page mode
+ // $$$ direct JS calls instead should reduce visual disruption
link = document.createElement("a");
link.href = '#page/' + (this.getPageNum(leaf)) +'/mode/1up' ;
$(div).append(link);
$('#BRpageview').append(div);
img = document.createElement("img");
- img.src = this.getPageURI(leaf);
+ var thumbReduce = Math.floor(this.getPageWidth(leaf) / this.thumbWidth);
+ img.src = this._getPageURI(leaf, thumbReduce);
$(img).css('width', leafWidth+'px');
$(img).css('height', leafHeight+'px');
img.style.border = "0";
this.flipFwdToIndex(index);
}
- } else if (3 == this.mode){
+ } else if (3 == this.mode) {
var viewWidth = $('#BRcontainer').attr('scrollWidth') - 20; // width minus buffer
var i;
var leafWidth = 0;
this.resizePageView();
- this.displayedRows = [];
+ this.displayedRows = [];
this.drawLeafsThumbnail();
// Bind mouse handlers
this.jumpToIndex(this.lastDisplayableIndex());
}
+// scrollDown()
+//______________________________________________________________________________
+// Scrolls down one screen view
+BookReader.prototype.scrollDown = function() {
+ if ($.inArray(this.mode, [this.constMode2up, this.constModeThumb])) {
+ $('#BRcontainer').animate(
+ { scrollTop: '+=' + $('#BRcontainer').height() * 0.95 + 'px'},
+ 450, 'easeInOutQuint'
+ );
+ return true;
+ } else {
+ return false;
+ }
+}
+
+// scrollUp()
+//______________________________________________________________________________
+// Scrolls up one screen view
+BookReader.prototype.scrollUp = function() {
+ if ($.inArray(this.mode, [this.constMode2up, this.constModeThumb])) {
+ $('#BRcontainer').animate(
+ { scrollTop: '-=' + $('#BRcontainer').height() * 0.95 + 'px'},
+ 450, 'easeInOutQuint'
+ );
+ return true;
+ } else {
+ return false;
+ }
+}
+
+
// flipBackToIndex()
//______________________________________________________________________________
// to flip back one spread, pass index=null
//console.log(pages[i].getAttribute('file').substr(1) +'-'+ parseInt(pages[i].getAttribute('file').substr(1), 10));
- var re = new RegExp (/_(\d{4})/);
+ var re = new RegExp (/_(\d{4})\.djvu/);
var reMatch = re.exec(pages[i].getAttribute('file'));
var index = parseInt(reMatch[1], 10);
//var index = parseInt(pages[i].getAttribute('file').substr(1), 10);
+ "<form class='BRpageform' action='javascript:' onsubmit='br.jumpToPage(this.elements[0].value)'> <span class='label'>Page:<input id='BRpagenum' type='text' size='3' onfocus='br.autoStop();'></input></span></form>"
+ "<div class='BRtoolbarmode2' style='display: none'><button class='BRicon rollover book_leftmost' /><button class='BRicon rollover book_left' /><button class='BRicon rollover book_right' /><button class='BRicon rollover book_rightmost' /></div>"
+ "<div class='BRtoolbarmode1' style='display: none'><button class='BRicon rollover book_top' /><button class='BRicon rollover book_up' /> <button class='BRicon rollover book_down' /><button class='BRicon rollover book_bottom' /></div>"
+ + "<div class='BRtoolbarmode3' style='display: none'><button class='BRicon rollover book_top' /><button class='BRicon rollover book_up' /> <button class='BRicon rollover book_down' /><button class='BRicon rollover book_bottom' /></div>"
+ "<button class='BRicon rollover play' /><button class='BRicon rollover pause' style='display: none' />"
+ "</span>"
});
jToolbar.find('.book_up').bind('click', function(e) {
- self.prev();
+ if ($.inArray(self.mode, [self.constMode2up, self.constModeThumb])) {
+ self.scrollUp();
+ } else {
+ self.prev();
+ }
return false;
});
jToolbar.find('.book_down').bind('click', function(e) {
- self.next();
+ if ($.inArray(self.mode, [self.constMode2up, self.constModeThumb])) {
+ self.scrollDown();
+ } else {
+ self.next();
+ }
return false;
});
if ('undefined' == typeof(reduce)) {
// reduce not passed in
+ // $$$ this probably won't work for thumbnail mode
var ratio = this.getPageHeight(index) / this.twoPage.height;
var scale;
// $$$ we make an assumption here that the scales are available pow2 (like kakadu)