Skip to content

Commit

Permalink
UX improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
remdex committed Jan 24, 2015
1 parent 5310ed3 commit e1d285b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lhc_web/design/defaulttheme/js/lhc.speak.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var LHCSpeechToTextCallbackListener = (function() {
$('#CSChatMessage-'+this.chat_id).addClass('admin-chat-mic');
$('#user-chat-status-'+this.chat_id).removeClass('icon-user').addClass('icon-mic');
$('#mic-chat-'+this.chat_id).addClass('icon-mic-recording').html(this.recognition.lang);
$('#user-is-typing-'+this.chat_id).html('Speak now.').css("visibility","visible");
}

LHCSpeechToTextCallbackListener.prototype.onend = function(params)
Expand All @@ -33,13 +34,13 @@ var LHCSpeechToTextCallbackListener = (function() {

LHCSpeechToTextCallbackListener.prototype.onerror = function(event){
if (event.error == 'no-speech') {
console.log("info_no_speech");
$('#user-is-typing-'+this.chat_id).html('No speech was detected.').css("visibility","visible");
}
if (event.error == 'audio-capture') {
console.log('info_no_microphone');
$('#user-is-typing-'+this.chat_id).html('No microphone was found.').css("visibility","visible");
}
if (event.error == 'not-allowed') {
console.log('info_denied');
if (event.error == 'not-allowed') {
$('#user-is-typing-'+this.chat_id).html('Permission to use microphone was denied.').css("visibility","visible");
}
}

Expand Down

0 comments on commit e1d285b

Please sign in to comment.