plugins/fullscreen/fullscreen.js
function (config) {
            config = config || {};
            if (typeof config.useFakeFullscreen !== 'undefined') {
                useFakeFullscreen = config.useFakeFullscreen;
            }

            if (viewerConfig.useWindowAsViewport) {
                // fake fullscreen mode is redundant if the window is used as
                // the viewport, so turn it off
                useFakeFullscreen = false;
                el = document.documentElement;
                $el = $(el);
            } else {
                if (config.element) {
                    $el = $(config.element);
                } else {
                    $el = viewerConfig.$el;
                }
                el = $el[0];
            }

            // init browser-specific request/cancel fullscreen methods
            requestFullscreen = el.requestFullScreen ||
                                el.requestFullscreen ||
                                el.mozRequestFullScreen ||
                                el.webkitRequestFullScreen ||
                                el.msRequestFullscreen ||
                                fakeRequestFullscreen;

            // fullscreen APIs are completely insane
            cancelFullscreen =  document.cancelFullScreen ||
                                document.exitFullscreen ||
                                document.mozCancelFullScreen ||
                                document.webkitCancelFullScreen ||
                                document.msExitFullscreen ||
                                fakeCancelFullscreen;

            // add enter/exit fullscreen methods to the viewer API
            util.extend(viewerAPI, {
                enterFullscreen: enterFullscreen,
                exitFullscreen: exitFullscreen,
                isFullscreen: isFullscreen,
                isFullscreenSupported: isNativeFullscreenSupported
            });

            $(document).on(FULLSCREENCHANGE_EVENT, fullscreenchangeHandler);
        }
function (config) {
            config = config || {};
            if (typeof config.useFakeFullscreen !== 'undefined') {
                useFakeFullscreen = config.useFakeFullscreen;
            }

            if (viewerConfig.useWindowAsViewport) {
                // fake fullscreen mode is redundant if the window is used as
                // the viewport, so turn it off
                useFakeFullscreen = false;
                el = document.documentElement;
                $el = $(el);
            } else {
                if (config.element) {
                    $el = $(config.element);
                } else {
                    $el = viewerConfig.$el;
                }
                el = $el[0];
            }

            // init browser-specific request/cancel fullscreen methods
            requestFullscreen = el.requestFullScreen ||
                                el.requestFullscreen ||
                                el.mozRequestFullScreen ||
                                el.webkitRequestFullScreen ||
                                el.msRequestFullscreen ||
                                fakeRequestFullscreen;

            // fullscreen APIs are completely insane
            cancelFullscreen =  document.cancelFullScreen ||
                                document.exitFullscreen ||
                                document.mozCancelFullScreen ||
                                document.webkitCancelFullScreen ||
                                document.msExitFullscreen ||
                                fakeCancelFullscreen;

            // add enter/exit fullscreen methods to the viewer API
            util.extend(viewerAPI, {
                enterFullscreen: enterFullscreen,
                exitFullscreen: exitFullscreen,
                isFullscreen: isFullscreen,
                isFullscreenSupported: isNativeFullscreenSupported
            });

            $(document).on(FULLSCREENCHANGE_EVENT, fullscreenchangeHandler);
        }
function ( config ) { config = config || { } ; if ( typeof config . useFakeFullscreen !== 'undefined' ) { useFakeFullscreen = config . useFakeFullscreen ; } if ( viewerConfig . useWindowAsViewport ) { // fake fullscreen mode is redundant if the window is used as // the viewport, so turn it off useFakeFullscreen = false ; el = document . documentElement ; $el = $ ( el ) ; } else { if ( config . element ) { $el = $ ( config . element ) ; } else { $el = viewerConfig . $el ; } el = $el [ 0 ] ; } // init browser-specific request/cancel fullscreen methods requestFullscreen = el . requestFullScreen || el . requestFullscreen || el . mozRequestFullScreen || el . webkitRequestFullScreen || el . msRequestFullscreen || fakeRequestFullscreen ; // fullscreen APIs are completely insane cancelFullscreen = document . cancelFullScreen || document . exitFullscreen || document . mozCancelFullScreen || document . webkitCancelFullScreen || document . msExitFullscreen || fakeCancelFullscreen ; // add enter/exit fullscreen methods to the viewer API util . extend ( viewerAPI , { enterFullscreen : enterFullscreen , exitFullscreen : exitFullscreen , isFullscreen : isFullscreen , isFullscreenSupported : isNativeFullscreenSupported } ) ; $ ( document ) . on ( FULLSCREENCHANGE_EVENT , fullscreenchangeHandler ) ; }
Initialize the fullscreen plugin
@param {Object} config Config options for the fullscreen plugin
@param {Element} config.element The element to use for fullscreen
@param {boolen} config.useFakeFullscreen Whether to use fake fullscreen mode
@returns {void}
Initialize the fullscreen plugin