mirror of
https://github.com/jsbin/jsbin.git
synced 2026-02-01 16:46:05 +00:00
Clean up the runner a little.
This commit is contained in:
parent
5e12d4a9e4
commit
0c1d89503d
@ -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));
|
||||
Loading…
x
Reference in New Issue
Block a user