Clean up the runner a little.

This commit is contained in:
Tom Ashworth 2013-07-02 09:17:36 +01:00
parent 5e12d4a9e4
commit 0c1d89503d

View File

@ -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));