Code beautifying, fix spaces

This commit is contained in:
2015-06-01 14:10:15 +02:00
parent 041b2c13d6
commit 69e8361ede

View File

@ -6,64 +6,64 @@
<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>
$("document").ready(function() {
$("#target").hide();
$("#button").click(function() {
var $v = "nix";
if ($("#flip-checkbox-1").is(":checked")) {
$v = "on";
} else {
$v = "off";
}
var $w = $("#target").text();
$.ajax({
url: 'http://172.16.2.15:8080/switch?target=' + $w + '&state=' + $v
});
// $("#bla").text($v + $w);
});
$(".switchlink").click(function() {
var $v = $(this).attr("id");
var $w = $("span:first", this).text();
$("#dialogTitle").text($w);
$("#target").text($v);
});
(function worker1() {
$.ajax({
url: 'http://172.16.2.15:8080/kitchen',
success: function(data) {
$('#stateKueche').text(data);
},
complete: function() {
// Schedule the next request when the current one's complete
setTimeout(worker1, 1000);
}
});
})();
(function worker2() {
$.ajax({
url: 'http://172.16.2.15:8080/oven',
success: function(data) {
$('#stateHerd').text(data);
},
complete: function() {
// Schedule the next request when the current one's complete
setTimeout(worker2, 1000);
}
});
})();
(function worker3() {
$.ajax({
url: 'http://172.16.2.15:8080/laundry',
success: function(data) {
$('#stateWaschkueche').text(data);
},
complete: function() {
// Schedule the next request when the current one's complete
setTimeout(worker3, 1000);
}
});
})();
});
$("document").ready(function() {
$("#target").hide();
$("#button").click(function() {
var $v = "nix";
if ($("#flip-checkbox-1").is(":checked")) {
$v = "on";
} else {
$v = "off";
}
var $w = $("#target").text();
$.ajax({
url: 'http://172.16.2.15:8080/switch?target=' + $w + '&state=' + $v
});
// $("#bla").text($v + $w);
});
$(".switchlink").click(function() {
var $v = $(this).attr("id");
var $w = $("span:first", this).text();
$("#dialogTitle").text($w);
$("#target").text($v);
});
(function worker1() {
$.ajax({
url: 'http://172.16.2.15:8080/kitchen',
success: function(data) {
$('#stateKueche').text(data);
},
complete: function() {
// Schedule the next request when the current one's complete
setTimeout(worker1, 1000);
}
});
})();
(function worker2() {
$.ajax({
url: 'http://172.16.2.15:8080/oven',
success: function(data) {
$('#stateHerd').text(data);
},
complete: function() {
// Schedule the next request when the current one's complete
setTimeout(worker2, 1000);
}
});
})();
(function worker3() {
$.ajax({
url: 'http://172.16.2.15:8080/laundry',
success: function(data) {
$('#stateWaschkueche').text(data);
},
complete: function() {
// Schedule the next request when the current one's complete
setTimeout(worker3, 1000);
}
});
})();
});
</script>
<style>
.red { background-color: red; }