Commit 426ecaed authored by nextime's avatar nextime

Add user db speech recognition options

parent 3e3b855c
ALTER TABLE `users` ADD `slide` TINYINT( 1 ) NOT NULL DEFAULT '0', ADD `webspeech` ENUM( 'no', 'touch', 'continuous' ) NOT NULL DEFAULT 'touch';
ALTER TABLE `users` ADD `speechlang` ENUM( 'en-US','en-GB','it-IT','it-CH' ) NOT NULL DEFAULT 'en-US';
...@@ -3,6 +3,13 @@ FallbackResource /domotika/gui/index.php ...@@ -3,6 +3,13 @@ FallbackResource /domotika/gui/index.php
Order Deny,Allow Order Deny,Allow
Deny from all Deny from all
</Files> </Files>
<Files offline.appcache>
Order Allow,Deny
Allow from all
ExpiresActive On
ExpiresDefault "access"
</Files>
<FilesMatch "^(index|install)\.php$"> <FilesMatch "^(index|install)\.php$">
Order Allow,Deny Order Allow,Deny
......
...@@ -10,15 +10,17 @@ var updateUser = function(r) { ...@@ -10,15 +10,17 @@ var updateUser = function(r) {
$("#desktophome").val(r.data.desktop_homepath); $("#desktophome").val(r.data.desktop_homepath);
$("#mobilehome").val(r.data.mobile_homepath); $("#mobilehome").val(r.data.mobile_homepath);
if(r.data.tts==1) if(r.data.tts==1)
{
$('#tts-switch').bootstrapSwitch('setState', true); //$("#tts").attr('checked', true); $('#tts-switch').bootstrapSwitch('setState', true); //$("#tts").attr('checked', true);
}
else else
{
$('#tts-switch').bootstrapSwitch('setState', false); //$("#tts").attr('checked', false); $('#tts-switch').bootstrapSwitch('setState', false); //$("#tts").attr('checked', false);
} if(r.data.slide==1)
$("#userform").show(); $('#slide').bootstrapSwitch('setState', true);
else
$('#slide').bootstrapSwitch('setState', false);
$("#lang").val(r.data.language); $("#lang").val(r.data.language);
$("#webspeech").val(r.data.webspeech);
$("#speechlang").val(r.data.speechlang);
$("#userform").show();
}; };
......
CACHE MANIFEST CACHE MANIFEST
#1388875360 # rev 1388875361
/resources/img/logo_icon.png /resources/img/logo_icon.png
NETWORK: NETWORK:
* *
...@@ -62,6 +62,35 @@ ...@@ -62,6 +62,35 @@
</div> </div>
</div> </div>
</div> </div>
<div class="form-group">
<label for="slide" class="col-lg-2 control-label">Sliding GUI:</label>
<div class="col-lg-3">
<div class="make-switch switch-mini" id="slide-switch" data-on-label="YES" data-off-label="NO">
<input id="slide" type="radio" name="slide" />
</div>
</div>
</div>
<div class="form-group">
<label for="lang" class="col-lg-2 control-label">Web Speech rec.:</label>
<div class="col-lg-3">
<select name="webspeech" id="webspeech" class="form-control">
<option value="no">no</option>
<option value="touch">touch</option>
<option value="continuous">continuous</option>
</select>
</div>
</div>
<div class="form-group">
<label for="lang" class="col-lg-2 control-label">Speech lang:</label>
<div class="col-lg-3">
<select name="speechlang" id="speechlang" class="form-control">
<option value="en-US">US English</option>
<option value="en-GB">UK English</option>
<option value="it-IT">IT Italiano</option>
<option value="it-CH">CH Italiano</option>
</select>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label for="mobilehome" class="col-lg-2 control-label"></label> <label for="mobilehome" class="col-lg-2 control-label"></label>
<div class="col-lg-3"> <div class="col-lg-3">
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
<script src="/resources/EventSource/eventsource.js"></script> <script src="/resources/EventSource/eventsource.js"></script>
*/ ?> */ ?>
<script src="<?=$BASEGUIPATH;?>/js/combined.min.js"></script> <script src="<?=$BASEGUIPATH;?>/js/combined.min.js"></script>
<!-- <script src="//cdnjs.cloudflare.com/ajax/libs/annyang/1.0.0/annyang.min.js"></script> -->
<script> <script>
//document.documentElement.requestFullscreen(); //document.documentElement.requestFullscreen();
...@@ -41,12 +42,17 @@ ...@@ -41,12 +42,17 @@
function tmpPopover(el, cont, placement, timeout) function tmpPopover(el, cont, placement, timeout)
{ {
console.debug(cont);
//el.popover("destroy");
el.popover({ el.popover({
placement: placement, placement: placement,
content: cont, content: cont,
delay: {show: 100, hide: timeout}, delay: {show: 100, hide: timeout},
container: el,
trigger: "manual"}); trigger: "manual"});
console.debug(el.popover);
el.popover("show"); el.popover("show");
el.find(".popover-content").html(cont);
setTimeout(function(){el.popover("destroy")}, timeout); setTimeout(function(){el.popover("destroy")}, timeout);
} }
...@@ -80,6 +86,24 @@ ...@@ -80,6 +86,24 @@
$.post("/rest/v1.2/actions/speech_text/json", spobj.serialize(), speechResult ); $.post("/rest/v1.2/actions/speech_text/json", spobj.serialize(), speechResult );
} }
/*
// Test SpeechAPI
function setSpeechText(terms)
{
$("#speech [name=text]").val(terms);
$("#speechsm [name=text]").val(terms);
console.debug("SpeechRecognized: "+terms)
sendSpeech($("#speech"));
}
var commands = {
'domotica *terms': setSpeechText
};
annyang.init(commands);
annyang.setLanguage('it-IT')
annyang.start();
*/
var popupFader = function(ftype, title, message, timeout){ var popupFader = function(ftype, title, message, timeout){
if(typeof(timeout)==='undefined') timeout = 1500; if(typeof(timeout)==='undefined') timeout = 1500;
$("#alertTitle").text(title); $("#alertTitle").text(title);
...@@ -407,6 +431,10 @@ ...@@ -407,6 +431,10 @@
function(r){ function(r){
console.debug(r); console.debug(r);
console.debug("getok"); console.debug("getok");
//if('vibrate' in navigator) {
// // ... vibrate for a second
// navigator.vibrate(1000);
//}
if(r.data=='SLOGGEDOUT') if(r.data=='SLOGGEDOUT')
{ {
location.reload(); location.reload();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment