Skip to content

Commit

Permalink
replTerminal requires a jQuery element
Browse files Browse the repository at this point in the history
  • Loading branch information
pwmarcz authored and nishio committed Jun 17, 2012
1 parent 5a68297 commit 628448c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions lisp-repl.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// REPL - using the jQuery Terminal script

lisp.replTerminal = function(selector) {
$(selector).terminal(
// Install a LISP terminal in a given jQuery element
lisp.replTerminal = function(elt) {
elt.terminal(
function(str, terminal) {
try {
var term = lisp.parse(str);
Expand All @@ -17,6 +18,6 @@ lisp.replTerminal = function(selector) {
greetings: "LISP Interpreter. Type 'clear' to clear",
prompt: '> '
});
lisp.terminal = $(selector).terminal();
lisp.terminal = elt.terminal();
};

2 changes: 1 addition & 1 deletion test.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<link rel="stylesheet" type="text/css" href="terminal.css" />
<script>
$(function() {
lisp.replTerminal('#term');
lisp.replTerminal($('#term'));
lisp.test();
$('body').click(function() { $('#term').terminal().disable(); });
});
Expand Down

0 comments on commit 628448c

Please sign in to comment.