{=var-set:cancache=yPInstall=}
{=include-block:Y_Blocks.txt;head=}
<script type="text/javascript" src="/Y_Baselib.js"></script>
<script type="text/javascript">
//<![CDATA[
function do_snapshot()
{
	show_waitbox(true);
	window.setTimeout("do_snapshot2()", 500);
}
function do_snapshot2()
{
	var _shot = document.getElementById("shot");
	var filename = id("file").value;
	dbox_exec_command("{=if-file-exists:/var/bin/fbshot~/var/bin/fbshot~fbshot=} -q /tmp/"+filename+".png");
	show_waitbox(false);
	show_obj("shot", true);
	_shot.src = "/tmp/"+filename+".png?"+Math.random();
}
function do_dboxshot()
{
	show_waitbox(true);
	window.setTimeout("do_dboxshot2()", 500);
}
function do_dboxshot2()
{
	var _shot = document.getElementById("shot");
	var filename = id("file").value;
	var res = dbox_exec_command("{=if-file-exists:/var/bin/dboxshot~/var/bin/dboxshot~dboxshot=} /tmp/"+filename+".bmp");
	if(res != "")
		dbox_exec_command("{=if-file-exists:/var/bin/dboxshot~/var/bin/dboxshot~dboxshot=} /tmp/"+filename+".bmp");
	show_waitbox(false);
	show_obj("shot", true);
	_shot.src = "/tmp/"+filename+".bmp?"+Math.random();
}
function do_clearshot()
{
	window.setTimeout("do_clearshot2()", 500);
}
function do_clearshot2()
{
	var _shot = document.getElementById("shot");
	dbox_exec_command("rm /tmp/*.png");
	dbox_exec_command("rm /tmp/*.bmp");
}
//]]>
</script>
</head>
<body>
{=var-set:wait_text=Snapshot taken=}{=include-block:Y_Blocks.txt;snip_wait=}
<div class="work_box">
	<div class="work_box_head"><div class="work_box_head_h2">
	{=var-set:help_url=Neutrino:yWeb:BoxControl#OSD_Screenshot=}{=var-set:menu=OSD Screenshot=}{=include-block:Y_Blocks.txt;work_menu=}</div></div>
	<div class="work_box_body">
		<button name="snapshot" onclick="do_snapshot()">Snapshot</button>
		{=var-set:dboxshot={=if-file-exists:/bin/dboxshot~true~{=if-file-exists:/var/bin/dboxshot~true~false=}=}=}
		{=if-equal:{=var-get:dboxshot=}~true~
		<button name="dboxshot" onclick="do_dboxshot()">dboxshot</button>
		=}
		<button name="clearshot" onclick="do_clearshot()">Delete Screenshots</button>
		&nbsp;Filename:<input type="text" value="a" id="file" size="16"/>
		<br/>
		<img id="shot" src="" style="visibility:hidden;"/>
	</div>
</div>
</body>
</html>
