Files
freeCodeCamp/client/commonFramework/outputDisplay.js

45 lines
800 B
JavaScript
Raw Normal View History

2015-11-13 11:10:23 -08:00
window.common = (function(global) {
const {
CodeMirror,
document: doc,
common = { init: [] }
} = global;
const { challengeType = '0' } = common;
if (!CodeMirror) {
return {};
}
if (
challengeType === '0' ||
challengeType === '7'
) {
return {};
}
common.codeOutput = CodeMirror.fromTextArea(
doc.getElementById('codeOutput'),
{
lineNumbers: false,
mode: 'text',
theme: 'monokai',
readOnly: 'nocursor',
lineWrapping: true
}
);
common.codeOutput.setValue(`
/**
* Your output will go here.
* Console.log() -type statements
* will appear in your browser\'s
* DevTools JavaScript console.
*/'
`);
common.codeOutput.setSize('100%', '100%');
return common;
}(window));