Files
neutrino/data/y-web/Y_Tools_Screenshot.yhtm
Thilo Graf 4518361d3d Revert "yWeb: rework for basic functionality"
Your reaction to this commit were remarkable. You demanded with an
imperious kind to revert this commit. You spoke about any rules only,
and I didn't hear evidencing explanations from you.
Admittedly, my commit wasn't very pretty and not the best style because
everything was squashed in a single commit with some customizations,
but which is ultimately just a formality... that's about it, and was quite
compliant with license conditions. In additional, your name was noted on
the commit. I'm just reminding you, until a few years ago, you didn't care
about licenses. The general copyright mainly lies with yjogol and a lot of
changes of the origin yweb code has been coming in by several committers
since yweb exists. I won't judge, whether any unique selling points play a
role, but such restrictions are exactly what the license should prevent.
Especially as, many creeped in brandings in some code parts (not only yweb)
do suggest that. Besides neutralizing such things, mainly it was the
purpose to get more compatibility, even though some functionalities
were removed or switched off.

Related to yweb I have decided to take back this commit for the sake of
peace, and I hope you are happy with it. However, I still reserve to
continue using and adopting yweb.
2023-01-05 16:05:18 +01:00

160 lines
4.8 KiB
Plaintext

{=var-set:grab={=find-exec:grab=}=}
{=var-set:fbshot={=find-exec:fbshot=}=}
{=include-block:Y_Blocks.txt;head=}
<script type="text/javascript" src="/Y_Baselib.js"></script>
<script type="text/javascript" src="/prototype.js"></script>
<script type="text/javascript">
//<![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;
if (enableOSD == 0 && enableVideo == 0) {
alert("{=L:bc.screenshot.checkenable=}");
return false;
}
return true;
}
function rcsim(_key) {
if(!checkEnable()) return;
if(_key == "KEY_POWER"){
var __result = trim(loadSyncURL("/control/standby"));
if (__result == "off") {
if(confirm("{=L:bc.control.shutdown.ask=}") != true)
return;
}
}
loadSyncURL("/control/rcem?" + _key);
window.setTimeout("do_snapshot()", 750);
}
function do_snapshot() {
if(!checkEnable()) return;
$('shot').hide();
$('shot').src = "";
$('buttons').hide();
$('status').show();
var filename = "screenshot";
if (id("filename").value != "") {
filename = id("filename").value;
}
if ("{=var-get:grab=}" != "")
{
if (enableOSD == 1 && enableVideo == 1)
stb_exec_tools("fbshot grab -q -p /tmp/"+filename+".png");
else if (enableOSD == 1)
stb_exec_tools("fbshot grab -q -p -o /tmp/"+filename+".png");
else if (enableVideo == 1)
stb_exec_tools("fbshot grab -q -p -v /tmp/"+filename+".png");
}
else if ("{=var-get:fbshot=}" != "" && enableVideo == 0)
stb_exec_tools("fbshot fbshot /tmp/"+filename+".png");
else
loadSyncURL("/control/screenshot?name="+filename+"&osd="+enableOSD+"&video="+enableVideo);
do_showshot(filename);
}
function do_showshot(_filename) {
if (_filename == "")
_filename = "screenshot";
$('status').hide();
$('buttons').show();
$('shot').src = "/tmp/"+_filename+".png?"+Math.random();
$('shot').show();
}
function do_clearshot(){
$('shot').hide();
$('shot').src = "";
loadSyncURL("/control/exec?Y_Tools&screenshot_clear");
}
function do_switchrc(){
if (id('remote').style.display == 'none')
$('remote').show();
else
$('remote').hide();
do_switchrc_txt();
}
function do_switchrc_txt(){
if (id('remote').style.display == 'none')
$('switchrc').update("{=L:bc.control.remote=} {=L:show=}");
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>
<body onload="do_switchrc_txt(); do_snapshot();">
<div class="work_box" id="work_box">
<div class="work_box_head"><div class="work_box_head_h2">
{=var-set:help_url==}{=var-set:menu={=L:bc.menue.screenshot=}=}{=include-block:Y_Blocks.txt;work_menu=}</div></div>
<div class="work_box_body">
<div id="screenshot_header">
<div id="buttons" style="display: block">
<div class="left">
<button name="snapshot" ytype="snapshot" onclick="do_snapshot()">{=L:bc.screenshot.create=}</button>&nbsp;
<button name="clearshot" ytype="clearshot" onclick="do_clearshot()">{=L:bc.screenshot.delete=}</button>&nbsp;
<button name="switchrc" ytype="switchrc" onclick="do_switchrc()" id="switchrc">{=L:bc.control.remote=}</button>&nbsp;
</div>
<div class="right">
<form onsubmit="do_snapshot(); return false">
{=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>
</div>
<div class="clear"></div>
<div class="right">
Reload: <input type="number" value="15" id="inputReload" min="1" max="180" title="{=L:bc.screenshot.reload_desc=}" disabled /> <input id="checkReload" name="checkReload" type="checkbox" />
</div>
<div class="clear"></div>
</div>
<div id="status" style="display: none">
<img src="/images/wait.gif" alt="{=L:bc.screenshot.wait_text=}"/>
{=L:bc.screenshot.wait_text=}
</div>
</div>
<table cellpadding="0" class="screenshot">
<tr>
<td id="remote" {=if-equal:{=rc=}~false~style="display: none"~=}>
{=include-block:Y_Blocks.txt;remote=}
</td>
<td class="shot">
<img id="shot" src="" onclick="do_switchrc()" style="display: none" />
</td>
</tr>
</table>
</div>
</div>
<script>
document.getElementById('checkReload').onclick = function() {
if (this.checked ) {
interval = setInterval(do_snapshot, document.getElementById("inputReload").value + "000");
document.getElementById("inputReload").disabled = false;
} else {
clearInterval(interval);
document.getElementById("inputReload").disabled = true;
}
};
</script>
</body>
</html>