Commit 6d4cf7bb authored by nextime's avatar nextime

gmi app seems to not work with EventSource on gxv3175v2...

parent f1a99722
...@@ -100,10 +100,11 @@ $.fn.alterClass = function ( removals, additions ) { ...@@ -100,10 +100,11 @@ $.fn.alterClass = function ( removals, additions ) {
}; };
})( jQuery ); })( jQuery );
/*
function postreply(arg) function postreply(arg)
{ {
alert(arg); console.debug(arg);
} } */
/* /*
var clicksound = new Audio("/domotika/gmi/beep.wav"); var clicksound = new Audio("/domotika/gmi/beep.wav");
clicksound.preload = 'auto'; clicksound.preload = 'auto';
...@@ -120,11 +121,14 @@ function butpushed(btype, bid) ...@@ -120,11 +121,14 @@ function butpushed(btype, bid)
//playClick(1); //playClick(1);
//simpleGMI.play('/domotika/gmi/beep.wav',0,0,function(data){alert(data)}); //simpleGMI.play('/domotika/gmi/beep.wav',0,0,function(data){alert(data)});
$.post("/rest/v1.2/"+btype+"/setbyid/"+bid+"/json"); $.post("/rest/v1.2/"+btype+"/setbyid/"+bid+"/json");
//simpleGMI.post("http://q.unixmedia.net/rest/v1.2/"+btype+"/setbyid/"+bid+"/json", 'gmi=true', postreply);
} }
setInterval(function(){ setInterval(function(){
simpleGMI.post('http://q.unixmedia.net/domotika/gmi/style.css', 'aaa=sarca', postreply); simpleGMI.refresh();
}, 5000); }, 3600000);
// simpleGMI.post('http://q.unixmedia.net/domotika/gmi/style.css', 'aaa=sarca', postreply);
//}, 5000);
</script> </script>
</head> </head>
<body> <body>
...@@ -189,6 +193,7 @@ setInterval(function(){ ...@@ -189,6 +193,7 @@ setInterval(function(){
</div> </div>
<div class="footer-bar"> <div class="footer-bar">
<!--
<button onClick="simpleGMI.dial(0, 0, 0, 281, '', 1)" class="pure-button pure-button-secondary"> <button onClick="simpleGMI.dial(0, 0, 0, 281, '', 1)" class="pure-button pure-button-secondary">
<i class="fa fa-microphone fa-2x blackiconcolor"></i> <i class="fa fa-microphone fa-2x blackiconcolor"></i>
</button> </button>
...@@ -196,7 +201,13 @@ setInterval(function(){ ...@@ -196,7 +201,13 @@ setInterval(function(){
<button onClick="simpleGMI.refresh()" class="pure-button pure-button-secondary" style="float:right"> <button onClick="simpleGMI.refresh()" class="pure-button pure-button-secondary" style="float:right">
<i class="fa fa-refresh fa-2x fa-spin blackiconcolor"></i> <i class="fa fa-refresh fa-2x fa-spin blackiconcolor"></i>
</button> </button>
-->
<button onClick="simpleGMI.dial(0, 0, 0, 281, '', 1)" class="pure-button pure-button-secondary">
<i class="fa fa-microphone fa-2x blackiconcolor"></i>
</button>
<button onClick="simpleGMI.refresh()" class="pure-button pure-button-secondary" style="float:right">
<i class="fa fa-refresh fa-2x blackiconcolor"></i>
</button>
</div> </div>
<script> <script>
var es = new EventSource("/sse"); var es = new EventSource("/sse");
...@@ -211,12 +222,24 @@ var syncReceived = function(event) { ...@@ -211,12 +222,24 @@ var syncReceived = function(event) {
var color=$(this).attr('data-dmcolor-on'); var color=$(this).attr('data-dmcolor-on');
else else
var color=$(this).attr('data-dmcolor-off'); var color=$(this).attr('data-dmcolor-off');
alert(color);
$(this).alterClass('pure-button-*', color); $(this).alterClass('pure-button-*', color);
} }
) )
}); });
} }
es.addEventListener("sync", syncReceived); es.addEventListener("sync", syncReceived);
setInterval(function(){
$.get("/rest/v1.2/keepalive/json",
function(r){
if(r.data=='SLOGGEDOUT')
{
//location.reload();
simpleGMI.refresh();
}
});
},5000);
</script> </script>
</body> </body>
</html> </html>
...@@ -39,3 +39,7 @@ body { ...@@ -39,3 +39,7 @@ body {
.pure-button-secondary { .pure-button-secondary {
background: rgb(66, 184, 221); /* this is a light blue */ background: rgb(66, 184, 221); /* this is a light blue */
} }
button:active {
background: yellow;
}
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