hy/demo/templates/index.html

64 lines
1.1 KiB
HTML
Raw Normal View History

2012-12-24 19:41:29 +01:00
<!DOCTYPE html>
<html>
<head>
<title>Hy!</title>
<script type="text/javascript" src="/static/jquery.min.js"></script>
<script type="text/javascript">
2012-12-24 20:06:40 +01:00
function reload() {
var input = $("#repl-input").val();
console.log("Input: " + input);
$('#repl-output').load(
'/translate',
{"code": input}
);
}
2012-12-24 19:41:29 +01:00
$(document).ready(function() {
$("#repl-input").keyup(function(e) {
2012-12-24 20:06:40 +01:00
reload();
2012-12-24 19:41:29 +01:00
});
2012-12-24 20:06:40 +01:00
reload();
2012-12-24 19:41:29 +01:00
});
</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' >
2012-12-24 20:06:40 +01:00
<textarea id = 'repl-input' >; LISP input
(import "sunlight")
2012-12-24 20:34:32 +01:00
(defn square [x]
"This squares a function"
(* x x))
2012-12-24 20:06:40 +01:00
(for [x (kwapply (sunlight.openstates.legislators) {"state" "ma"})]
(print x)) </textarea>
2012-12-24 19:41:29 +01:00
<pre id = 'repl-output' ></pre>
</div>
</body>
</html>