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>
70 var jqconsole = $('#console').jqconsole('Welcome to JSCL!\n\n', '');
71 jqconsole.RegisterMatching('(', ')', 'parents');
72 if (localStorage.getItem("jqhist"))
73 jqconsole.SetHistory(JSON.parse(localStorage.getItem("jqhist")));
75 lisp.write = function(str){
76 jqconsole.Write(xstring(str), 'jqconsole-output', false);
80 var startPrompt = function () {
81 // Start the prompt with history enabled.
82 jqconsole.Write(lisp.evalString('(CL:PACKAGE-NAME CL:*PACKAGE*)') + '> ', 'jqconsole-prompt');
83 jqconsole.Prompt(true, function (input) {
84 // Output input with the class jqconsole-return.
87 var vs = lisp.evalInput(input);
88 // for (var i=0; i<vs.length; i++){
89 jqconsole.Write(lisp.print(vs) + '\n', 'jqconsole-return');
90 localStorage.setItem("jqhist", JSON.stringify(jqconsole.GetHistory()));
93 var msg = error.message || error || 'Unknown error';
94 if (typeof(msg) != 'string') msg = xstring(msg);
95 jqconsole.Write('ERROR: ' + msg + '\n', 'jqconsole-error');
98 jqconsole.Write(lisp.compileString(input.slice(1)) + '\n', 'jqconsole-return');
100 // Restart the prompt.
104 lisp.read(input[0]==','? input.slice(1): input);