summaryrefslogtreecommitdiffstats
path: root/Lasers_und_stuff/templates/status.html
diff options
context:
space:
mode:
Diffstat (limited to 'Lasers_und_stuff/templates/status.html')
-rw-r--r--Lasers_und_stuff/templates/status.html64
1 files changed, 50 insertions, 14 deletions
diff --git a/Lasers_und_stuff/templates/status.html b/Lasers_und_stuff/templates/status.html
index 233476b..0b1b24d 100644
--- a/Lasers_und_stuff/templates/status.html
+++ b/Lasers_und_stuff/templates/status.html
@@ -2,33 +2,69 @@
{% block body %}
<script type=text/javascript src="{{url_for('static', filename='jquery.min.js') }}"> </script>
<script type=text/javascript>
- $(document).ready(function(){
- //
- $('#dupa').text("I like bananas");
- });
- function pop_banana() {
- $('#banana').html('<a href="http://ranchochilamate.com/wp/wp-content/uploads/2010/10/banana.jpg">Click</a>');
+ function update() {
+ update_status();
+ window.setTimeout(update, 100000000);
}
+ $("document").ready(function(data) {
+ update();
+ });
+
+ function move_right() {
$.post("/right/20", function(data) {
- $('#dupa').html(data);
+ update_status();
+ });
+ }
+
+ function move_left() {
+ $.post("/left/20", function(data) {
+ update_status();
});
+ }
+
+ function move_down() {
+ $.post("/down/20", function(data) {
+ update_status();
+ });
+ }
function move_up() {
$.post("{{url_for('move_up', amount="20")}}", function(data) {
- $('#dupa').html(data);
+ update_status();
});
}
+
+ function fire() {
+ $.post("/fire", function(data) {
+
+ });
+ }
+
+ function stop_fire() {
+ $.post("/stop_fire", function(data) {
+
+ });
+ }
+
+ function update_status() {
+ $.get("/status", function(data) {
+ $('#status').html(data);
+ });
+ }
+
</script>
<div style="width: 400px; height: 400px; margin-top: -200px; margin-left: -200px; position: absolute; top: 50%; left: 50%;">
+ <h2>Hello in cannon controller, adjust angles!</h2>
+ <p>Angles can be in range 0:255</p>
<a onclick="move_up()">Up</a>
- <a href="/down/20">Down</a>
- <a href="/left/20">Left</a>
- <a href ="/right/20"" onclick="move_right()">Right</a>
- <p id="dupa" onclick="move_right()"></p>
- <p id="banana"></p>
- <h2>Status</h2> <p>{{data}}</p></div>
+ <a onclick="move_down()">Down</a>
+ <a onclick="move_left()">Left</a>
+ <a onclick="move_right()">Right</a>
+ <p><a onclick="fire()">Fire!</a> <a onclick="stop_fire()">Stop</a></p>
+
+ <h2>Status: </h2> <p id="status">{{data}}</p></div>
</body>
{% endblock %} \ No newline at end of file