yWeb/Y_Tools_Screenshot: drop prototype.js; use jquery

Origin commit data
------------------
Branch: ni/coolstream
Commit: aaef51bb8a
Author: vanhofen <vanhofen@gmx.de>
Date: 2023-02-02 (Thu, 02 Feb 2023)

Origin message was:
------------------
- yWeb/Y_Tools_Screenshot: drop prototype.js; use jquery

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2023-02-02 21:55:19 +01:00
parent 1a5e324f02
commit caec54eb9d
4 changed files with 67 additions and 73 deletions

View File

@@ -1,9 +1,10 @@
{=var-set:grab={=find-exec:grab=}=}
{=var-set:fbshot={=find-exec:fbshot=}=}
{=include-block:Y_Blocks.txt;head_ni=}
{=include-block:Y_Blocks.txt;head=}
{=include-block:Y_Blocks.txt;jQuery=}
{=include-block:Y_Blocks.txt;jQuery_ui=}
<script type="text/javascript" src="/Y_Baselib.js"></script>
<script type="text/javascript" src="/prototype.js"></script>
<script type="text/javascript">
//<![CDATA[
var enableOSD;
@@ -12,9 +13,9 @@ var enablePiP;
var interval;
function checkEnable() {
enableOSD = (document.getElementById('checkOSD').checked == true) ? 1 : 0;
enableVideo = (document.getElementById('checkVideo').checked == true) ? 1 : 0;
enablePiP = (document.getElementById('checkPiP').checked == true) ? 1 : 0;
enableOSD = (id('checkOSD').checked == true) ? 1 : 0;
enableVideo = (id('checkVideo').checked == true) ? 1 : 0;
enablePiP = (id('checkPiP').checked == true) ? 1 : 0;
if (enableOSD == 0 && enableVideo == 0) {
alert("{=L:bc.screenshot.checkenable=}");
@@ -27,12 +28,12 @@ function checkEnable() {
return true;
}
function rcsim(_key) {
if(!checkEnable()) return;
if (!checkEnable()) return;
if(_key == "KEY_POWER"){
var __result = trim(loadSyncURL("/control/standby"));
if (__result == "off") {
if(confirm("{=L:bc.control.shutdown.ask=}") != true)
if (confirm("{=L:bc.control.shutdown.ask=}") != true)
return;
}
}
@@ -40,15 +41,15 @@ function rcsim(_key) {
window.setTimeout("do_snapshot()", 750);
}
function do_snapshot() {
if(!checkEnable()) return;
if (!checkEnable()) return;
$('shot').hide();
$('shot').src = "";
$('buttons').hide();
$('status').show();
jQuery('#shot').hide();
jQuery('#shot').attr("src", "");
jQuery('#buttons').hide();
jQuery('#status').show();
var filename = "screenshot";
if (id("filename").value != "") {
if (id('filename').value != "") {
filename = id("filename").value;
}
@@ -76,27 +77,19 @@ function do_showshot(_filename) {
if (_filename == "")
_filename = "screenshot";
$('status').hide();
$('buttons').show();
$('shot').src = "/tmp/"+_filename+".png?"+Math.random();
$('shot').show();
jQuery('#status').hide();
jQuery('#buttons').show();
jQuery('#shot').attr("src", "/tmp/"+_filename+".png?" + Math.random());
jQuery('#shot').show();
}
function do_clearshot(){
$('shot').hide();
$('shot').src = "";
function do_clearshot() {
jQuery('#shot').hide();
jQuery('#shot').attr("src", "");
loadSyncURL("/control/exec?Y_Tools&screenshot_clear");
}
function do_switchrc(){
//NI
/*
if (id('remote').style.display == 'none')
$('remote').show();
else
$('remote').hide();
do_switchrc_txt();
*/
function do_switchrc() {
jQuery('#remote').toggle('slide', {direction: 'left'}, 'slow', function() {
do_switchrc_txt();
});
@@ -104,14 +97,14 @@ function do_switchrc(){
function do_switchrc_txt(){
if (id('remote').style.display == 'none')
$('switchrc').update("{=L:bc.control.remote=} {=L:show=}");
jQuery('#switchrc').text("{=L:bc.control.remote=} {=L:show=}");
else
$('switchrc').update("{=L:bc.control.remote=} {=L:hide=}");
jQuery('#switchrc').text("{=L:bc.control.remote=} {=L:hide=}");
}
function do_reload(){
if (document.getElementById("checkReload").checked)
interval = setInterval(do_snapshot, document.getElementById("inputReload").value + "000");
if (id('checkReload').checked)
interval = setInterval(do_snapshot, id('inputReload').value + "000");
else
clearInterval(interval);
}
@@ -147,8 +140,8 @@ function do_reload(){
<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=}
<img src="/images/wait.gif" alt="{=L:bc.screenshot.wait_text=}"/>
{=L:bc.screenshot.wait_text=}
</div>
</div>
<table cellpadding="0" class="screenshot">
@@ -164,13 +157,13 @@ function do_reload(){
</div>
</div>
<script>
document.getElementById('checkReload').onclick = function() {
id('checkReload').onclick = function() {
if (this.checked ) {
interval = setInterval(do_snapshot, document.getElementById("inputReload").value + "000");
document.getElementById("inputReload").disabled = false;
interval = setInterval(do_snapshot, id("inputReload").value + "000");
id("inputReload").disabled = false;
} else {
clearInterval(interval);
document.getElementById("inputReload").disabled = true;
id("inputReload").disabled = true;
}
};
</script>

View File

@@ -1,24 +1,24 @@
{=include-block:Y_Blocks.txt;head=}
{=include-block:Y_Blocks.txt;jQuery=}
<script type="text/javascript" src="/Y_Baselib.js"></script>
<script type="text/javascript" src="/prototype.js"></script>
<script type="text/javascript">
//<![CDATA[
var interval;
function do_snapshot() {
$('shot').hide();
$('shot').src = "";
$('buttons').hide();
$('status').show();
jQuery('#shot').hide();
jQuery('#shot').attr("src", "");
jQuery('#buttons').hide();
jQuery('#status').show();
// FIXME: any other filename then "glcdscreenshot" seeems broken
var filename = "glcdscreenshot";
if (id("filename").value != "") {
if (id('filename').value != "") {
filename = id("filename").value;
}
loadSyncURL("/control/glcdscreenshot?name"+filename);
loadSyncURL("/control/glcdscreenshot?name="+filename);
do_showshot(filename);
}
@@ -26,21 +26,21 @@ function do_showshot(_filename) {
if (_filename == "")
_filename = "glcdscreenshot";
$('status').hide();
$('buttons').show();
$('shot').src = "/tmp/"+_filename+".png?"+Math.random();
$('shot').show();
jQuery('#status').hide();
jQuery('#buttons').show();
jQuery('#shot').attr("src", "/tmp/"+_filename+".png?" + Math.random());
jQuery('#shot').show();
}
function do_clearshot(){
$('shot').hide();
$('shot').src = "";
jQuery('#shot').hide();
jQuery('#shot').attr("src", "");
loadSyncURL("/control/exec?Y_Tools&screenshot_clear");
}
function do_reload(){
if (document.getElementById("checkReload").checked)
interval = setInterval(do_snapshot, document.getElementById("inputReload").value + "000");
if (id('checkReload').checked)
interval = setInterval(do_snapshot, id('inputReload').value + "000");
else
clearInterval(interval);
}
@@ -60,7 +60,7 @@ function do_reload(){
</div>
<div class="right">
<form onsubmit="do_snapshot(); return false">
{=L:filename=}: <input type="text" value="glcdscreenshot" id="filename" size="10" />
{=L:filename=}: <input type="text" value="glcdscreenshot" id="filename" size="12" />
</form>
</div>
<div class="clear"></div>
@@ -70,8 +70,8 @@ function do_reload(){
<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=}
<img src="/images/wait.gif" alt="{=L:bc.screenshot.wait_text=}"/>
{=L:bc.screenshot.wait_text=}
</div>
</div>
<table cellpadding="0" class="screenshot">
@@ -84,13 +84,13 @@ function do_reload(){
</div>
</div>
<script>
document.getElementById('checkReload').onclick = function() {
id('checkReload').onclick = function() {
if (this.checked ) {
interval = setInterval(do_snapshot, document.getElementById("inputReload").value + "000");
document.getElementById("inputReload").disabled = false;
interval = setInterval(do_snapshot, id('inputReload').value + "000");
id('inputReload').disabled = false;
} else {
clearInterval(interval);
document.getElementById("inputReload").disabled = true;
id('inputReload').disabled = true;
}
};
</script>

View File

@@ -1,16 +1,17 @@
{=include-block:Y_Blocks.txt;head_ni=}
{=include-block:Y_Blocks.txt;head=}
{=include-block:Y_Blocks.txt;jQuery=}
<script type="text/javascript">
//<![CDATA[
var interval;
function do_showshot() {
$('shot').src = "/tmp/lcd4linux.png?"+Math.random();
$('shot').show();
jQuery('#shot').attr("src", "/tmp/lcd4linux.png?" + Math.random());
jQuery('#shot').show();
}
function do_reload(){
if (document.getElementById("checkReload").checked)
interval = setInterval(do_showshot, document.getElementById("inputReload").value + "000");
if (id('checkReload').checked)
interval = setInterval(do_showshot, id('inputReload').value + "000");
else
clearInterval(interval);
}
@@ -40,13 +41,13 @@ function do_reload(){
</div>
</div>
<script>
document.getElementById('checkReload').onclick = function() {
id('checkReload').onclick = function() {
if (this.checked ) {
interval = setInterval(do_showshot, document.getElementById("inputReload").value + "000");
document.getElementById("inputReload").disabled = false;
interval = setInterval(do_showshot, id('inputReload').value + "000");
id('inputReload').disabled = false;
} else {
clearInterval(interval);
document.getElementById("inputReload").disabled = true;
id('inputReload').disabled = true;
}
};
</script>

View File

@@ -1,3 +1,3 @@
version=3.0.7
date=01.02.2023
version=3.0.8
date=02.02.2023
info=NI-Neutrino-Webinterface