62 lines
1.5 KiB
HTML
62 lines
1.5 KiB
HTML
|
<!DOCTYPE html>
|
||
|
<html>
|
||
|
<head>
|
||
|
<title>Bootstrap 101 Template</title>
|
||
|
<!-- Bootstrap -->
|
||
|
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
|
||
|
<style type="text/css">
|
||
|
body { margin: 20px; }
|
||
|
.kasten {
|
||
|
display:block;
|
||
|
background-color: green;
|
||
|
width: 30%;
|
||
|
height: 100px;
|
||
|
padding: 10px;
|
||
|
}
|
||
|
</style>
|
||
|
<script src="js/jquery-1.8.3.min.js"></script>
|
||
|
</head>
|
||
|
<body>
|
||
|
|
||
|
|
||
|
<div class="row">
|
||
|
<div class="span4 kasten" id="wabe1" data-channel="/2/multitoggle/1/1" data-value="1">
|
||
|
</div>
|
||
|
<div class="span4 kasten" id="wabe2" data-channel="/2/multitoggle/1/1" data-value="0">
|
||
|
</div>
|
||
|
<div class="span4 kasten" id="wabe3" data-channel="/2/multitoggle/1/2">
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
<script src="/socket.io/socket.io.js"></script>
|
||
|
<script>
|
||
|
|
||
|
|
||
|
var socket = io.connect('http://localhost');
|
||
|
socket.on('news', function (data) {
|
||
|
console.log(data);
|
||
|
//
|
||
|
//handleDMXData(data);
|
||
|
});
|
||
|
|
||
|
$(document).ready(function(evnt) {
|
||
|
|
||
|
$(document).delegate('.kasten', 'click', function(event) {
|
||
|
var channel = $(this).data('channel');
|
||
|
var value = $(this).data('value');
|
||
|
if(channel != null) {
|
||
|
|
||
|
socket.emit('oscmessage', { chan: channel, val: value });
|
||
|
|
||
|
}
|
||
|
|
||
|
});
|
||
|
|
||
|
});
|
||
|
</script>
|
||
|
|
||
|
<script src="js/bootstrap.min.js"></script>
|
||
|
</body>
|
||
|
</html>
|