Smoke rises
This commit is contained in:
8
app.js
8
app.js
@ -31,6 +31,7 @@ var express = require('express'),
|
||||
resourcesController = require('./controllers/resources'),
|
||||
userController = require('./controllers/user'),
|
||||
contactController = require('./controllers/contact'),
|
||||
bonfireController = require('./controllers/bonfire'),
|
||||
|
||||
/**
|
||||
* User model
|
||||
@ -346,6 +347,13 @@ app.get(
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* Bonfire routing
|
||||
*/
|
||||
app.get('/bonfire', bonfireController.index);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 500 Error Handler.
|
||||
*/
|
||||
|
@ -6,19 +6,30 @@ block content
|
||||
script(src='/js/lib/codemirror/mode/javascript/javascript.js')
|
||||
|
||||
.col-sm-12
|
||||
.col-sm-4.panel
|
||||
div
|
||||
| Challenge text goes here
|
||||
.col-sm-4.panel.
|
||||
Challenge text goes here
|
||||
.col-sm-8
|
||||
form.code
|
||||
.form-group.code
|
||||
textarea(id='code')
|
||||
#submitButton.btn.btn-primary
|
||||
.col-sm-4.jumbotron
|
||||
#codeOutput
|
||||
|
||||
|
||||
|
||||
script(type="text/javascript").
|
||||
script.
|
||||
var myCodeMirror = CodeMirror.fromTextArea(document.getElementById("code"), {
|
||||
lineNumbers: true,
|
||||
mode: "javascript",
|
||||
theme: 'monokai'
|
||||
theme: 'monokai',
|
||||
runnable: true
|
||||
});
|
||||
myCodeMirror.setValue('2*2');
|
||||
$('#submitButton').on('click', function() {
|
||||
$('#codeOutput').empty();
|
||||
var js = myCodeMirror.getValue();
|
||||
var s = document.createElement('script');
|
||||
s.textContent = js;
|
||||
$('#codeOutput').append(eval(s.textContent));
|
||||
});
|
Reference in New Issue
Block a user