browser-module-sandbox
Advanced tools
Comparing version 0.0.9 to 0.1.0
@@ -20,2 +20,4 @@ var inherits = require('inherits') | ||
this.editorEl = opts.editor || document.body | ||
this.iframeHead = opts.iframeHead || "" | ||
this.iframeBody = opts.iframeBody || "" | ||
this.snuggieAPI = opts.snuggieAPI || window.location.protocol + '//' + window.location.host | ||
@@ -37,4 +39,4 @@ this.showControls(opts.controls) | ||
// setTimeout is because iframes report inaccurate window.innerWidth/innerHeight, even after DOMContentLoaded! | ||
var body = '<script type="text/javascript"> setTimeout(function(){' + json.bundle + '}, 0)</script>' | ||
self.iframe.setHTML({ head: self.iframeStyle, body: body }) | ||
var body = self.iframeBody + '<script type="text/javascript"> setTimeout(function(){' + json.bundle + '}, 0)</script>' | ||
self.iframe.setHTML({ head: self.iframeHead + self.iframeStyle, body: body }) | ||
self.emit('bundleEnd') | ||
@@ -41,0 +43,0 @@ }) |
{ | ||
"name": "browser-module-sandbox", | ||
"version": "0.0.9", | ||
"version": "0.1.0", | ||
"description": "browser editor for code that gets 'compiled' on the server with node and run on the client", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -32,3 +32,5 @@ # browser-module-sandbox | ||
editor: document.querySelector('#edit'), | ||
codemirrorOptions: {} | ||
codemirrorOptions: {}, | ||
iframeHead: string that gets prepended to the `<head>` of the output iframe, | ||
iframeBody: string that gets prepended to the `<body>` of the output iframe | ||
}) | ||
@@ -35,0 +37,0 @@ ``` |
199177
4561
48