var consoleTest = /(^.|\b)console\./; var iframedelay = (function () { var iframedelay = { active : false }, iframe = document.createElement('iframe'), doc, callbackName = '__callback' + (+new Date); iframe.style.height = iframe.style.width = '1px'; iframe.style.visibility = 'hidden'; document.body.appendChild(iframe); doc = iframe.contentDocument || iframe.contentWindow.document; window[callbackName] = function (width) { iframedelay.active = width === 0; try { iframe.parentNode.removeChild(iframe); delete window[callbackName]; } catch (e){}; }; doc.open(); doc.write(''); doc.close(); return iframedelay; }()); var useCustomConsole = !(function () { var ok = typeof window.console !== 'undefined'; try { window.console.log('jsbin init test'); } catch (e) { ok = false; } return ok; })(); var re = null; function getPreparedCode() { // init the regular expression cache because this function // is called much earlier than the above code is actually encountered // yay for massive .js app! if (!re) { re = { docReady: /\$\(document\)\.ready/, console: /(^.|\b)console\./g, script: /<\/script/ig, code: /%code%/, title: /
\n" + js + ""; } else if (re.code.test(source)) { parts = source.split('%code%'); source = parts[0] + js + parts[1]; } else if (js) { close = ''; if (source.indexOf('