filesbox/web/dist/reader/js/libs/screenfull.js
2024-07-26 14:10:54 +08:00

6 lines
1.7 KiB
JavaScript

/*!
* screenfull
* v2.0.0 - 2014-12-22
* (c) Sindre Sorhus; MIT License
*/(function(){"use strict";var s=typeof module!="undefined"&&module.exports,i=typeof Element!="undefined"&&"ALLOW_KEYBOARD_INPUT"in Element,n=function(){for(var e,r,u=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],l=0,o=u.length,c={};l<o;l++)if(e=u[l],e&&e[1]in document){for(l=0,r=e.length;l<r;l++)c[u[0][l]]=e[l];return c}return!1}(),t={request:function(e){var r=n.requestFullscreen;e=e||document.documentElement,/5\.1[\.\d]* Safari/.test(navigator.userAgent)?e[r]():e[r](i&&Element.ALLOW_KEYBOARD_INPUT)},exit:function(){document[n.exitFullscreen]()},toggle:function(e){this.isFullscreen?this.exit():this.request(e)},raw:n};if(!n){s?module.exports=!1:window.screenfull=!1;return}Object.defineProperties(t,{isFullscreen:{get:function(){return!!document[n.fullscreenElement]}},element:{enumerable:!0,get:function(){return document[n.fullscreenElement]}},enabled:{enumerable:!0,get:function(){return!!document[n.fullscreenEnabled]}}}),s?module.exports=t:window.screenfull=t})();