diff --git a/data/htdocs/anim.js b/data/htdocs/anim.js new file mode 100644 index 0000000..65bb43d --- /dev/null +++ b/data/htdocs/anim.js @@ -0,0 +1,30 @@ +function callURL(url) +{ + var xmlhttp = new XMLHttpRequest(); + xmlhttp.open("GET", url, true); + xmlhttp.send(); +} + +function getjson(url, handler_func) +{ + var xmlhttp = new XMLHttpRequest(); + xmlhttp.onreadystatechange = function () { + if(this.readyState == 4 && this.status == 200) { + var data = JSON.parse(this.responseText); + handler_func(data); + } + } + + xmlhttp.open("GET", url, true); + xmlhttp.send(); +} + +function getAnimList(handler_func) +{ + return getjson("/api/listanim", handler_func); +} + +function setAnim(id) +{ + callURL("/api/setanim?anim=" + id); +} diff --git a/data/htdocs/index.html b/data/htdocs/index.html index 59a8195..483fe57 100644 --- a/data/htdocs/index.html +++ b/data/htdocs/index.html @@ -1,10 +1,38 @@ - Lampensteuerung + + Lampensteuerung + + - -

Lampensteuerung

-

It works!

+ +

Lampensteuerung

+
+

+ + + +

+
- \ No newline at end of file +