More improvements, keyboard shortcuts working again, extra protection against fatal errors
This commit is contained in:
@ -7,6 +7,7 @@ var _ = require('lodash'),
|
|||||||
*/
|
*/
|
||||||
exports.index = function(req, res) {
|
exports.index = function(req, res) {
|
||||||
res.render('bonfire/bonfire.jade', {
|
res.render('bonfire/bonfire.jade', {
|
||||||
|
title: 'Learn to code with Bonfire - Free Code Camp'
|
||||||
});
|
});
|
||||||
//Bonfire.find({}, null, { sort: { bonfireNumber: 1 } }, function(err, c) {
|
//Bonfire.find({}, null, { sort: { bonfireNumber: 1 } }, function(err, c) {
|
||||||
// if (err) {
|
// if (err) {
|
||||||
|
@ -43,6 +43,7 @@ var api = {
|
|||||||
//print('input', data.input);
|
//print('input', data.input);
|
||||||
if (data.error) {
|
if (data.error) {
|
||||||
print('Error', data);
|
print('Error', data);
|
||||||
|
reset();
|
||||||
} else {
|
} else {
|
||||||
print(null, data);
|
print(null, data);
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ var myCodeMirror = CodeMirror.fromTextArea(document.getElementById("codeEditor")
|
|||||||
onKeyEvent: doLinting,
|
onKeyEvent: doLinting,
|
||||||
extraKeys : {
|
extraKeys : {
|
||||||
"Ctrl-Enter" : function() {
|
"Ctrl-Enter" : function() {
|
||||||
submit(myCodeMirror.getValue());
|
bonfireExecute();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -104,6 +104,10 @@ var scrapeTests = function(js) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
$('#submitButton').on('click', function () {
|
$('#submitButton').on('click', function () {
|
||||||
|
bonfireExecute();
|
||||||
|
});
|
||||||
|
|
||||||
|
function bonfireExecute() {
|
||||||
tests = undefined;
|
tests = undefined;
|
||||||
$('#codeOutput').empty();
|
$('#codeOutput').empty();
|
||||||
var js = myCodeMirror.getValue();
|
var js = myCodeMirror.getValue();
|
||||||
@ -118,7 +122,7 @@ $('#submitButton').on('click', function () {
|
|||||||
runTests(null, message);
|
runTests(null, message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
|
|
||||||
var pushed = false;
|
var pushed = false;
|
||||||
var createTestDisplay = function() {
|
var createTestDisplay = function() {
|
||||||
|
Reference in New Issue
Block a user