hy/demo/templates/index.html
Paul Tagliamonte b6df6ec946 update demo
2012-12-24 14:06:40 -05:00

58 lines
1.1 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>Hy!</title>
<script type="text/javascript" src="/static/jquery.min.js"></script>
<script type="text/javascript">
function reload() {
var input = $("#repl-input").val();
console.log("Input: " + input);
$('#repl-output').load(
'/translate',
{"code": input}
);
}
$(document).ready(function() {
$("#repl-input").keyup(function(e) {
reload();
});
reload();
});
</script>
<style>
html, body {
height: 90%;
padding: 0px;
margin: 0px;
}
.repl {
width: 100%;
height: 100%;
}
#repl-input {
float: left;
width: 49%;
border: 0px solid #000000;
resize: none;
height: 100%;
}
#repl-output {
float: right;
width: 49%;
height: 100%;
}
</style>
</head>
<body>
<div class = 'repl' >
<textarea id = 'repl-input' >; LISP input
(import "sunlight")
(for [x (kwapply (sunlight.openstates.legislators) {"state" "ma"})]
(print x)) </textarea>
<pre id = 'repl-output' ></pre>
</div>
</body>
</html>