--- /dev/null
+Makefile.in
+.*.swp
--- /dev/null
+var xmlHttp;
+
+function lightcontrol_callback()
+{
+ if (xmlHttp.readyState == 4)
+ {
+ //alert("HTTP response text " + xmlHttp.responseText.split(" "));
+ lightcolors = xmlHttp.responseText.split(" ");
+ //alert("Red = " + lightcolors[0]);
+ redbox = document.getElementById("red");
+ redbox.value = lightcolors[0];
+ greenbox = document.getElementById("green");
+ greenbox.value = lightcolors[1];
+ bluebox = document.getElementById("blue");
+ bluebox.value = lightcolors[2];
+ whitebox = document.getElementById("white");
+ whitebox.value = lightcolors[3];
+ }
+}
+
+function lightcontrol()
+{
+ xmlHttp.onreadystatechange=lightcontrol_callback;
+ xmlHttp.open("GET","lightcontrol.php",true);
+ xmlHttp.send(null);
+}
+
+function _init()
+{
+ xmlHttp=new XMLHttpRequest();
+ lightcontrol();
+}
+
+function change_light(color, value)
+{
+ xmlHttp.onreadystatechange=lightcontrol_callback;
+ xmlHttp.open("GET","lightcontrol.php?" + color + "=" + value, true);
+ xmlHttp.send(null);
+}
--- /dev/null
+<?php
+ini_set('display_errors', 'On');
+
+// Store the last error/warning message in $php_errormsg.
+ini_set('track_errors', 'On');
+
+// Disable the inclusion of HTML tags in error messages.
+ini_set('html_errors', 'Off');
+
+$lightparameters = "";
+
+if (isset($_GET['red']))
+{
+ $lightparameters .= " -r " . $_GET['red'];
+}
+
+if (isset($_GET['green']))
+{
+ $lightparameters .= " -g " . $_GET['green'];
+}
+
+if (isset($_GET['blue']))
+{
+ $lightparameters .= " -b " . $_GET['blue'];
+}
+
+if (isset($_GET['white']))
+{
+ $lightparameters .= " -w " . $_GET['white'];
+}
+
+if ($lightparameters != "")
+{
+ system("/usr/local/bin/lightcontrol " . $lightparameters);
+}
+
+$output = system('/usr/local/bin/lightcontrol -l', $return);
+#echo $output;
+?>
<html xmlns="http://www.w3.org/1999/xhtml"
xml:lang="en">
<head>
- <title>SVG in XHTML Example</title>
+ <title>Light control</title>
<link rel='stylesheet' type='text/css' href='webif.css'/>
+
+ <script type="text/ecmascript" src="lightcontrol.js">
+ </script>
+
</head>
- <body>
- <h1>Animation with Ecmascript</h1>
+
+ <body onLoad="_init()">
+ <h1>Light control</h1>
+
+<form>
+ Red <input type='text' id='red' onChange='change_light("red", this.value)'/><br/>
+ Green <input type='text' id='green' onChange='change_light("green", this.value)'/><br/>
+ Blue <input type='text' id='blue' onChange='change_light("blue", this.value)'/><br/>
+ White <input type='text' id='white' onChange='change_light("white", this.value)'/><br/>
+</form>
+
<p>
<svg width="1024" height="768" version="1.1"
xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- onload="StartAnimation(evt)" >
+ xmlns:xlink="http://www.w3.org/1999/xlink" >
<script type="text/ecmascript"><![CDATA[
var slide_white;