preparing for integration of testing
This commit is contained in:
@ -536,8 +536,9 @@ form.code span {
|
|||||||
padding-bottom: 0px;
|
padding-bottom: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.panel-bonfire {
|
div.CodeMirror-scroll {
|
||||||
min-height: 590px;
|
padding-bottom: 100px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//uncomment this to see the dimensions of all elements outlined in red
|
//uncomment this to see the dimensions of all elements outlined in red
|
||||||
|
@ -16,7 +16,12 @@ var submit = function(code) {
|
|||||||
|
|
||||||
// puts the message on the terminal
|
// puts the message on the terminal
|
||||||
var print = function(cls, msg) {
|
var print = function(cls, msg) {
|
||||||
|
if (cls) {
|
||||||
codeOutput.setValue(msg);
|
codeOutput.setValue(msg);
|
||||||
|
} else {
|
||||||
|
codeOutput.setValue(msg.output);
|
||||||
|
console.log(msg.type);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -43,7 +48,7 @@ var api = {
|
|||||||
if (data.error) {
|
if (data.error) {
|
||||||
print('message', data.error);
|
print('message', data.error);
|
||||||
} else {
|
} else {
|
||||||
print('output', data.output);
|
print(null, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -8,6 +8,7 @@ var myCodeMirror = CodeMirror.fromTextArea(document.getElementById("codeEditor")
|
|||||||
matchBrackets: true,
|
matchBrackets: true,
|
||||||
autoCloseBrackets: true,
|
autoCloseBrackets: true,
|
||||||
cursorHeight: 0.85,
|
cursorHeight: 0.85,
|
||||||
|
scrollbarStyle: 'null',
|
||||||
lineWrapping: true,
|
lineWrapping: true,
|
||||||
gutters: ["CodeMirror-lint-markers"],
|
gutters: ["CodeMirror-lint-markers"],
|
||||||
onKeyEvent: doLinting,
|
onKeyEvent: doLinting,
|
||||||
@ -25,9 +26,9 @@ myCodeMirror.setValue('/*Welcome to Bonfire, Free Code Camp\'s future CoderByte
|
|||||||
' return [1,2,3].map(function(elem) {\n' +
|
' return [1,2,3].map(function(elem) {\n' +
|
||||||
' return elem * elem;\n' +
|
' return elem * elem;\n' +
|
||||||
' });\n' +
|
' });\n' +
|
||||||
'}\n\n' +
|
'}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n' +
|
||||||
'test();');
|
'test();');
|
||||||
myCodeMirror.setSize("100%", "100%");
|
//myCodeMirror.setSize("100%", "100%");
|
||||||
|
|
||||||
var codeOutput = CodeMirror.fromTextArea(document.getElementById("codeOutput"), {
|
var codeOutput = CodeMirror.fromTextArea(document.getElementById("codeOutput"), {
|
||||||
lineNumbers: false,
|
lineNumbers: false,
|
||||||
|
@ -4,11 +4,14 @@ var run = function(code) {
|
|||||||
var result = {
|
var result = {
|
||||||
input: code,
|
input: code,
|
||||||
output: null,
|
output: null,
|
||||||
error: null
|
error: null,
|
||||||
|
type: null
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
result.output = stringify(runHidden(code));
|
var codeExec = runHidden(code);
|
||||||
|
result.type = typeof codeExec;
|
||||||
|
result.output = stringify(codeExec);
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
result.error = e.message;
|
result.error = e.message;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user