(function() { var createEmbedFrame; createEmbedFrame = function() { var currentSlug, iframe, listeners, setHeight, target, uid, uriEmbedded, uriOriginal, uriOriginalNoProtocol; uid = "JSREMB_" + (~~(new Date().getTime() / 86400000)); uriOriginal = "//jsrun.net/NCkKp/embed/all/light"; uriEmbedded = "//jsrun.net/NCkKp/embedded/all/light"; currentSlug = "NCkKp"; uriOriginalNoProtocol = uriOriginal.split("//").pop(); target = document.querySelector("script[src*='" + uriOriginalNoProtocol + "']"); iframe = document.createElement("iframe"); iframe.src = uriEmbedded; iframe.id = uid; iframe.width = "100%"; iframe.height = "0"; iframe.frameBorder = "0"; iframe.allowtransparency = true; iframe.sandbox = "allow-modals allow-forms allow-popups allow-scripts allow-same-origin"; iframe.allow="microphone;camera;midi;encrypted-media;" target.parentNode.insertBefore(iframe, target.nextSibling); setHeight = function(data) { if (data.slug === currentSlug) { return iframe.height = data.height + 50; } }; listeners = (function(_this) { return function(event) { var data, eventName; eventName = event.data[0]; data = event.data[1]; switch (eventName) { case "embed": return setHeight(data); case "resultsFrame": if(data.height==0){ data.height=500; } return setHeight(data); } }; })(this); return window.addEventListener("message", listeners, false); }; setTimeout(createEmbedFrame, 5); }).call(this);