summaryrefslogtreecommitdiff
path: root/cam_public
diff options
context:
space:
mode:
authorChristian Franke <nobody@nowhere.ws>2014-01-24 01:02:58 +0100
committerChristian Franke <nobody@nowhere.ws>2014-01-24 01:02:58 +0100
commit5a3aa3fcd3d145884fb769f17795cee3cf6b4b77 (patch)
tree1023c0ec4235fc3db5187be30cba403ecd0fbdc1 /cam_public
parent573a798156423707ca770c19c9cfb0b7bb6a5808 (diff)
Add main.js to repository
Diffstat (limited to 'cam_public')
-rw-r--r--cam_public/main.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/cam_public/main.js b/cam_public/main.js
new file mode 100644
index 0000000..134f194
--- /dev/null
+++ b/cam_public/main.js
@@ -0,0 +1,20 @@
+window.setTimeout(function() {
+ var actions = {
+ left : null,
+ right : null,
+ up : null,
+ down : null
+ };
+
+ for (var action in actions) {
+ (function() {
+ var laction = action;
+ document.getElementById(action).onclick = function() {
+ var request = new XMLHttpRequest();
+ request.open("get", "../control/" + laction, false);
+ request.send();
+ return false;
+ };
+ }());
+ }
+}, 1000);