BookReader.prototype.ttsToggle = function () {
if (false == this.ttsPlaying) {
this.ttsPlaying = true;
- this.ttsShowPopup();
+ this.showProgressPopup();
if(soundManager.supported()) {
this.ttsStart();
} else {
soundManager.stopAll();
soundManager.destroySound('chunk'+this.ttsIndex+'-'+this.ttsPosition);
this.ttsRemoveHilites();
- this.ttsRemovePopup();
+ this.removeProgressPopup();
this.ttsPlaying = false;
this.ttsIndex = null; //leaf index
return;
}
- this.ttsShowPopup();
+ this.showProgressPopup();
///// whileloading: broken on safari
///// onload fires on safari, but *after* the sound starts playing..
id: 'chunk'+this.ttsIndex+'-0',
//url: 'http://home.us.archive.org/~rkumar/arctic.ogg',
url: 'http://'+this.server+'/BookReader/BookReaderGetTTS.php?string=' + escape(data[0][0]) + '&format=.'+this.ttsFormat, //the .ogg is to trick SoundManager2 to use the HTML5 audio player
- whileloading: function(){if (this.bytesLoaded == this.bytesTotal) this.br.ttsRemovePopup();}, //onload never fires in FF...
- onload: function(){this.br.ttsRemovePopup();} //whileloading never fires in safari...
+ whileloading: function(){if (this.bytesLoaded == this.bytesTotal) this.br.removeProgressPopup();}, //onload never fires in FF...
+ onload: function(){this.br.removeProgressPopup();} //whileloading never fires in safari...
});
snd.br = this;
snd.load();
this.ttsNextChunk();
}
-// ttsShowPopup
+// showProgressPopup
//______________________________________________________________________________
-BookReader.prototype.ttsShowPopup = function() {
- if (soundManager.debugMode) console.log('ttsShowPopup index='+this.ttsIndex+' pos='+this.ttsPosition);
+BookReader.prototype.showProgressPopup = function() {
+ if (soundManager.debugMode) console.log('showProgressPopup index='+this.ttsIndex+' pos='+this.ttsPosition);
if (this.popup) return;
this.popup = document.createElement("div");
left: $('#BookReader').width()-220 + 'px',
width: '220px',
height: '20px',
- }).attr('className', 'BRttsPopUp').appendTo('#BookReader');
+ }).attr('className', 'BRprogresspopup').appendTo('#BookReader');
htmlStr = ' ';
this.popup.innerHTML = htmlStr;
}
-// ttsRemovePopup
+// removeProgressPopup
//______________________________________________________________________________
-BookReader.prototype.ttsRemovePopup = function() {
+BookReader.prototype.removeProgressPopup = function() {
$(this.popup).remove();
this.popup=null;
}