X-Git-Url: http://git.rot13.org/?p=bookreader.git;a=blobdiff_plain;f=BookReader%2FBookReader.js;h=01baa27b5f9889963284a1cc69bf2654dbe0ae80;hp=617b118a882710e1f2b3b5b441a17e8071d46456;hb=a75777a46cd09dcaea6ef0ac4667b6d4ef6a8f4e;hpb=46ea758b1371228a363e82878022bbe28b670665 diff --git a/BookReader/BookReader.js b/BookReader/BookReader.js index 617b118..01baa27 100644 --- a/BookReader/BookReader.js +++ b/BookReader/BookReader.js @@ -1353,6 +1353,8 @@ BookReader.prototype.switchMode = function(mode) { // this.twoPage.autofit = null; // Take zoom level from other mode this.twoPageCalculateReductionFactors(); this.reduce = this.quantizeReduce(this.reduce, this.twoPage.reductionFactors); + $('button.thumb').show(); + $('button.twopg').hide(); this.prepareTwoPageView(); this.twoPageCenterView(0.5, 0.5); // $$$ TODO preserve center } @@ -2643,9 +2645,6 @@ BookReader.prototype.getPageWidth2UP = function(index) { //______________________________________________________________________________ BookReader.prototype.search = function(term) { //console.log('search called with term=' + term); - - $('#textSrch').blur(); //cause mobile safari to hide the keyboard - var url = 'http://'+this.server.replace(/:.+/, ''); //remove the port and userdir url += '/~edward/inside_jsonp.php?item_id='+this.bookId; url += '&doc='+this.subPrefix; //TODO: test with subitem @@ -3614,27 +3613,25 @@ BookReader.prototype.addChapterFromEntry = function(tocEntryObject) { BookReader.prototype.initToolbar = function(mode, ui) { // $$$mang should be contained within the BookReader div instead of body - - var readIcon = ''; + var readIcon = '' if (!navigator.userAgent.match(/mobile/i)) { readIcon = ""; } - + $("body").append( "
" + "" /* XXXmang integrate search */ - + "
" + + "
" // XXXmang icons incorrect or handlers wrong - + "" - + "" + "" + "" + readIcon - //+ "" + + "" + "
" + "" + "Back to" + this.bookTitle + "" + + "
" + "
" /* + "
" @@ -3650,8 +3647,6 @@ BookReader.prototype.initToolbar = function(mode, ui) { */ ); - $('#BRtoolbar .pause').hide(); - this.updateToolbarZoom(this.reduce); // Pretty format if (ui == "embed" || ui == "touch") { @@ -3678,7 +3673,7 @@ BookReader.prototype.initToolbar = function(mode, ui) { '.embed': 'Embed BookReader', '.link': 'Link to this book (and page)', '.bookmark': 'Bookmark this page', - '.read': 'Read this book aloud', + '.read': 'Allow BookReader to read this aloud', '.full': 'Show fullscreen', '.book_left': 'Flip left', '.book_right': 'Flip right', @@ -3888,11 +3883,9 @@ BookReader.prototype.bindNavigationHandlers = function() { }); // XXX fix integration - // XXX Mobile safari was not picking up this handler, so - // I explictly set the form action in initToolbar() - // $('#booksearch').bind('submit', function() { - // self.search($('#textSrch').val()); - // }); + $('#booksearch').bind('submit', function() { + self.search($('#textSrch').val()); + }); this.initSwipeData(); $('#BookReader').die('mousemove.navigation').live('mousemove.navigation', @@ -4663,14 +4656,13 @@ BookReader.prototype.ttsStartCB = function (data) { // showProgressPopup //______________________________________________________________________________ BookReader.prototype.showProgressPopup = function(msg) { + if (soundManager.debugMode) console.log('showProgressPopup index='+this.ttsIndex+' pos='+this.ttsPosition); if (this.popup) return; this.popup = document.createElement("div"); $(this.popup).css({ top: ($('#BookReader').height()*0.5-100) + 'px', - left: ($('#BookReader').width()-300)*0.5 + 'px', - width: '300px', - border: '2px solid black' + left: ($('#BookReader').width()-300)*0.5 + 'px' }).attr('className', 'BRprogresspopup'); var bar = document.createElement("div"); @@ -4991,22 +4983,28 @@ BookReader.prototype.ttsStartPolling = function () { },3000); }; $().ready(function(){ - $('#BRtoolbar').animate({top:0},3000).animate({top:-40}); - $('#BRnav').animate({bottom:0},3000).animate({bottom:-53}); + /* + $('#BRtoolbar').delay(3000).animate({top:-40}); + $('#BRnav').delay(3000).animate({bottom:-53}); changeArrow(); - $('.BRnavCntl').animate({opacity:1},3000).animate({height:'43px'}).animate({opacity:1},1000).animate({opacity:.25},1000); + $('.BRnavCntl').delay(3000).animate({height:'43px'}).delay(1000).animate({opacity:.25},1000); + */ $('.BRnavCntl').click( function(){ if ($('#BRnavCntlBtm').hasClass('BRdn')) { $('#BRtoolbar').animate({top:-40}); - $('#BRnav').animate({bottom:-53}); + $('#BRnav').animate({bottom:-55}); $('#BRnavCntlBtm').addClass('BRup').removeClass('BRdn'); - $('.BRnavCntl').animate({height:'43px'}).animate({opacity:1},1000).animate({opacity:.25},1000); + $('#BRnavCntlTop').addClass('BRdn').removeClass('BRup'); + $('#BRnavCntlBtm.BRnavCntl').animate({height:'45px'}); + $('.BRnavCntl').delay(1000).animate({opacity:.25},1000); } else { $('#BRtoolbar').animate({top:0}); $('#BRnav').animate({bottom:0}); $('#BRnavCntlBtm').addClass('BRdn').removeClass('BRup'); - $('.BRnavCntl').animate({opacity:1,height:'30px'}); + $('#BRnavCntlTop').addClass('BRup').removeClass('BRdn'); + $('#BRnavCntlBtm.BRnavCntl').animate({height:'30px'}); + $('.BRvavCntl').animate({opacity:1}) }; } ); @@ -5020,5 +5018,14 @@ BookReader.prototype.ttsStartPolling = function () { $('.BRnavCntl').animate({opacity:.25},250); }; }); + $('#BRnavCntlTop').mouseover(function(){ + if ($(this).hasClass('BRdn')) { + $('.BRnavCntl').animate({opacity:1},250); + }; + }); + $('#BRnavCntlTop').mouseleave(function(){ + if ($(this).hasClass('BRdn')) { + $('.BRnavCntl').animate({opacity:.25},250); + }; + }); }); -