hy/demo/templates/base.html
Paul Tagliamonte 177e52c492 foo
2012-12-27 20:17:33 -05:00

98 lines
2.3 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>{% block title %}{% endblock %} | hy</title>
<link rel = "stylesheet" href = "{{ url_for('static', filename='css/debuild.css') }}" ></link>
<script src = '{{ url_for('static', filename='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();
$(document).keyup(function(e) {
if (e.keyCode == 27) {
$('#popshim').css({"visibility": "hidden"});
}
});
});
</script>
<script type="text/javascript">
$(document).ready(function() {
$("#try").click(function() {
$('#popshim').css({"visibility": "visible"});
return false;
});
});
</script>
</head>
<body>
<div id = 'popshim' >
<div class = 'popover' >
<div class = 'focus' >
<div class = 'repl' >
<textarea id = 'repl-input' class = 'repl-left repl-pane' >
(import "os")
(print (os.path.abspath "."))
; something like /home/tag
(defn square [x]
(* x x))
(defn factorial (n)
(if (&lt;= n 1)
1
(* n (factorial (- n 1)))))
(defn fib (n)
(if (&lt; n 2)
n
(+ (fib (- n 1)) (fib (- n 2)))))
(print (fib 2))
; 1
(print "4! =" (factorial 4))
; 4! = 24
</textarea>
<pre id = 'repl-output' class = 'repl-right repl-pane' ></pre>
</div>
</div>
</div>
</div>
<div class = 'headblock' >
<div class = 'spacer' ></div>
</div>
<div class = 'headblock' >
<div class = 'banner' >
<ul>
<li><a href = '#' >Home</a></li>
<li><a id = 'try' href = '#' >Try it</a></li>
<li><a href = '#' >Source</a></li>
</ul>
</div>
</div>
<div class = 'content' >
<div class = 'main-container' ><div class = 'shim' >
{% block content %}
{% endblock %}
</div></div>
</div>
</body>
</html>