Mercurial > code > home > repos > homeauto
view service/frontDoorArduino/index.html @ 823:0aafd40e4afc
move more ports to use /dev/serial/by-id/
Ignore-this: 4d9bc18902dfe08897c3e03579c87b23
darcs-hash:20111204030320-312f9-da93888bb0e3b2bc898eb34f3126706d0ac3aefa.gz
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Sat, 03 Dec 2011 19:03:20 -0800 |
parents | b1c92ee20ff4 |
children |
line wrap: on
line source
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>front door</title> <link rel="Stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/ui-lightness/jquery-ui.css" media="all"/> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script> <style type="text/css" media="all"> /* <![CDATA[ */ #message, #lastLine { background: #C5F180; color: #0A08A2; font-weight: bold; font-family: monospace; } section { background: none repeat scroll 0 0 #E1E1DF; border: 1px solid #595555; float: left; margin: 5px; padding: 10px; } /* ]]> */ </style> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js"></script> </head> <body> <section> <h1>lcd</h1> <div> set message: <div> <textarea cols="21" rows="7" id="message"/> </div> </div> <div> backlight: <div id="backlightSlider" style="width: 300px;"/> </div> </section> <section> <h1>temperature</h1> <div>Current: <span id="temperature"/> <button id="getTemperature">refresh</button> </div> </section> <section> <h1>door</h1> <div>Current: <span id="door"/> <button id="getDoor">refresh</button> </div> </section> <section> <h1>yard light</h1> <div>Current: <span id="yardLight"/> <button id="toggleYardLight">toggle</button> </div> </section> <script type="text/javascript"> // <![CDATA[ $(function () { $.get("lcd", function (data){ $("#message").val(data) }); $("#message").keyup(function() { $.ajax({ type: "PUT", url: "lcd", data: $("#message").val() }); }); $.getJSON("lcd/backlight", function (data) { $("#backlightSlider").slider({value: data.backlight}); }); $("#backlightSlider").slider({ min: 0, max: 255, slide: function (ev, ui) { $.post("lcd/backlight", {brightness: ui.value}); }}); function getTemperature() { $.get("temperature", function (data) { $("#temperature").text(data); }); } getTemperature(); $("#getTemperature").click(getTemperature); function getDoor() { $.get("door", function (x) { $("#door").text(x) }); } getDoor(); $("#getDoor").click(getDoor); function refreshYardLight() { $.getJSON("yardLight", function (data) { $("#yardLight").text(data.yardLight); }); } refreshYardLight(); $("#toggleYardLight").click(function () { $.getJSON("yardLight", function (data) { $.ajax({ type: "PUT", url: "yardLight", data: JSON.stringify(!data.yardLight), success: refreshYardLight }); }); }); }); // ]]> </script> </body> </html>