From: scollett Date: Mon, 16 Nov 2009 18:27:53 +0000 (-0800) Subject: Resolve conflicts with upstream repository X-Git-Url: http://git.rot13.org/?p=bookreader.git;a=commitdiff_plain;h=bd20f0960a8d24bd40949578fdea8b2fa45dab91 Resolve conflicts with upstream repository --- bd20f0960a8d24bd40949578fdea8b2fa45dab91 diff --cc GnuBook/GnuBook.css index 506ae5b,97a1616..839e6d0 --- a/GnuBook/GnuBook.css +++ b/GnuBook/GnuBook.css @@@ -103,8 -91,8 +103,9 @@@ .GBicon.zoom_in { background: url(images/zoom_in_icon.png) no-repeat; } .GBicon.one_page_mode { background: url(images/one_page_mode_icon.png) no-repeat; } .GBicon.two_page_mode { background: url(images/two_page_mode_icon.png) no-repeat; } +.GBicon.thumbnail_mode { background: url(images/thumbnail_mode_icon.png) no-repeat; } .GBicon.embed { background: url(images/embed_icon.png) no-repeat; } + .GBicon.print { background: url(images/print_icon.png) no-repeat; } .GBicon.book_left { background: url(images/book_left_icon.png) no-repeat; } .GBicon.book_right { background: url(images/book_right_icon.png) no-repeat; } .GBicon.book_up { background: url(images/book_up_icon.png) no-repeat; } diff --cc GnuBook/GnuBook.js index 1700035,e620a20..7e2bc6e --- a/GnuBook/GnuBook.js +++ b/GnuBook/GnuBook.js @@@ -1076,47 -909,32 +1092,63 @@@ GnuBook.prototype.jumpToIndex = functio this.flipFwdToIndex(index); } - } else { + } else if (3 == this.mode){ + var viewWidth = $('#GBcontainer').attr('scrollWidth') - 20; // width minus buffer + var i; + var leafWidth = 0; + var leafHeight = 0; + var rightPos = 0; + var bottomPos = 0; + var rowHeight = 0; + var leafTop = 0; + var leafIndex = 0; + + for (i=0; i<(index+1); i++) { + leafWidth = parseInt(this.getPageWidth(i)/this.reduce, 10); + if (rightPos + (leafWidth + this.padding) > viewWidth){ + rightPos = 0; + rowHeight = 0; + leafIndex = 0; + } + leafHeight = parseInt(this.getPageHeight(i)/this.reduce, 10); + if(leafHeight > rowHeight) { rowHeight = leafHeight; } + if (leafIndex==0) { leafTop = bottomPos; } + if (leafIndex==0) { bottomPos += this.padding + rowHeight; } + rightPos += leafWidth + this.padding; + leafIndex++; + } + this.firstIndex=index; + if ($('#GBcontainer').attr('scrollTop') == leafTop) { + this.loadLeafs(); + } else { + $('#GBcontainer').animate({scrollTop: leafTop },'fast'); + } + } else { var i; var leafTop = 0; + var leafLeft = 0; var h; for (i=0; i> 1; + //console.log( 'jumping to ' + leafTop + ' ' + offset); + leafTop += offset; + } + + if (pageX) { + var offset = parseInt( (pageX) / this.reduce); + offset -= $('#GBcontainer').attr('clientWidth') >> 1; + leafLeft += offset; + } + //$('#GBcontainer').attr('scrollTop', leafTop); - $('#GBcontainer').animate({scrollTop: leafTop },'fast'); + $('#GBcontainer').animate({scrollTop: leafTop, scrollLeft: leafLeft },'fast'); } } @@@ -1653,8 -1435,11 +1687,11 @@@ GnuBook.prototype.twoPageSetCursor = fu // Returns the currently active index. GnuBook.prototype.currentIndex = function() { // $$$ we should be cleaner with our idea of which index is active in 1up/2up - if (this.mode == this.constMode1up || this.mode == this.constMode2up || this.mode == this.constModeThumb) { - return this.firstIndex; - if (this.mode == this.constMode1up) { ++ if (this.mode == this.constMode1up || this.mode == this.constModeThumb) { + return this.firstIndex; // $$$ TODO page in center of view would be better + } else if (this.mode == this.constMode2up) { + // Only allow indices that are actually present in book + return GnuBook.util.clamp(this.firstIndex, 0, this.numLeafs - 1); } else { throw 'currentIndex called for unimplemented mode ' + this.mode; } @@@ -2836,16 -2754,28 +3006,29 @@@ GnuBook.prototype.jumpIndexForRightEdge GnuBook.prototype.initToolbar = function(mode, ui) { - $("#GnuBook").append("
" - + "" - + "
"); + $("#GnuBook").append("
" + + "" + + "
" + + "" ++ + "