')}),annyang.addCallback("resultMatch",function(a,t,n){console.log(a),console.log(t),console.log(n),e=a.toLowerCase()});var i=function(){window.open("support.htm"),s()},r=function(){t(),$(".id-speak").html('Welcome at My Golf Caddy!"\n Just say a word referring to a rule for example, "bunker".'),o='Welcome at My Golf Caddy!"\n Just say a word referring to a rule for example, "bunker".';$(".image-div").html('')},s=function(){t(),$(".id-speak").html("Your welcome, and thank you for using My Golf Caddy."),o="Your welcome, and thank you for using My Golf Caddy.";$(".image-div").html('
')},d=function(e){return function(){t();var a=n[e].rule;o=a,$(".id-speak").html(a),$(".image-rule").remove();var i=l[e].image;$(".image-div").html("
')}};annyang.addCommands({hello:r,hi:r,"thank you":i,bunker:d("bunker"),bunkers:d("bunker"),sand:d("loose impediments"),twigs:d("loose impediments"),"ball moved":d("ball moved"),"ball lost":d("ball lost"),"lost ball":d("ball lost"),relief:d("relief"),embedded:d("embedded ball"),"embedded ball":d("embedded ball"),water:d("water hazard"),"water Hazard":d("water hazard"),unplayable:d("unplayable"),obstruction:d("obstruction"),"cleaning ball":d("cleaning ball"),support:i,"wrong green":d("wrong green"),provisional:d("provisional ball"),"provisional ball":d("provisional ball"),"out of bounds":d("out of bounds"),"out of bound":d("out of bounds"),"cleaning ball":d("cleaning ball"),"tee shot":d("tee shot"),"abnormal ground":d("abnormal ground"),"repair green":d("repair green"),"lift ball":d("lifting the ball"),"lifting ball":d("lifting the ball"),"lifting the ball":d("lifting the ball"),"teeing ground":d("teeing ground"),"tee box":d("teeing ground"),"play ball":d("ball played as it lies"),"play as it lies":d("ball played as it lies"),clubs:d("clubs"),club:d("clubs"),speak:function(){a()},home:function(){location.reload()}}),annyang.start();var h=document.getElementById("mic");h.addEventListener("click",function(){h.classList.contains("is_on")?(console.log("Mic is off!"),h.classList.add("is_off"),h.classList.remove("is_on"),annyang.abort(),h.innerText="Mic is off!"):(console.log("Mic is on!"),h.classList.add("is_on"),h.classList.remove("is_off"),annyang.start(),h.innerText="Mic is on!")})}}function n(){"speechSynthesis"in window?$("#speak").click(function(){a()}):window.alert("speechSynthesis not supported, try a browser that supports HTML5")}var o="Just say:'Hi!' and say thank you at the end";$(function(){t(),n()})})
© Tenicia Post