This commit is contained in:
Paul Tagliamonte 2012-12-27 20:17:33 -05:00
parent 4433592b5b
commit 177e52c492
3 changed files with 66 additions and 94 deletions

View File

@ -195,6 +195,10 @@ table.zebra {
box-shadow: 5px 5px rgba(15,15,15,0.05); box-shadow: 5px 5px rgba(15,15,15,0.05);
} }
#popshim {
visibility: hidden;
}
.popover { .popover {
position: fixed; position: fixed;
height: 100%; height: 100%;

View File

@ -5,18 +5,76 @@
<link rel = "stylesheet" href = "{{ url_for('static', filename='css/debuild.css') }}" ></link> <link rel = "stylesheet" href = "{{ url_for('static', filename='css/debuild.css') }}" ></link>
<script src = '{{ url_for('static', filename='jquery.min.js') }}' ></script> <script src = '{{ url_for('static', filename='jquery.min.js') }}' ></script>
<script type="text/javascript"> <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() { $(document).ready(function() {
$("#try").click(function() { $("#try").click(function() {
$('#popshim').load( $('#popshim').css({"visibility": "visible"});
'/popup'
);
return false; return false;
}); });
}); });
</script> </script>
</head> </head>
<body> <body>
<div id = 'popshim' ></div> <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 = 'headblock' >
<div class = 'spacer' ></div> <div class = 'spacer' ></div>
</div> </div>
@ -35,36 +93,5 @@ $(document).ready(function() {
{% endblock %} {% endblock %}
</div></div> </div></div>
</div> </div>
<div class = 'footer' >
<div class = 'container' ><div class = 'shim' >
<div class = 'fifth' >
<h1><i class="icon-sitemap"></i> Links</h1>
<ul>
</ul>
</div>
<div class = 'fifth' >
<h1><i class="icon-link"></i> Examples</h1>
<ul>
</ul>
</div>
<div class = 'fifth' >
<h1><i class="icon-group"></i> About</h1>
<ul>
<li><a href = 'http://pault.ag/' >Paul's Homepage</a></li>
</ul>
</div>
<div class = 'fifth' >
<h1><i class="icon-info-sign"></i> Help</h1>
<ul>
</ul>
</div>
<div class = 'fifth' >
<h1><i class="icon-github"></i> Source Code</i></h1>
<ul>
</ul>
</div>
</div></div>
</div>
</body> </body>
</html> </html>

View File

@ -1,59 +0,0 @@
<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").html("");
}
});
});
</script>
<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>