Code beautifying, fix spaces
This commit is contained in:
116
index.html
116
index.html
@ -6,64 +6,64 @@
|
|||||||
<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
|
<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
|
||||||
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
|
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
$("document").ready(function() {
|
$("document").ready(function() {
|
||||||
$("#target").hide();
|
$("#target").hide();
|
||||||
$("#button").click(function() {
|
$("#button").click(function() {
|
||||||
var $v = "nix";
|
var $v = "nix";
|
||||||
if ($("#flip-checkbox-1").is(":checked")) {
|
if ($("#flip-checkbox-1").is(":checked")) {
|
||||||
$v = "on";
|
$v = "on";
|
||||||
} else {
|
} else {
|
||||||
$v = "off";
|
$v = "off";
|
||||||
}
|
}
|
||||||
var $w = $("#target").text();
|
var $w = $("#target").text();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: 'http://172.16.2.15:8080/switch?target=' + $w + '&state=' + $v
|
url: 'http://172.16.2.15:8080/switch?target=' + $w + '&state=' + $v
|
||||||
});
|
});
|
||||||
// $("#bla").text($v + $w);
|
// $("#bla").text($v + $w);
|
||||||
});
|
});
|
||||||
$(".switchlink").click(function() {
|
$(".switchlink").click(function() {
|
||||||
var $v = $(this).attr("id");
|
var $v = $(this).attr("id");
|
||||||
var $w = $("span:first", this).text();
|
var $w = $("span:first", this).text();
|
||||||
$("#dialogTitle").text($w);
|
$("#dialogTitle").text($w);
|
||||||
$("#target").text($v);
|
$("#target").text($v);
|
||||||
});
|
});
|
||||||
(function worker1() {
|
(function worker1() {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: 'http://172.16.2.15:8080/kitchen',
|
url: 'http://172.16.2.15:8080/kitchen',
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
$('#stateKueche').text(data);
|
$('#stateKueche').text(data);
|
||||||
},
|
},
|
||||||
complete: function() {
|
complete: function() {
|
||||||
// Schedule the next request when the current one's complete
|
// Schedule the next request when the current one's complete
|
||||||
setTimeout(worker1, 1000);
|
setTimeout(worker1, 1000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
(function worker2() {
|
(function worker2() {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: 'http://172.16.2.15:8080/oven',
|
url: 'http://172.16.2.15:8080/oven',
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
$('#stateHerd').text(data);
|
$('#stateHerd').text(data);
|
||||||
},
|
},
|
||||||
complete: function() {
|
complete: function() {
|
||||||
// Schedule the next request when the current one's complete
|
// Schedule the next request when the current one's complete
|
||||||
setTimeout(worker2, 1000);
|
setTimeout(worker2, 1000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
(function worker3() {
|
(function worker3() {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: 'http://172.16.2.15:8080/laundry',
|
url: 'http://172.16.2.15:8080/laundry',
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
$('#stateWaschkueche').text(data);
|
$('#stateWaschkueche').text(data);
|
||||||
},
|
},
|
||||||
complete: function() {
|
complete: function() {
|
||||||
// Schedule the next request when the current one's complete
|
// Schedule the next request when the current one's complete
|
||||||
setTimeout(worker3, 1000);
|
setTimeout(worker3, 1000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
.red { background-color: red; }
|
.red { background-color: red; }
|
||||||
|
Reference in New Issue
Block a user