- yweb: merge tv-shot and osd-shot to one page

* use internal screenshot-function to make osd-shots
This commit is contained in:
svenhoefer
2013-02-12 23:12:20 +01:00
parent b2f5ca589d
commit 71f2c8c9a7
9 changed files with 158 additions and 122 deletions

View File

@@ -82,7 +82,7 @@ install_DATA = channels.js \
Y_Tools_lcshot.yhtm \
Y_Tools_Menue.yhtm \
Y_Tools_Rcsim.yhtm \
Y_Tools_remote_osd.yhtm \
Y_Tools_Screenshot.yhtm \
Y_Tools_Timer_Sync.js \
Y_Tools_Timer_Sync.yhtm \
Y_Tools_tvshot.yhtm \

View File

@@ -101,21 +101,8 @@ function init(){
</li>
~=}
<li>
<a target="work" title="{=L:bc.menue.tv_screenshot_desc=}" href="Y_Tools_tvshot.yhtm">{=L:bc.menue.tv_screenshot=}</a>
</li>
<li>
{=if-equal:{=var-get:fbshot=}~true~
<a target="work" title="{=L:bc.menue.osd_screenshot_desc=}" href="Y_Tools_remote_osd.yhtm?noremote=1">{=L:bc.menue.osd_screenshot=}</a>
~
<a href="javascript:void(0)" class="disabled" title="{=L:bc.menue.osd_screenshot_desc_ni=}">{=L:bc.menue.osd_screenshot=}</a>
=}
</li>
<li>
{=if-equal:{=var-get:fbshot=}~true~
<a target="work" title="{=L:bc.menue.remote_osd_desc=}" href="Y_Tools_remote_osd.yhtm">{=L:bc.menue.remote_osd=}</a>
~
<a href="javascript:void(0)" class="disabled" title="{=L:bc.menue.remote_osd_desc_ni=}">{=L:bc.menue.remote_osd=}</a>
=}
<a target="work" title="OSD-{=L:bc.menue.screenshot=}" href="Y_Tools_Screenshot.yhtm?osd=1&noremote=1">OSD-{=L:bc.menue.screenshot=}</a>
<a target="work" title="TV-{=L:bc.menue.screenshot=}" href="Y_Tools_Screenshot.yhtm?video=1&noremote=1">TV-{=L:bc.menue.screenshot=}</a>
</li>
</ul>
</div>

View File

@@ -12,6 +12,18 @@ button,input,select,form,td {
font-family: Verdana, Geneva, Arial, 'Lucida Grande',Tahoma, Helvetica, sans-serif;
color:#555555;
}
.left {
float: left;
}
.right {
float: right;
}
.clear {
clear: both;
line-height: 0px;
height: 0;
overflow: hidden;
}
/* buttons */
a img:hover {
position:relative;
@@ -37,7 +49,7 @@ button[ytype="zap"]{background-image:url(/images/zap.png);}
button[ytype="timeup"]{background-image:url(/images/time_up.png);}
button[ytype="timedown"]{background-image:url(/images/time_down.png);}
button[ytype="timeadd"]{background-image:url(/images/time_add.png);}
button[ytype="shot"]{background-image:url(/images/snapshot.png);}
button[ytype="snapshot"]{background-image:url(/images/snapshot.png);}
button[ytype="clearshot"]{background-image:url(/images/remove.png);}
button[ytype="zoomshot"]{background-image:url(/images/fullscreen.png);}
button[ytype="go"]{background-image:url(/images/accept.png);}
@@ -849,12 +861,17 @@ a.timer {
}
/* screenshots */
#screenshot_header {
height: 30px;
}
td.shot {
vertical-align: top;
}
img#shot {
width: 100%;
background-color: #ffffff;
border: 1px solid #f5f5f5;
margin: 10px 0;
}
img#shot:hover {
cursor: pointer;

View File

@@ -120,7 +120,7 @@ function vlc() {
<span class="control_icon">
<a target="base" href="Y_Dyn_Pages.yhtm?page=frame_live_directtv" title={=L:main.live_tv_desc=}><img src="/images/live.gif"></a>
<a target="base" href="Y_Dyn_Pages.yhtm?page=frame_live&dostart=live_tv_popup" title="{=L:main.live_tv_popup_desc=}"><img src="/images/live_popup.gif"></a>
<a target="base" href="Y_Tools_remote_osd.yhtm?full=1" title="{=L:main.remote_full_desc=}"><img src="/images/fb.png"></a>
<a target="base" href="Y_Tools_Screenshot.yhtm?osd=1" title="{=L:main.remote_full_desc=}"><img src="/images/fb.png"></a>
<a href="javascript:vlc()" title="{=L:main.stream_to_vlc_client_desc=}"><img src="/images/vlc.gif"></a>
</span>
</td>

View File

@@ -0,0 +1,112 @@
{=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;
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;
}
var _null = loadSyncURL("/control/screenshot?name="+filename+"&osd="+enableOSD+"&video="+enableVideo);
window.setTimeout("do_showshot('"+filename+"');", (enableVideo == 1) ? 3500 : 1500);
}
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_zoomshot(){
// not a really zoom-function
if (id('remote').style.display == 'none')
$('remote').show();
else
$('remote').hide();
}
//]]>
</script>
</head>
<body onload="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="zoomshot" ytype="zoomshot" onclick="do_zoomshot()">{=L:bc.screenshot.zoom=}</button>&nbsp;
</div>
<div class="right">
<form onsubmit="do_snapshot(); return false">
{=L:filename=}: <input type="text" value="screenshot" id="filename" size="16" />
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>
<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">
<tr>
<td id="remote" {=if-empty:{=noremote=}~~style="display: none"=}>
{=include-block:Y_Blocks.txt;remote=}
</td>
<td class="shot">
<img id="shot" src="" onclick="do_zoomshot()" style="display: none" title="Click to zoom" />
</td>
</tr>
</table>
</div>
</div>
</body>
</html>

View File

@@ -1,66 +0,0 @@
{=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[
function rcsim(_key) {
$('statusline').show();
$('buttons').hide();
dbox_rcsim(_key);
window.setTimeout("do_snapshot()",750);
}
function do_snapshot(){
var filename = id("filename").value;
var res = dbox_exec_tools("fbshot fb /tmp/"+filename+".png");
var _shot = document.getElementById("shot");
_shot.src = "/tmp/"+filename+".png?"+Math.random();
$('statusline').hide();
$('buttons').show();
show_obj("shot", true);
}
function do_clearshot(){
window.setTimeout("do_clearshot2()", 500);
}
function do_clearshot2(){
dbox_exec_tools("fbshot_clear");
}
function do_zoomshot(){
// not a really zoom-function
var _remote = document.getElementById('remote');
if (_remote.style.display == 'none')
_remote.style.display='inline';
else
_remote.style.display='none';
}
//]]>
</script>
</head>
<body onload="do_snapshot()">
<div class="work_box" id="work_box">
<div class="work_box_head"><div class="work_box_head_h2">
{=var-set:help_url=Help-BoxControl-Remote_OSD=}{=var-set:menu={=L:bc.menue.remote_osd=}=}{=include-block:Y_Blocks.txt;work_menu=}</div></div>
<div class="work_box_body">
<div style="height:30px;">
<span id="buttons" style="display:none">
<button name="snapshot" ytype="shot" onclick="do_snapshot()">{=L:bc.osd.shot=}</button>&nbsp;
<button name="clearshot" ytype="clearshot" onclick="do_clearshot()">{=L:bc.osd.delete_shots=}</button>&nbsp;
<button name="zoomshot" ytype="zoomshot" onclick="do_zoomshot()">{=L:bc.osd.zoom_shot=}</button>&nbsp;
{=L:filename=}:<input type="text" value="a" id="filename" size="16" />
</span>
<span id="statusline"><img border="0" src="/images/wait.gif" width="20" height="20" alt="wait"/></span>
</div>
<table cellpadding="0">
<tr>
<td id="remote" {=if-empty:{=noremote=}~~style="display: none"=}>
{=include-block:Y_Blocks.txt;remote=}
</td>
<td class="shot">
<img id="shot" src="" onclick="do_zoomshot()" style="visibility:hidden;"/>
</td>
</tr>
</table>
</div>
</div>
</body>
</html>

View File

@@ -85,14 +85,8 @@ bc.menue.remote=Fernbedienung
bc.menue.lcd_screenshot_desc=LCD Screenshot erstellen
bc.menue.lcd_screenshot=LCD Screenshot
bc.menue.lcd_screenshot_desc_ni=lcshot nicht installiert in /bin oder /var/bin
bc.menue.osd_screenshot_desc=OSD Screenshot erstellen
bc.menue.osd_screenshot=OSD Screenshot
bc.menue.osd_screenshot_desc_ni=fbshot nicht installiert in /bin oder /var/bin
bc.menue.tv_screenshot_desc=TV Screenshot erstellen
bc.menue.tv_screenshot=TV Screenshot
bc.menue.remote_osd_desc=Fernbedienung und On Screen Display
bc.menue.remote_osd=Fernbed. & OSD
bc.menue.remote_osd_desc_ni=dboxshot nicht installiert in /bin oder /var/bin
bc.menue.screenshot=Screenshot
bc.menue.screenshot_desc=Screenshot des OSDs und/oder des TV-Bildes erstellen
bc.menue.decrease_volume=Lautstärke verringern
bc.menue.increase_volume=Lautstärke erhöhen
@@ -126,16 +120,12 @@ bc.msg.message_to_screen=Meldung auf Bildschirm
bc.msg.popup_to_screen=Popup auf Bildschirm
bc.msg.send_message=Nachricht senden
======== Boxcontrol - Remote & OSD
bc.osd.shot=Schnappschuss
bc.osd.delete_shots=Schnappschuss löschen
bc.osd.zoom_shot=Schnappschuss zoomen
bc.osd.shap_wait_text=Schnappschuss wird erstellt
======== Boxcontrol - TV-Screenshot
bc.tv.shot=Schnappschuss
bc.tv.delete_shot=Schnappschuss löschen
bc.tv.shap_wait_text=Schnappschuss wird erstellt
======== Boxcontrol - Screenshot
bc.screenshot.create=Schnappschuss
bc.screenshot.delete=Schnappschuss löschen
bc.screenshot.zoom=Schnappschuss zoomen
bc.screenshot.wait_text=Schnappschuss wird erstellt
bc.screenshot.checkenable=OSD und/oder TV muss aktiviert sein!
========= Boxcontrol - Others
bc.channels=Sender

View File

@@ -87,14 +87,8 @@ bc.menue.remote=Remote
bc.menue.lcd_screenshot_desc=make lcd screenshot
bc.menue.lcd_screenshot=LCD Screenshot
bc.menue.lcd_screenshot_desc_ni=lcshot not installed at /bin or /var/bin
bc.menue.osd_screenshot_desc=make osd screenshot
bc.menue.osd_screenshot=OSD Screenshot
bc.menue.osd_screenshot_desc_ni=fbshot not installed at /bin or /var/bin
bc.menue.tv_screenshot_desc=make tv screenshot
bc.menue.tv_screenshot=TV Screenshot
bc.menue.remote_osd_desc=remote and osd
bc.menue.remote_osd=Remote & OSD
bc.menue.remote_osd_desc_ni=dboxshot not installed at /bin or /var/bin
bc.menue.screenshot=Screenshot
bc.menue.screenshot_desc=make screenshots from OSD and/or TV
bc.menue.decrease_volume=decrease volumen
bc.menue.increase_volume=increase volumen
@@ -128,16 +122,12 @@ bc.msg.message_to_screen=Message on screen
bc.msg.popup_to_screen=Message as popup
bc.msg.send_message=send message
======== Boxcontrol - Remote & OSD
bc.osd.shot=Shot
bc.osd.delete_shots=Delete shots
bc.osd.zoom_shot=Zoom shot
bc.osd.shap_wait_text=Take Snapshot
======== Boxcontrol - TV-Screenshot
bc.tv.shot=Shot
bc.tv.delete_shot=Delete shot
bc.tv.shap_wait_text=Take Snapshot
======== Boxcontrol - Screenshot
bc.screenshot.create=Screenshot
bc.screenshot.delete=Delete screenshot
bc.screenshot.zoom=Zoom screenshot
bc.screenshot.wait_text=Create screenshot
bc.screenshot.checkenable=OSD and/or TV must be enabled!
========= Boxcontrol - Others
bc.channels=Channels

View File

@@ -480,7 +480,13 @@ do_fbshot_clear()
rm /tmp/*.bmp
rm /tmp/*.png
}
# -----------------------------------------------------------
# delete screenshots
# -----------------------------------------------------------
do_screenshot_clear()
{
rm -f /tmp/*.png
}
# -----------------------------------------------------------
# Settings Backup/Restore
# -----------------------------------------------------------
@@ -547,7 +553,7 @@ case "$1" in
lcshot) shift 1; do_lcshot $* ;;
fbshot) shift 1; do_fbshot $* ;;
fbshot_clear) do_fbshot_clear ;;
tvshot_clear) rm -f /tmp/screenshot.png ;;
screenshot_clear) do_screenshot_clear ;;
get_update_version) wget -O /tmp/version.txt "http://git.coolstreamtech.de/?p=cst-public-gui-neutrino.git;a=blob_plain;f=src/nhttpd/web/Y_Version.txt" ;;
settings_backup_restore) shift 1; do_settings_backup_restore $* ;;
exec_cmd) shift 1; $* ;;