');
// Attaches to first child, so must come after we add the page view
- $('#BRcontainer').dragscrollable();
+ //$('#BRcontainer').dragscrollable();
this.bindGestures($('#BRcontainer'));
// $$$ calculate first then set
@@ -1496,7 +1495,7 @@ BookReader.prototype.prepareTwoPageView = function(centerPercentageX, centerPerc
$(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');
@@ -2375,8 +2374,13 @@ BookReader.prototype.setMouseHandlers2UP = function() {
this.setClickHandler2UP( this.prefetchedImgs[this.twoPage.currentIndexL],
{ self: this },
function(e) {
+ if (e.button == 2) {
+ // right click
+ return;
+ }
e.data.self.ttsStop();
e.data.self.left();
+
e.preventDefault();
}
);
@@ -2384,6 +2388,10 @@ BookReader.prototype.setMouseHandlers2UP = function() {
this.setClickHandler2UP( this.prefetchedImgs[this.twoPage.currentIndexR],
{ self: this },
function(e) {
+ if (e.button == 2) {
+ // right click
+ return;
+ }
e.data.self.ttsStop();
e.data.self.right();
e.preventDefault();
@@ -2409,7 +2417,7 @@ BookReader.prototype.prefetchImg = function(index) {
if (loadImage) {
//console.log('prefetching ' + index);
var img = document.createElement("img");
- img.className = 'BRpageimage';
+ $(img).addClass('BRpageimage').addClass('BRnoselect');
if (index < 0 || index > (this.numLeafs - 1) ) {
// Facing page at beginning or end, or beyond
$(img).css({
@@ -2634,8 +2642,11 @@ 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 += '/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);
@@ -2645,19 +2656,28 @@ BookReader.prototype.search = function(term) {
this.searchTerm = term;
this.removeSearchResults();
- this.showProgressPopup();
- this.ttsAjax = $.ajax({url:url, dataType:'jsonp', jsonpCallback:'BRSearchCallback'});
+ this.showProgressPopup(' Search results will appear below...');
+ 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;
//console.log(br.searchResults);
+
+ if (0 == results.matches.length) {
+ $(br.popup).text('No matches were found.');
+ setTimeout(function(){
+ $(br.popup).fadeOut('slow', function() {
+ br.removeProgressPopup();
+ })
+ },1000);
+ return;
+ }
+
var i;
for (i=0; i= 0) {
if (null == box.div) {
//create a div for the search highlight, and stash it in the box object
@@ -3079,6 +3100,8 @@ BookReader.prototype.showBookmarkCode = function() {
//______________________________________________________________________________
BookReader.prototype.autoToggle = function() {
+ this.ttsStop();
+
var bComingFrom1up = false;
if (2 != this.mode) {
bComingFrom1up = true;
@@ -3250,7 +3273,8 @@ BookReader.prototype.initNavbar = function() {
+ ''
+ ''
+ ''
- + ''
+ // $$$ not yet implemented
+ //+ ''
+ ''
+ ''
+ ''
@@ -3360,10 +3384,13 @@ BookReader.prototype.initNavbar = function() {
.append('
');
//.wrap('').parent(); // XXXmang is this used for hiding the tooltip?
+ // $$$mang, why are these set both here and in bindNavigationHandlers?
$('.BRicon.book_left').bind('click', function() {
+ self.ttsStop();
self.left();
});
$('.BRicon.book_right').bind('click', function() {
+ self.ttsStop();
self.right();
});
@@ -3412,7 +3439,7 @@ BookReader.prototype.addSearchResult = function(queryString, pageIndex) {
var re = new RegExp('{{{(.+?)}}}', 'g');
queryString = queryString.replace(re, '$1')
- $('