public/js/render/live.js
function (requested) {
    // No postMessage? Don't render – the event-stream will handle it.
    if (!window.postMessage) { return; }

    // Inform other pages event streaming render to reload
    if (requested) {
      sendReload();
      jsbin.state.hasBody = false;
    }
    getPreparedCode().then(function (source) {
      var includeJsInRealtime = jsbin.settings.includejs;

      // Tell the iframe to reload
      var visiblePanels = jsbin.panels.getVisible();
      var outputPanelOpen = visiblePanels.indexOf(jsbin.panels.panels.live) > -1;
      var consolePanelOpen = visiblePanels.indexOf(jsbin.panels.panels.console) > -1;
      if (!outputPanelOpen && !consolePanelOpen) {
        return;
      }
      // this is a flag that helps detect crashed runners
      if (jsbin.settings.includejs) {
        store.sessionStorage.setItem('runnerPending', 1);
      }

      renderer.postMessage('render', {
        source: source,
        options: {
          injectCSS: jsbin.state.hasBody && jsbin.panels.focused.id === 'css',
          requested: requested,
          debug: jsbin.settings.debug,
          includeJsInRealtime: jsbin.settings.includejs,
        },
      });

      jsbin.state.hasBody = true;

    });
  }
function (requested) {
    // No postMessage? Don't render – the event-stream will handle it.
    if (!window.postMessage) { return; }

    // Inform other pages event streaming render to reload
    if (requested) {
      sendReload();
      jsbin.state.hasBody = false;
    }
    getPreparedCode().then(function (source) {
      var includeJsInRealtime = jsbin.settings.includejs;

      // Tell the iframe to reload
      var visiblePanels = jsbin.panels.getVisible();
      var outputPanelOpen = visiblePanels.indexOf(jsbin.panels.panels.live) > -1;
      var consolePanelOpen = visiblePanels.indexOf(jsbin.panels.panels.console) > -1;
      if (!outputPanelOpen && !consolePanelOpen) {
        return;
      }
      // this is a flag that helps detect crashed runners
      if (jsbin.settings.includejs) {
        store.sessionStorage.setItem('runnerPending', 1);
      }

      renderer.postMessage('render', {
        source: source,
        options: {
          injectCSS: jsbin.state.hasBody && jsbin.panels.focused.id === 'css',
          requested: requested,
          debug: jsbin.settings.debug,
          includeJsInRealtime: jsbin.settings.includejs,
        },
      });

      jsbin.state.hasBody = true;

    });
  }
function ( requested ) { // No postMessage? Don't render – the event-stream will handle it. if ( ! window . postMessage ) { return ; } // Inform other pages event streaming render to reload if ( requested ) { sendReload ( ) ; jsbin . state . hasBody = false ; } getPreparedCode ( ) . then ( function ( source ) { var includeJsInRealtime = jsbin . settings . includejs ; // Tell the iframe to reload var visiblePanels = jsbin . panels . getVisible ( ) ; var outputPanelOpen = visiblePanels . indexOf ( jsbin . panels . panels . live ) > - 1 ; var consolePanelOpen = visiblePanels . indexOf ( jsbin . panels . panels . console ) > - 1 ; if ( ! outputPanelOpen && ! consolePanelOpen ) { return ; } // this is a flag that helps detect crashed runners if ( jsbin . settings . includejs ) { store . sessionStorage . setItem ( 'runnerPending' , 1 ) ; } renderer . postMessage ( 'render' , { source : source , options : { injectCSS : jsbin . state . hasBody && jsbin . panels . focused . id === 'css' , requested : requested , debug : jsbin . settings . debug , includeJsInRealtime : jsbin . settings . includejs , } , } ) ; jsbin . state . hasBody = true ; } ) ; }
The big daddy that handles postmessaging the runner.
The big daddy that handles postmessaging the runner .