browser-module-sandbox
Advanced tools
Comparing version 0.0.5 to 0.0.6
19
index.js
@@ -7,2 +7,3 @@ var CodeMirror = require('./codemirror/codemirror').CodeMirror | ||
var request = require('browser-request') | ||
var activeLine = require('./codemirror/active-line') | ||
@@ -21,7 +22,21 @@ module.exports = function(opts) { | ||
this.showControls(opts.controls) | ||
this.editor = CodeMirror(this.editorEl, { | ||
value: opts.functionBody || this.defaultCode, | ||
mode: "javascript" | ||
mode: "javascript", | ||
electricChars: true, | ||
autofocus: true, | ||
extraKeys: { | ||
"Tab": function indent(editor) { | ||
if (!editor.getOption("indentWithTabs")) { | ||
var size = editor.getOption("indentUnit") | ||
var indentation = Array(size + 1).join(" ") | ||
editor.replaceSelection(indentation, "end") | ||
} | ||
} | ||
} | ||
}) | ||
activeLine(this.editor) | ||
self.on('output', function() { | ||
@@ -28,0 +43,0 @@ if (typeof game !== "undefined") game = undefined |
{ | ||
"name": "browser-module-sandbox", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "browser editor for code that gets 'compiled' on the server with node and run on the client", | ||
@@ -5,0 +5,0 @@ "repository": { |
214054
6
4945