$(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);
var url = 'http://'+this.server.replace(/:.+/, ''); //remove the port and userdir
- url += '/~edward/inside_jsonp.php?item_id='+this.bookId;
+ url += '/fulltext/inside.php?item_id='+this.bookId;
url += '&doc='+this.subPrefix; //TODO: test with subitem
url += '&path='+this.bookPath.replace(new RegExp('/'+this.subPrefix+'$'), ''); //remove subPrefix from end of path
url += '&q='+escape(term);
this.removeSearchResults();
this.showProgressPopup('<img id="searchmarker" src="'+this.imagesBaseURL + 'marker_srch-on.png'+'"> Search results will appear below...');
- this.ttsAjax = $.ajax({url:url, dataType:'jsonp', jsonpCallback:'BRSearchCallback'});
+ this.ttsAjax = $.ajax({url:url, dataType:'jsonp', jsonpCallback:'br.BRSearchCallback'});
}
// BRSearchCallback()
//______________________________________________________________________________
-// Unfortunately, we can't pass 'br.searchCallback' to our search service,
-// because it can't handle the '.'
-function BRSearchCallback(results) {
+BookReader.prototype.BRSearchCallback = function(results) {
//console.log('got ' + results.matches.length + ' results');
br.removeSearchResults();
br.searchResults = results;
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');
// ttsToggle()
//______________________________________________________________________________
BookReader.prototype.ttsToggle = function () {
+
+ this.autoStop();
+
if (false == this.ttsPlaying) {
this.ttsPlaying = true;
this.showProgressPopup('Loading audio...');