5 /* The console container element */
6 body { background-color: black; font-size: 16px; font-family: Courier; overflow: hidden; padding: 0 0 0 0;}
13 background-color:black;
20 /* The inner console element. */
26 background-color: gray;
28 /* The cursor color when the console looses focus. */
29 .jqconsole-blurred .jqconsole-cursor {
30 background-color: #666;
32 /* The current prompt text color */
36 /* The command history */
37 .jqconsole-old-prompt {
41 /* The text color when in input mode. */
45 /* Previously entered input. */
46 .jqconsole-old-input {
50 /* The text color of the output. */
54 .jqconsole-return, .jqconsole-header {
64 <div id="console"></div>
65 <script src="jscl.js" type="text/javascript"></script>
66 <script src="jquery.js" type="text/javascript" charset="utf-8"></script>
67 <script src="jqconsole.min.js" type="text/javascript" charset="utf-8"></script>
71 jqconsole = $('#console').jqconsole('Welcome to JSCL!\n\n', '');
72 jqconsole.RegisterMatching('(', ')', 'parents');
73 if (localStorage.getItem("jqhist"))
74 jqconsole.SetHistory(JSON.parse(localStorage.getItem("jqhist")));
76 lisp.write = function(str){
77 jqconsole.Write(xstring(str), 'jqconsole-output', false);
81 var startPrompt = function () {
82 // Start the prompt with history enabled.
83 jqconsole.Write(lisp.evalString('(CL:PACKAGE-NAME CL:*PACKAGE*)') + '> ', 'jqconsole-prompt');
84 jqconsole.Prompt(true, function (input) {
85 // Output input with the class jqconsole-return.
88 var vs = lisp.evalInput(input);
89 // for (var i=0; i<vs.length; i++){
90 jqconsole.Write(lisp.print(vs) + '\n', 'jqconsole-return');
91 localStorage.setItem("jqhist", JSON.stringify(jqconsole.GetHistory()));
94 var msg = error.message || error || 'Unknown error';
95 if (typeof(msg) != 'string') msg = xstring(msg);
96 jqconsole.Write('ERROR: ' + msg + '\n', 'jqconsole-error');
99 jqconsole.Write(lisp.compileString(input.slice(1)) + '\n', 'jqconsole-return');
101 // Restart the prompt.
105 lisp.read(input[0]==','? input.slice(1): input);