Speech rec fixes

This commit is contained in:
Hillel Coren 2017-04-09 13:04:27 +03:00
parent 43fc67011e
commit 77a1ad6e04
4 changed files with 11 additions and 4 deletions

View File

@ -26,6 +26,8 @@ class BotController extends Controller
public function handleMessage($platform)
{
abort(404);
$input = Input::all();
$botUserId = $input['from']['id'];

View File

@ -189,6 +189,8 @@
}
});
$('[data-toggle="tooltip"]').tooltip();
// set timeout onDomReady
setTimeout(delayedFragmentTargetOffset, 500);

View File

@ -175,8 +175,8 @@
$('#left-menu-toggle').trigger('click');
});
@if (Utils::isNinja())
Mousetrap.bind('r', function(e) {
@if (env('SPEECH_ENABLED'))
Mousetrap.bind('v', function(e) {
onMicrophoneClick();
});
@endif

View File

@ -1,5 +1,6 @@
<i id="microphone" class="fa fa-microphone form-control-feedback"
title="{{ trans('texts.microphone_help') }}"
title="Say &quot;new invoice for [client]&quot; or &quot;show me [client]\'s archived payments&quot;"
data-toggle="tooltip" data-placement="bottom"
onclick="onMicrophoneClick()" aria-hidden="true"></i>
<style type="text/css">
@ -125,6 +126,7 @@
recognition.onend = function() {
recognizing = false;
$('.fa-microphone').show();
$('#search').val('');
if (ignore_onend) {
return;
}
@ -140,6 +142,7 @@
recognition.onend = null;
recognition.stop();
$('.fa-microphone').hide();
$('#search').val('');
return;
}
for (var i = event.resultIndex; i < event.results.length; ++i) {
@ -163,7 +166,7 @@
}
function onMicrophoneClick() {
//$('#search').val("");
//$('#search').val("find david");
//$('#search-form').submit();
//return;