From 0c1d89503d089c4b14ddc21fcc45188e27ff8694 Mon Sep 17 00:00:00 2001 From: Tom Ashworth Date: Tue, 2 Jul 2013 09:17:36 +0100 Subject: [PATCH] Clean up the runner a little. --- public/runner/runner.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/public/runner/runner.js b/public/runner/runner.js index 8d9e6e2c..3995ba31 100644 --- a/public/runner/runner.js +++ b/public/runner/runner.js @@ -9,6 +9,7 @@ */ var prependChild = function(elem, child) { elem.insertBefore(child, elem.firstChild); }; + var addEvent = function(elem, event, fn) { if (elem.addEventListener) { elem.addEventListener(event, fn, false); @@ -19,12 +20,9 @@ var addEvent = function(elem, event, fn) { }); } }; -if (!window.location.origin) window.location.origin = window.location.protocol+"//"+window.location.host; -try { - console.log('runner'); -} catch (e) { -} +if (!window.location.origin) window.location.origin = window.location.protocol+"//"+window.location.host; + var throttle = function (fn, delay) { var timer = null; var throttled = function () { @@ -91,8 +89,6 @@ var proxyconsole = (function () { }; }); - window.proxyconsole = proxyconsole; - return proxyconsole; }()); @@ -491,10 +487,14 @@ window.onload = function () { /** * Live rendering, postMessage style. */ + // Set the sandbox target sandbox.target = document.getElementById('sandbox-wrapper'); + // Attach the proxyconsole + window.proxyconsole = proxyconsole; // Hook into postMessage window.onmessage = runner.handleMessage; + }; }(window, document)); \ No newline at end of file