hy/demo/templates/index.html
2012-12-24 14:38:14 -05:00

78 lines
1.3 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%;
}
.head {
min-height: 20px;
}
.r-i-l {
float: left;
width: 49%;
height: 100%;
}
.r-o-l {
float: right;
width: 49%;
height: 100%;
}
</style>
</head>
<body>
<h1>Edit the left side</h1>
<div class = 'repl' >
<textarea id = 'repl-input' >; LISP input
(import "sunlight")
(defn square [x]
"This squares a function"
(* x x))
(for [x (kwapply (sunlight.openstates.legislators) {"state" "ma"})]
(print x)) </textarea>
<pre id = 'repl-output' ></pre>
</div>
</body>
</html>