plugins/realtime/realtime.js
function (config, EventSource) {
            var url = config.url;
            if (url) {
                realtime = new Crocodoc.Realtime(url, EventSource || window.EventSource);

                // force the viewer to think conversion is not complete
                // @TODO: ideally this wouldn't have to make an extra trip to
                // the server just to find out the doc is already done
                // converting, so we should have an indicator of the doc status
                // in the session endpoint response
                viewerConfig.conversionIsComplete = false;
                registerBoxViewPageEventHandlers();
            }
        }
function (config, EventSource) {
            var url = config.url;
            if (url) {
                realtime = new Crocodoc.Realtime(url, EventSource || window.EventSource);

                // force the viewer to think conversion is not complete
                // @TODO: ideally this wouldn't have to make an extra trip to
                // the server just to find out the doc is already done
                // converting, so we should have an indicator of the doc status
                // in the session endpoint response
                viewerConfig.conversionIsComplete = false;
                registerBoxViewPageEventHandlers();
            }
        }
function ( config , EventSource ) { var url = config . url ; if ( url ) { realtime = new Crocodoc . Realtime ( url , EventSource || window . EventSource ) ; // force the viewer to think conversion is not complete // @TODO: ideally this wouldn't have to make an extra trip to // the server just to find out the doc is already done // converting, so we should have an indicator of the doc status // in the session endpoint response viewerConfig . conversionIsComplete = false ; registerBoxViewPageEventHandlers ( ) ; } }
Initialize the realtime plugin
@param   {Object} config     The config object
@param   {string} config.url The URL to connect to for realtime events
@param {Function} [EventSource] EventSource constructor to use (for testing purposes)
@returns {void}
Initialize the realtime plugin