diff options
| author | manuel <manuel@mausz.at> | 2013-12-25 13:25:16 +0100 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2013-12-25 13:25:16 +0100 |
| commit | 0c8c9ad976879f7c90f9915a60845ccb0cdb337d (patch) | |
| tree | 162951b4713f3836f4114958a423e2c90ecf9c6b /htdocs/app | |
| download | webiopi-0c8c9ad976879f7c90f9915a60845ccb0cdb337d.tar.gz webiopi-0c8c9ad976879f7c90f9915a60845ccb0cdb337d.tar.bz2 webiopi-0c8c9ad976879f7c90f9915a60845ccb0cdb337d.zip | |
initial commit
Diffstat (limited to 'htdocs/app')
| -rw-r--r-- | htdocs/app/devices-monitor/index.html | 36 | ||||
| -rw-r--r-- | htdocs/app/gpio-header/index.html | 18 | ||||
| -rw-r--r-- | htdocs/app/gpio-list/index.html | 28 | ||||
| -rw-r--r-- | htdocs/app/serial-monitor/index.html | 64 |
4 files changed, 146 insertions, 0 deletions
diff --git a/htdocs/app/devices-monitor/index.html b/htdocs/app/devices-monitor/index.html new file mode 100644 index 0000000..6e969dc --- /dev/null +++ b/htdocs/app/devices-monitor/index.html | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | ||
| 2 | <html> | ||
| 3 | <head> | ||
| 4 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
| 5 | <meta name="viewport" content = "height = device-height, width = 420, user-scalable = no" /> | ||
| 6 | <title>WebIOPi | Devices Monitor</title> | ||
| 7 | <script type="text/javascript" src="/webiopi.js"></script> | ||
| 8 | <script type="text/javascript"> | ||
| 9 | webiopi().ready(function() { | ||
| 10 | $.get("/devices/*", function(data) { | ||
| 11 | var content = $("#content"); | ||
| 12 | for (i in data) { | ||
| 13 | if (data[i].type != "Serial") { | ||
| 14 | var device = webiopi().newDevice(data[i].type, data[i].name); | ||
| 15 | if (device) { | ||
| 16 | device.element = $("<div>"); | ||
| 17 | content.append(device.element); | ||
| 18 | device.refreshUI(); | ||
| 19 | } | ||
| 20 | } | ||
| 21 | } | ||
| 22 | }); | ||
| 23 | }); | ||
| 24 | </script> | ||
| 25 | <style type="text/css"> | ||
| 26 | button, .FunctionBasic { | ||
| 27 | width: 50px; | ||
| 28 | } | ||
| 29 | </style> | ||
| 30 | </head> | ||
| 31 | <body> | ||
| 32 | <h1>Devices Monitor</h1> | ||
| 33 | <div id="content"> | ||
| 34 | </div> | ||
| 35 | </body> | ||
| 36 | </html> | ||
diff --git a/htdocs/app/gpio-header/index.html b/htdocs/app/gpio-header/index.html new file mode 100644 index 0000000..0634b1e --- /dev/null +++ b/htdocs/app/gpio-header/index.html | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | ||
| 2 | <html> | ||
| 3 | <head> | ||
| 4 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
| 5 | <meta name="viewport" content = "height = device-height, width = 420, user-scalable = no" /> | ||
| 6 | <title>WebIOPi | GPIO Header</title> | ||
| 7 | <script type="text/javascript" src="/webiopi.js"></script> | ||
| 8 | <script type="text/javascript"> | ||
| 9 | webiopi().ready(function() { | ||
| 10 | webiopi().RPiHeader().createTable("content"); | ||
| 11 | w().refreshGPIO(true); | ||
| 12 | }); | ||
| 13 | </script> | ||
| 14 | </head> | ||
| 15 | <body> | ||
| 16 | <div id="content" align="center"></div> | ||
| 17 | </body> | ||
| 18 | </html> | ||
diff --git a/htdocs/app/gpio-list/index.html b/htdocs/app/gpio-list/index.html new file mode 100644 index 0000000..6c0cf1a --- /dev/null +++ b/htdocs/app/gpio-list/index.html | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | ||
| 2 | <html> | ||
| 3 | <head> | ||
| 4 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
| 5 | <meta name="viewport" content = "height = device-height, width = 420, user-scalable = no" /> | ||
| 6 | <title>WebIOPi | GPIO List</title> | ||
| 7 | <script type="text/javascript" src="/webiopi.js"></script> | ||
| 8 | <script type="text/javascript"> | ||
| 9 | webiopi().ready(function() { | ||
| 10 | webiopi().Expert().createList("content"); | ||
| 11 | w().refreshGPIO(true); | ||
| 12 | }); | ||
| 13 | </script> | ||
| 14 | <style type="text/css"> | ||
| 15 | button { | ||
| 16 | margin: 2px 2px 2px 2px; | ||
| 17 | width: 50px; | ||
| 18 | } | ||
| 19 | |||
| 20 | .Description { | ||
| 21 | display: inline; | ||
| 22 | } | ||
| 23 | </style> | ||
| 24 | </head> | ||
| 25 | <body> | ||
| 26 | <div id="content"></div> | ||
| 27 | </body> | ||
| 28 | </html> | ||
diff --git a/htdocs/app/serial-monitor/index.html b/htdocs/app/serial-monitor/index.html new file mode 100644 index 0000000..cdc8524 --- /dev/null +++ b/htdocs/app/serial-monitor/index.html | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | ||
| 2 | <html> | ||
| 3 | <head> | ||
| 4 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
| 5 | <meta name="viewport" content = "height = device-height, width = 420, user-scalable = no" /> | ||
| 6 | <title>WebIOPi | Serial Monitor</title> | ||
| 7 | <script type="text/javascript" src="/webiopi.js"></script> | ||
| 8 | <script type="text/javascript"> | ||
| 9 | webiopi().ready(function() { | ||
| 10 | $("#inputText").keyup(function(event){ | ||
| 11 | if(event.keyCode == 13){ | ||
| 12 | sendData(); | ||
| 13 | } | ||
| 14 | }); | ||
| 15 | $.get("/devices/*", function(data) { | ||
| 16 | var devices = $("#devices"); | ||
| 17 | var added = false; | ||
| 18 | for (i in data) { | ||
| 19 | if (data[i].type=="Serial") { | ||
| 20 | added = true; | ||
| 21 | devices.append($("<option>" + data[i].name + "</option>")) | ||
| 22 | } | ||
| 23 | } | ||
| 24 | if (added) { | ||
| 25 | readData(); | ||
| 26 | } | ||
| 27 | }); | ||
| 28 | }); | ||
| 29 | |||
| 30 | function readData() { | ||
| 31 | webiopi().Serial($("#devices").val()).read(function(data) { | ||
| 32 | if (data.length > 0) { | ||
| 33 | var d = $("#output").text() + data; | ||
| 34 | $("#output").text(d); | ||
| 35 | } | ||
| 36 | }); | ||
| 37 | setTimeout(readData, 500); | ||
| 38 | } | ||
| 39 | |||
| 40 | function sendData() { | ||
| 41 | var data = $("#inputText").val() + "\n"; | ||
| 42 | webiopi().Serial($("#devices").val()).write(data); | ||
| 43 | $("#inputText").val(""); | ||
| 44 | } | ||
| 45 | |||
| 46 | function deviceChanged() { | ||
| 47 | $("#output").text(""); | ||
| 48 | } | ||
| 49 | |||
| 50 | </script> | ||
| 51 | <style type="text/css"> | ||
| 52 | #inputText { | ||
| 53 | width: 550px; | ||
| 54 | } | ||
| 55 | </style> | ||
| 56 | </head> | ||
| 57 | <body> | ||
| 58 | <h1>Serial Monitor</h1> | ||
| 59 | <span>Serial device : </span><select id="devices" onchange="deviceChanged()"></select><br/> | ||
| 60 | <span>Input : </span><br/> | ||
| 61 | <textarea id="output" rows="30" cols="100" disabled="disabled"></textarea><br/> | ||
| 62 | <span>Output : </span><input id="inputText" type="text"/> | ||
| 63 | </body> | ||
| 64 | </html> | ||
