var img = document.createElement("img");
img.src = this._getPageURI(index, this.reduce, 0);
+ $(img).addClass('BRnoselect');
$(img).css('width', width+'px');
$(img).css('height', height+'px');
$(div).append(img);
$(this.twoPage.coverDiv).attr('id', 'BRbookcover').css({
width: this.twoPage.bookCoverDivWidth + 'px',
height: this.twoPage.bookCoverDivHeight+'px',
- visibility: 'visible',
+ visibility: 'visible'
}).appendTo('#BRtwopageview');
this.leafEdgeR = document.createElement('div');
BookReader.prototype.search = function(term) {
//console.log('search called with term=' + term);
- $('#textSrch').blur(); //cause mobile safari to hide the keyboard
+ $('#textSrch').blur(); //cause mobile safari to hide the keyboard
var url = 'http://'+this.server.replace(/:.+/, ''); //remove the port and userdir
url += '/fulltext/inside.php?item_id='+this.bookId;
var i, j;
for (i=0; i<results.matches.length; i++) {
//console.log(results.matches[i].par[0]);
+ //TODO: loop over all par objects
+ var pageIndex = this.leafNumToIndex(results.matches[i].par[0].page);
for (j=0; j<results.matches[i].par[0].boxes.length; j++) {
var box = results.matches[i].par[0].boxes[j];
- var pageIndex = this.leafNumToIndex(box.page);
if (jQuery.inArray(pageIndex, this.displayedIndices) >= 0) {
if (null == box.div) {
//create a div for the search highlight, and stash it in the box object
//______________________________________________________________________________
BookReader.prototype.autoToggle = function() {
+ this.ttsStop();
+
var bComingFrom1up = false;
if (2 != this.mode) {
bComingFrom1up = true;
shadow: false
})
.hover( function() {
+ // remove from other markers then turn on just for this
+ // XXX should be done when nav slider moves
+ $('.search,.chapter').removeClass('front');
$(this).addClass('front');
}, function() {
$(this).removeClass('front');
shadow: false
})
.hover( function() {
+ // remove hover effect from other markers then turn on just for this
+ $('.search,.chapter').removeClass('front');
$(this).addClass('front');
}, function() {
$(this).removeClass('front');
BookReader.prototype.initToolbar = function(mode, ui) {
// $$$mang should be contained within the BookReader div instead of body
-
var readIcon = '';
if (!navigator.userAgent.match(/mobile/i)) {
readIcon = "<button class='BRicon read modal'></button>";
}
-
+
$("body").append(
"<div id='BRtoolbar'>"
+ "<span id='BRtoolbarbuttons'>"
/* XXXmang integrate search */
+ "<form action='javascript:br.search($(\"#textSrch\").val());' id='booksearch'><input type='search' id='textSrch' name='textSrch' val='' placeholder='Search inside'/><button type='submit' id='btnSrch' name='btnSrch'>GO</button></form>"
- // XXXmang icons incorrect or handlers wrong
+ "<button class='BRicon play'></button>"
+ "<button class='BRicon pause'></button>"
+ "<button class='BRicon info'></button>"
+ "</span>"
+ "<span><a class='logo' href='" + this.logoURL + "'></a></span>"
+ "<span id='BRreturn'><span>Back to</span><a href='" + this.bookUrl + "'>" + this.bookTitle + "</a></span>"
+ + "<div id='BRnavCntlTop' class='BRnavCntl BRup'></div>"
+ "</div>"
/*
+ "<div id='BRzoomer'>"
*/
);
- $('#BRtoolbar .pause').hide();
+ $('#BRtoolbar .pause').hide();
this.updateToolbarZoom(this.reduce); // Pretty format
return false;
});
- // 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());
- // });
-
this.initSwipeData();
$('#BookReader').die('mousemove.navigation').live('mousemove.navigation',
{ 'br': this },
// ttsToggle()
//______________________________________________________________________________
BookReader.prototype.ttsToggle = function () {
+
+ this.autoStop();
+
if (false == this.ttsPlaying) {
this.ttsPlaying = true;
this.showProgressPopup('Loading audio...');
// 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");
},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})
};
}
);
$('.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);
+ };
+ });
});
-