Antwort an „Reschi“ verfassen

Hier ist mal der komplette Code:

<html>
<head>
<title>myAVR-Server</title>
<meta name="author" content="www.myAVR.de">
<meta http-equiv="expires" content="8640000">
<link rel="stylesheet" href="../allg/myweb.css" type="text/css">
<script src="../allg/allg.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
//### Translation Array for JS-Script functions ###
var lang=new Array();
lang["setStatusOK"]			="aktuelle Daten anzeigen";
lang["setStatusERR"]		="Fehler beim Abfragen!";
lang["verifyCFG"]			="Verifiziere Konfiguration";
lang["plsWait"]				="Bitte warten...";
lang["sendRequest"]			="Sende Abfrage";
lang["timeoutRequest"]		="Timeout beim Abfragen!";
//### JS-Script ###
var leds = new Array(0,0);
//iframe object
var idoc = 0;
var idocTmp='<html><body style="font-family:monospace;font-size:10pt;padding-left:2px;margin:0;">text</body></html>';
var idocTxt="";

var aktiv = 0;	//timeout check

function checkTimeout(typ)
{
	if (typ)
	{
		if (aktiv==0)
			aktiv = window.setTimeout("iframeTimeout()",10000);
	}
	else
	{
		window.clearTimeout(aktiv);
		aktiv=0;
	}
}
function setStatus(inp)
{
	checkTimeout();
	if (inp)
	{
		myEth.readState(inp);
		setIdocTextAdd(lang["setStatusOK"]);
	}
	else
	{
		setIdocText(lang["setStatusERR"]);
		showButtons();
		return;
	}
	//gruene led an?
    if (myEth.pin[20].aVal==1)
    {
        $("imgledg").style.zIndex="2";
        leds[0]=1;
    }
    else
    {
        $("imgledg").style.zIndex="0";
        leds[0]=0;
    }
    //rote led an?
    if (myEth.pin[21].aVal==1)
    {
        $("imgledr").style.zIndex="2";
        leds[1]=1;
    }
    else
    {
    	$("imgledr").style.zIndex="0";
        leds[1]=0;
    }
	showButtons();
}
function setOK()
{
	checkTimeout();
	setIdocTextAdd(lang["verifyCFG"]);
	checkTimeout(1);
	setTimeout('setIdocSrc("exethled/eth_leds.htm")',500);
}
function switchLED(pinnr,id)
{
	showButtons(1);
	setIdocText(lang["plsWait"]);
	if(leds[pinnr-20]==0)
		leds[pinnr-20]=1;
	else
		leds[pinnr-20]=0;
    var led="../allg/setpin.htm?myChangeCmd=%B0o"+pinnr+"%7E"+leds[pinnr-20]+"%B0";
	showButtons(1);
	checkTimeout(1);
	setTimeout('setIdocSrc("'+led+'")',500);
}
//buttons anzeigen/ausblenden
function showButtons(typ)
{
	switch(typ)
	{
		case 1:
			onoff("btnGreen");onoff("btnGreenDisabled",1);onoff("btnRed");onoff("btnRedDisabled",1);		
			break;
		default:
			onoff("btnGreen",1);onoff("btnGreenDisabled");onoff("btnRed",1);onoff("btnRedDisabled");		
			break;
	}
}
//globales idoc obj
function setIdocSrc(url)
{
	setIdocTextAdd(lang["sendRequest"],1);
	$("statusframe").src=url+"&"+(Math.round(Math.random()*1000000));
}
function setIdocText(text)
{
	text=idocTmp.replace(/text/,text);
	idoc.document.open();
	idoc.document.write(text);
    idoc.document.close();
}
function setIdocTextAdd(text,clear)
{
	if (clear)
		idocTxt="";
	idocTxt+=text+"<br>";
	text=idocTmp.replace(/text/,idocTxt);
	idoc.document.open();
	idoc.document.write(text);
    idoc.document.close();
}
function iframeTimeout()
{
	window.clearTimeout(aktiv);
	setIdocText('<span style="color:red;">'+lang["timeoutRequest"]+'</span>');
	showButtons();
}

var test="°c0°";
function onloadDo()
{
	if (!idoc)
		idoc=$F("statusframe");
    initmyEth();
    myEth.checkWeb();
    if (myEth.active)
    {
		showButtons(1);
		setIdocText(lang["plsWait"]);
		checkTimeout(1);
        setTimeout('setIdocSrc("exethled/eth_leds.htm")',50);
    }else
        onoff("noethweb",1);
    var test="";
    doRequest(test);
}
</script>
<style type="text/css">
button {padding:3px;margin:5px;}
</style>
</head>

<body onLoad="onloadDo();">

<table cellpadding="0" cellspacing="0" id="main">
    <tr valign="top"><td class="bordl logo">
        <a href="index.htm" class="logoa" title="Zur Startseite">
        <span class="logo1">myAVR</span><br><span class="logo2">myEthernet</span>
        </a>
    </td><td class="bordr headline">
        <span class="mainhl">LED Ansteuerung</span>
        <span id="noethweb" class="warn"><br>Es konnte kein aktiver myEthernet-Webserver gefunden werden!</span>
    </td></tr>
    <tr style="height:10px;"><td></td><td></td></tr>
    <tr valign="top"><td class="navi bordl">
        <a href="mystate.htm" title="Aktueller Status myEthernet">Status</a>
        <a href="setup.htm" title="myEthernet konfigurieren">Konfiguration</a>
        <a href="techdoc.htm" title="Technische Dokumentation zum myEthernet">Technische Doku</a>
        <a href="example.htm" title="Bilder und Anwendungsbeispiele">Bsp-Anwendungen mit:</a>
        <a style="margin-left:25px;" href="exusb.htm">myAVR Board MK 2</a>
        <a style="margin-left:25px;" href="extemps.htm">Temperatursensor</a>
        <a class="curr" style="margin-left:25px;" href="exethled.htm">Status-LEDs</a>
        <a style="margin-left:25px;" href="exledmat.htm">LED-Matrix</a>
        <a style="margin-left:25px;" href="exrameep.htm">Ram und Eeprom</a>
        <a href="kontakt.htm" title="Kontakt" style="margin-top:2em;">Kontakt</a>
        <a href="shinweis.htm" title="Allgemeine Sicherheitshinweise">Sicherheitshinweise</a>
    </td><td class="page bordr">
    <h4>Steuerung der Status-LEDs</h4>
    <p>
        <img src="../pic/led_aus.jpg" alt="Anwendungsbeispiel LEDs schalten" title="Anwendungsbeispiel LEDs schalten"
            width="280" height="160" style="z-index:1;position:relative;left:0;">
        <img src="../pic/led_r.jpg" alt="" title="LED rot" id="imgledr"
            style="z-index:0;position:relative;left:-127px;top:-65px;">
        <img src="../pic/led_g.jpg" alt="" title="LED gr&uuml;n" id="imgledg"
            style="z-index:0;position:relative;left:-194px;top:-65px;">
        <span class="plcom">myEthernet Status-LEDs</span><span id="stathqload1" class="plstat"></span>
        <br style="clear:both;"><br>
        Die Status-LEDs werden durch die Firmware des myEthernet-Webservers in der Initialisierungsphase benutzt.
        Die gr&uuml;ne LED signalisiert Betriebsbereitschaft und die rote LED Fehler beim Hochfahren des Webservers.
        Nach der Initialisierung k&ouml;nnen die LEDs durch den Anwender benutzt werden. Sollten Betriebsfehler durch
        die Firmware erkannt werden, ist die Firmware dominant und schaltet die rote LED zu.
        <br><br>
        <a id="btnGreen" href="javascript:switchLED(20);" class="zoom" style="padding:4px;" title="Gr&uuml;ne LED schalten">Gr&uuml;n</a>
        <a id="btnGreenDisabled" class="zoom" style="padding:4px;display:none;background-color:#CCC" title="Gr&uuml;ne LED schalten">Gr&uuml;n</a>
        <a id="btnRed" href="javascript:switchLED(21);" class="zoom" style="padding:4px;" title="Rote LED schalten">Rot</a>
        <a id="btnRedDisabled" class="zoom" style="padding:4px;display:none;background-color:#CCC" title="Rote LED schalten">Rot</a><br><br>
		<iframe class="statusframe" id="statusframe" name="statusframe" frameborder="0" style="border:0;height:35px;"></iframe>
    </p>
    </td></tr>
</table>

</body>
</html>

Wo wird hier setStatus(inp) und setOK() aufgerufen ???

freiwillig, öffentlich sichtbar
freiwillig, öffentlich sichtbar
freiwillig, öffentlich sichtbar

Ihre Identität in einem Cookie zu speichern erlaubt es Ihnen, Ihre Beiträge zu editieren. Außerdem müssen Sie dann bei neuen Beiträgen nicht mehr die Felder Name, E-Mail und Homepage ausfüllen.

abbrechen