loupiottes/DMX-2.0/html/page.html
2014-01-19 16:18:59 +00:00

158 lines
No EOL
4.5 KiB
HTML

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="/res/css/theme/jquery-ui.css">
<script src="/res/js/jquery-1.9.1.js"></script>
<script src="/res/js/jquery-ui.js"></script>
<script type="text/javascript">
function hop(code)
{
A=parseInt(this.dimmer.value)+parseInt(code);
A=Math.min(A,512);
A=Math.max(A,1);
this.dimmer.value=A;
B=$( "#slider").slider( "value" );
trans1(form.univ.value,form.dimmer.value,B);
}
function hop2(code)
{
A=parseInt(this.circuit.value)+parseInt(code);
A=Math.max(A,1);
this.circuit.value=A;
B=$( "#slider2").slider( "value" );
trans2(form2.circuit.value,B);
}
function Balckout()
{
$( "#slider2").slider( "value",0 );
//B=$( "#slider2").slider( "value" );
//trans2(form2.circuit.value,B);
}
function Full()
{
$( "#slider2").slider( "value",255 );
//B=$( "#slider2").slider( "value" );
//trans2(form2.circuit.value,B);
}
function remplir()
{
$( "#slider" ).slider({
orientation: "horizontal",
max: 255,
value: 0,
slide: refreshSwatch,
change: refreshSwatch
});
$( "#slider2" ).slider({
orientation: "horizontal",
max: 255,
value: 0,
slide: refreshSwatch2,
change: refreshSwatch2
});
}
function refreshSwatch()
{
B=$( "#slider").slider( "value" );
trans1(form.univ.value,form.dimmer.value,B);
}
function refreshSwatch2()
{
B=$( "#slider2").slider( "value" );
trans2(form2.circuit.value,B);
}
function trans1(univ,dimmer,val)
{
texte = file('/page.html?id=2&univ='+escape(univ)+'&dimmer='+escape(dimmer)+'&val='+escape(val));
}
function trans2(circuit,val)
{
texte = file('/page.html?id=3&circuit='+escape(circuit)+'&val='+escape(val));
}
function file(fichier)
{
xhr_object = new XMLHttpRequest();
xhr_object.open("GET", fichier, false);
xhr_object.send(null);
if(xhr_object.readyState == 4) return(xhr_object.responseText);
else return(false);
}
</script>
</head>
<body bgcolor="#FFFFBB">
<h1>Commande</h1>
<span id="toto">
<div id="univers">
<form name="form">
<table border="0">
<tr>
<th>
<label>Univers</label>
</th><td>
<select name="univ">
<UNIVLIST>
</select>
</td></tr><tr>
<th rowspan="3" >
<label>Dimmer</label>
</th><td>
<input type="button" value="C+" Onclick="hop('100')"><input type="button" value="D+" Onclick="hop('10')">
<input type="button" value="U+" Onclick="hop('1')">
</td>
</tr> <tr>
<td><input type="text" name="dimmer" id="dimmer" value="1" size="5" /></td>
</tr><tr>
<td><input type="button" value="C-" Onclick="hop('-100')"><input type="button" value="D-" Onclick="hop('-10')">
<input type="button" value="U-" Onclick="hop('-1')"></td>
</tr><tr><td> </td></tr><tr>
<td colspan="2">
<div id="slider"></div>
<td>
</tr>
</table>
</form>
</div>
<div id="circuits">
<form name="form2">
<table border="0">
<tr>
<th rowspan="3" >
<label>Circuit</label>
</th><td>
<input type="button" value="C+" Onclick="hop2('100')"><input type="button" value="D+" Onclick="hop2('10')">
<input type="button" value="U+" Onclick="hop2('1')" >
</td></tr><tr>
<td><input type="text" name="circuit" id="circuit" value="1" size="5" /></td>
</tr><tr>
<td><input type="button" value="C-" Onclick="hop2('-100')"><input type="button" value="D-" Onclick="hop2('-10')">
<input type="button" value="U-" Onclick="hop2('-1')" >
</tr><tr><td> </td> </tr><tr>
<td colspan="2">
<div id="slider2"></div>
<td>
</tr>
<tr><td align="left"><input type="button" value="Blackout" Onclick="Balckout()"></td>
<td align="right"><input type="button" value="Full" Onclick="Full()"></td></tr>
</table>
<script>remplir();</script>
</form>
</div>
</span>
</body>
</html>