yWeb: enable auto-reload of screenshots

Origin commit data
------------------
Commit: 9eb1060cbb
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-10-16 (Mon, 16 Oct 2017)

Origin message was:
------------------
- yWeb: enable auto-reload of screenshots
This commit is contained in:
vanhofen
2017-10-16 16:43:15 +02:00
parent 4eff70753a
commit 13d189d622
4 changed files with 26 additions and 4 deletions

View File

@@ -8,6 +8,8 @@
//<![CDATA[
var enableOSD;
var enableVideo;
var interval;
function checkEnable() {
enableOSD = (document.getElementById('checkOSD').checked == true) ? 1 : 0;
enableVideo = (document.getElementById('checkVideo').checked == true) ? 1 : 0;
@@ -96,6 +98,13 @@ function do_switchrc_txt(){
else
$('switchrc').update("{=L:bc.control.remote=} {=L:hide=}");
}
function do_reload(){
if (document.getElementById("checkReload").checked)
interval = setInterval(do_snapshot, document.getElementById("inputReload").value + "000");
else
clearInterval(interval);
}
//]]>
</script>
</head>
@@ -113,7 +122,8 @@ function do_switchrc_txt(){
</div>
<div class="right">
<form onsubmit="do_snapshot(); return false">
{=L:filename=}: <input type="text" value="screenshot" id="filename" size="16" />
Reload: <input id="checkReload" name="checkReload" type="checkbox" /> <input type="number" value="15" id="inputReload" min="1" max="180" title="{=L:bc.screenshot.reload_desc=}" disabled />
{=L:filename=}: <input type="text" value="screenshot" id="filename" size="10" />
OSD: <input id="checkOSD" name="checkOSD" type="checkbox" {=if-empty:{=osd=}~~checked="checked"=} />
TV: <input id="checkVideo" name="checkVideo" type="checkbox" {=if-empty:{=video=}~~checked="checked"=} />
</form>
@@ -125,7 +135,6 @@ function do_switchrc_txt(){
{=L:bc.screenshot.wait_text=}
</div>
</div>
<table cellpadding="0" class="screenshot">
<tr>
<td id="remote" {=if-equal:{=rc=}~false~style="display: none"~=}>
@@ -138,5 +147,16 @@ function do_switchrc_txt(){
</table>
</div>
</div>
<script>
document.getElementById('checkReload').onclick = function() {
if (this.checked ) {
intervall = setInterval(do_snapshot, document.getElementById("inputReload").value + "000");
document.getElementById("inputReload").disabled = false;
} else {
clearInterval(intervall);
document.getElementById("inputReload").disabled = true;
}
};
</script>
</body>
</html>