182 lines
7.0 KiB
Plaintext
182 lines
7.0 KiB
Plaintext
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
|
<!DOCTYPE html>
|
|
<%@taglib prefix="spring" uri="http://www.springframework.org/tags"%>
|
|
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
<title>WebSockets</title>
|
|
|
|
<link type="text/css" href="<c:url value="/resources/css/screen.css"/>" rel="stylesheet" />
|
|
<link type="text/css" href="<c:url value="/resources/css/styles.css"/>" rel="stylesheet" />
|
|
<link type="text/css" href="<c:url value="/resources/css/dark-hive/jquery-ui-1.8.18.custom.css"/>" rel="stylesheet" />
|
|
<script type="text/javascript" src="<c:url value="/resources/js/jquery-1.7.1.min.js" />"></script>
|
|
<script type="text/javascript" src="<c:url value="/resources/js/jquery-ui-1.8.18.custom.min.js" />"></script>
|
|
<script type="text/javascript" src="<c:url value="/resources/js/jquery.cookie.js" />"></script>
|
|
<script type="text/javascript" src="<c:url value="/resources/js/backbone-min.js" />"></script>
|
|
<script type="text/javascript" src="<c:url value="/resources/js/jquery.colorpicker.js" />"></script>
|
|
<script type="text/javascript" src="<c:url value="/resources/js/jquery.mousewheel.js" />"></script>
|
|
|
|
<script type="text/javascript">
|
|
$(document).ready(
|
|
function() {
|
|
var dataChanged = false;
|
|
var par56eins = $.parseJSON('{"deviceId":1, "options": {"red":0,"blue":0,"green":0} }');
|
|
var volumes = $.parseJSON('{"room1":0,"room2":0,"room3":0,"room4":0}');
|
|
|
|
function sendData(data) {
|
|
$.ajax({
|
|
type: 'POST',
|
|
url: "/control/devices/1",
|
|
contentType: "application/json",
|
|
dataType: "json",
|
|
data: JSON.stringify(data)
|
|
});
|
|
}
|
|
|
|
var senden = function sendOutAllDevices() {
|
|
if(dataChanged) {
|
|
dataChanged = false;
|
|
sendData(par56eins);
|
|
}
|
|
};
|
|
|
|
// vielleicht baut man lieber was mit setTimeout und setzt das jeweils neu wenn man daten ändert
|
|
// das könnte den Browser entlasten, sofern den das 200ms Aufrufen überhaupt stört :D
|
|
window.setInterval(senden, 200);
|
|
|
|
$("#slider1").slider({ min: 0, max: 100, slide: function(event, ui) {
|
|
volumes.room1 = ui.value;
|
|
dataChanged = true;
|
|
} });
|
|
|
|
$("#slider2").slider({ min: 0, max: 100, slide: function(event, ui) {
|
|
volumes.room2 = ui.value;
|
|
dataChanged = true;
|
|
} });
|
|
|
|
$("#slider3").slider({ min: 0, max: 100, slide: function(event, ui) {
|
|
volumes.room3 = ui.value;
|
|
dataChanged = true;
|
|
} });
|
|
|
|
$("#slider4").slider({ min: 0, max: 100, slide: function(event, ui) {
|
|
volumes.room4 = ui.value;
|
|
dataChanged = true;
|
|
} });
|
|
|
|
$("#buttonLampe1").click(function() {
|
|
|
|
$.getJSON('/control/devices/1', function(data) {
|
|
|
|
$("#messages").append("type: " + data.type + " name=" + data.deviceName + "<br/>" );
|
|
});
|
|
|
|
});
|
|
$(document).ready(function() {
|
|
$("#tabs").tabs();
|
|
$("#v-tabs").tabs().addClass('ui-tabs-vertical');
|
|
$(".lampel .circle").click(function() {
|
|
if($(this).hasClass('black')){
|
|
$(this).removeClass('black');
|
|
} else {
|
|
$(this).addClass('black');
|
|
}
|
|
});
|
|
var colorpicker_raum1 = new jQuery.ColorPicker('#colorpicker-raum1', {
|
|
imagepath: '/resources/images/colorpicker/'
|
|
});
|
|
});
|
|
}
|
|
);
|
|
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<h1>CTDO Raumsteuerung</h1>
|
|
|
|
<div id="tabs">
|
|
<ul>
|
|
<li><a href="#tabs-1">Global</a></li>
|
|
<li><a href="#tabs-2">Raum 1</a></li>
|
|
<li><a href="#tabs-3">Raum 2</a></li>
|
|
<li><a href="#tabs-4">Raum 3</a></li>
|
|
<li><a href="#tabs-5">Raum 4</a></li>
|
|
</ul>
|
|
<div id="tabs-1">
|
|
|
|
<div class="buzzer">
|
|
<span class="circle red">Zu</span>
|
|
<button>Buzzern</button>
|
|
</div>
|
|
<div class="buzzer">
|
|
<span class="circle green">Auf</span>
|
|
<button>Buzzern</button>
|
|
</div>
|
|
</div>
|
|
<div id="tabs-2">
|
|
<div id="v-tabs" class="inner-tabs-container">
|
|
<ul>
|
|
<li><a href="#v-tabs-1">Licht</a></li>
|
|
<li><a href="#v-tabs-2">Musik</a></li>
|
|
<li><a href="#v-tabs-3">Lampel</a></li>
|
|
</ul>
|
|
<div id="v-tabs-1">
|
|
<div id="colorpicker-raum1"></div>
|
|
<select multiple="multiple">
|
|
<option>Par 56 Lampe 1</option>
|
|
<option>Par 56 Lampe 2</option>
|
|
<option>Par 56 Lampe 3</option>
|
|
<option>Par 56 Lampe 4</option>
|
|
<option>Par 56 Lampe 5</option>
|
|
<option>Par 56 Lampe 6</option>
|
|
<option>Par 56 Lampe 7</option>
|
|
|
|
</select>
|
|
</div>
|
|
<div id="v-tabs-2">
|
|
<label for="slider1">Lautstärke Raum 1:</label><div id="slider1" class="slider"></div>
|
|
</div>
|
|
<div id="v-tabs-3">
|
|
<div class="lampel">
|
|
<span class="circle red" title="click to toggle"></span>
|
|
<span class="circle yellow" title="click to toggle"></span>
|
|
<span class="circle green" title="click to toggle"></span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="switch">
|
|
Raumlicht:<br />
|
|
<input type="radio" name="raum-1-licht">An <input type="radio" name="raum-1-licht" checked="checked">Aus
|
|
</div>
|
|
|
|
</div>
|
|
<div id="tabs-3">
|
|
|
|
<label for="slider2">Lautstärke Raum 2:</label><div id="slider2" class="slider"></div>
|
|
</div>
|
|
|
|
<div id="tabs-4">
|
|
|
|
<label for="slider3">Lautstärke Raum 3:</label><div id="slider3" class="slider"></div>
|
|
|
|
</div>
|
|
|
|
<div id="tabs-5">
|
|
|
|
<label for="slider4">Lautstärke Raum 4:</label><div id="slider4" class="slider"></div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<input type="button" value="Get Device 1" id="buttonLampe1" />
|
|
|
|
<div id="messages"></div>
|
|
|
|
|
|
</body>
|
|
</html> |