X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=BookReader%2FBookReader.js;h=e63417d0f73075ba079f9d9af76e263db29c4610;hb=efdb0b07e7f8b23d5afa28f8a36b761720b167be;hp=96f30ef520fc617ebbfb64a17015107dbfc261bd;hpb=5cfa9a417460ae4fe65fb5a2a7055174538a3146;p=bookreader.git diff --git a/BookReader/BookReader.js b/BookReader/BookReader.js index 96f30ef..e63417d 100644 --- a/BookReader/BookReader.js +++ b/BookReader/BookReader.js @@ -1239,6 +1239,8 @@ BookReader.prototype.jumpToIndex = function(index, pageX, pageY) { this.willChangeToIndex(index); + this.ttsStop(); + if (this.constMode2up == this.mode) { this.autoStop(); @@ -2645,7 +2647,7 @@ BookReader.prototype.search = function(term) { this.searchTerm = term; this.removeSearchResults(); - this.showProgressPopup(); + this.showProgressPopup(' Search results will appear below...'); this.ttsAjax = $.ajax({url:url, dataType:'jsonp', jsonpCallback:'BRSearchCallback'}); } @@ -2658,6 +2660,17 @@ function BRSearchCallback(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'); //.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 +3428,7 @@ BookReader.prototype.addSearchResult = function(queryString, pageIndex) { var re = new RegExp('{{{(.+?)}}}', 'g'); queryString = queryString.replace(re, '$1') - $('