diff --git a/templates/drag_example.html b/templates/drag_example.html index 9ea0b93..b3e8184 100644 --- a/templates/drag_example.html +++ b/templates/drag_example.html @@ -26,6 +26,24 @@ + {% if robot_pos is none %} +
+ + + + + +
+ {% else %} +
+ + + + + +
+ {% endif %} + @@ -43,7 +61,12 @@ var box = $(".box"); var mainCanvas = $(".main-canvas"); + + $("#btnSubmit").click(function () { + var robot_x = $("#inputRobotX"); + var robot_y = $("#inputRobotY"); + //alert("button"); for (i = 0; i < 9; i++) { var c = document.getElementsByClassName("box card" + String(i)); @@ -51,10 +74,9 @@ $(c).hide(); } } - $(please_wait).show(); - $.post("/send_cmds", "", function (data) { + $.post("/send_cmds", { "x" : robot_x.val(), "y": robot_y.val()}, function (data) { console.log(data); if (data === 'OK') { location.reload(); // reload page to get new cards for next round