Skip to content

Instantly share code, notes, and snippets.

@jaycfields
Created June 17, 2012 23:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaycfields/2946033 to your computer and use it in GitHub Desktop.
Save jaycfields/2946033 to your computer and use it in GitHub Desktop.
var ws = null;
$(document).ready(function () {
ws = $.websocket("ws://" + window.location.host + "/websocket", {
events: {
'web-repl-response': function(info) {
currentCallback([
{msg: info.response,
className:"jquery-console-message-value"}
]);
}
}
});
$("#console").console({
promptLabel: 'Clojure> ',
commandValidate:function(line) {
if (line == "") {
return false;
}
else {
return true;
}
},
commandHandle:function(line, callback) {
currentCallback = callback;
ws.send('selfish', {type: "web-repl", command: line});
},
welcomeMessage:'Enter some Clojure code, and it will be evaluated ON THE SERVER -- CAREFUL!!!.',
autofocus:true,
animateScroll:true,
promptHistory:true
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment