UNPKG

jsfullscreen

Version:
1 lines 10.3 kB
!function(a){function b(a){Object.defineProperty(this,a,{enumerable:!0,get:function(){return this[o][a]}})}function c(a){var b;if(a&&a.__esModule){b={};for(var c in a)Object.hasOwnProperty.call(a,c)&&(b[c]=a[c]);b.default=a}else{if("[object Module]"===Object.prototype.toString.call(a)||"undefined"!=typeof System&&System.isModule&&System.isModule(a))return a;b={default:a,__useDefault:!0}}return new d(b)}function d(a){Object.defineProperty(this,o,{value:a}),Object.keys(a).forEach(b,this)}function e(a){return"@node/"===a.substr(0,6)?m(a,c(p(a.substr(6))),{}):n[a]}function f(a){var b=e(a);if(!b)throw new Error('Module "'+a+'" expected, but not contained in build.');if(b.module)return b.module;var c=b.linkRecord;return g(b,c),l(b,c,[]),b.module}function g(a,b){if(!b.depLoads){b.declare&&h(a,b),b.depLoads=[];for(var c=0;c<b.deps.length;c++){var d=e(b.deps[c]);b.depLoads.push(d),d.linkRecord&&g(d,d.linkRecord);var f=b.setters&&b.setters[c];f&&(f(d.module||d.linkRecord.moduleObj),d.importerSetters.push(f))}return a}}function h(b,c){var d=c.moduleObj,e=b.importerSetters,f=!1,g=c.declare.call(a,function(a,b){if(!f){if("object"==typeof a)for(var c in a)"__useDefault"!==c&&(d[c]=a[c]);else d[a]=b;f=!0;for(var g=0;g<e.length;g++)e[g](d);return f=!1,b}},{id:b.key});"function"!=typeof g?(c.setters=g.setters,c.execute=g.execute):(c.setters=[],c.execute=g)}function i(a,b,c){return n[a]={key:a,module:void 0,importerSetters:[],linkRecord:{deps:b,depLoads:void 0,declare:c,setters:void 0,execute:void 0,moduleObj:{}}}}function j(a,b,c,d){return n[a]={key:a,module:void 0,importerSetters:[],linkRecord:{deps:b,depLoads:void 0,declare:void 0,execute:d,executingRequire:c,moduleObj:{default:{},__useDefault:!0},setters:void 0}}}function k(a,b,c){return function(d){for(var e=0;e<a.length;e++)if(a[e]===d){var f,g=b[e];return f=-1===c.indexOf(g)?l(g,g.linkRecord,c):g.linkRecord.moduleObj,f.__useDefault?f.default:f}}}function l(b,c,e){if(e.push(b),b.module)return b.module;var f;if(c.setters){for(var g=0;g<c.deps.length;g++){var h=c.depLoads[g],i=h.linkRecord;i&&-1===e.indexOf(h)&&(f=l(h,i,i.setters?e:[]))}c.execute.call(q)}else{var j={id:b.key},m=c.moduleObj;Object.defineProperty(j,"exports",{configurable:!0,set:function(a){m.default=a},get:function(){return m.default}});var n=k(c.deps,c.depLoads,e);if(!c.executingRequire)for(var g=0;g<c.deps.length;g++)n(c.deps[g]);var o=c.execute.call(a,n,m.default,j);if(void 0!==o?m.default=o:j.exports!==m.default&&(m.default=j.exports),m.default&&m.default.__esModule)for(var p in m.default)Object.hasOwnProperty.call(m.default,p)&&"default"!==p&&(m[p]=m.default[p])}var j=b.module=new d(c.moduleObj);if(!c.setters)for(var g=0;g<b.importerSetters.length;g++)b.importerSetters[g](j);return j}function m(a,b){return n[a]={key:a,module:b,importerSetters:[],linkRecord:void 0}}var n={},o="undefined"!=typeof Symbol?Symbol():"@@baseObject";d.prototype=Object.create(null),"undefined"!=typeof Symbol&&Symbol.toStringTag&&(d.prototype[Symbol.toStringTag]="Module");var p="undefined"!=typeof System&&System._nodeRequire||"undefined"!=typeof require&&"undefined"!=typeof require.resolve&&"undefined"!=typeof process&&process.platform&&require,q={};return Object.freeze&&Object.freeze(q),function(a,b,e,g){return function(h){h(function(h){var k={_nodeRequire:p,register:i,registerDynamic:j,registry:{get:function(a){return n[a].module},set:m},newModule:function(a){return new d(a)}};m("@empty",new d({}));for(var l=0;l<b.length;l++)m(b[l],c(arguments[l],{}));g(k);var o=f(a[0]);if(a.length>1)for(var l=1;l<a.length;l++)f(a[l]);return e?o.default:(o instanceof d&&Object.defineProperty(o,"__esModule",{value:!0}),o)})}}}("undefined"!=typeof self?self:global)(["a"],["c"],!1,function(a){this.require,this.exports,this.module;a.registerDynamic("b",[],!0,function(a,b,c){function d(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function e(a){return"function"==typeof a}function f(a){return"number"==typeof a}function g(a){return"object"==typeof a&&null!==a}function h(a){return void 0===a}this||self;c.exports=d,d.EventEmitter=d,d.prototype._events=void 0,d.prototype._maxListeners=void 0,d.defaultMaxListeners=10,d.prototype.setMaxListeners=function(a){if(!f(a)||a<0||isNaN(a))throw TypeError("n must be a positive number");return this._maxListeners=a,this},d.prototype.emit=function(a){var b,c,d,f,i,j;if(this._events||(this._events={}),"error"===a&&(!this._events.error||g(this._events.error)&&!this._events.error.length)){if(b=arguments[1],b instanceof Error)throw b;throw TypeError('Uncaught, unspecified "error" event.')}if(c=this._events[a],h(c))return!1;if(e(c))switch(arguments.length){case 1:c.call(this);break;case 2:c.call(this,arguments[1]);break;case 3:c.call(this,arguments[1],arguments[2]);break;default:f=Array.prototype.slice.call(arguments,1),c.apply(this,f)}else if(g(c))for(f=Array.prototype.slice.call(arguments,1),j=c.slice(),d=j.length,i=0;i<d;i++)j[i].apply(this,f);return!0},d.prototype.addListener=function(a,b){var c;if(!e(b))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",a,e(b.listener)?b.listener:b),this._events[a]?g(this._events[a])?this._events[a].push(b):this._events[a]=[this._events[a],b]:this._events[a]=b,g(this._events[a])&&!this._events[a].warned&&(c=h(this._maxListeners)?d.defaultMaxListeners:this._maxListeners,c&&c>0&&this._events[a].length>c&&(this._events[a].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[a].length),"function"==typeof console.trace&&console.trace())),this},d.prototype.on=d.prototype.addListener,d.prototype.once=function(a,b){function c(){this.removeListener(a,c),d||(d=!0,b.apply(this,arguments))}if(!e(b))throw TypeError("listener must be a function");var d=!1;return c.listener=b,this.on(a,c),this},d.prototype.removeListener=function(a,b){var c,d,f,h;if(!e(b))throw TypeError("listener must be a function");if(!this._events||!this._events[a])return this;if(c=this._events[a],f=c.length,d=-1,c===b||e(c.listener)&&c.listener===b)delete this._events[a],this._events.removeListener&&this.emit("removeListener",a,b);else if(g(c)){for(h=f;h-- >0;)if(c[h]===b||c[h].listener&&c[h].listener===b){d=h;break}if(d<0)return this;1===c.length?(c.length=0,delete this._events[a]):c.splice(d,1),this._events.removeListener&&this.emit("removeListener",a,b)}return this},d.prototype.removeAllListeners=function(a){var b,c;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[a]&&delete this._events[a],this;if(0===arguments.length){for(b in this._events)"removeListener"!==b&&this.removeAllListeners(b);return this.removeAllListeners("removeListener"),this._events={},this}if(c=this._events[a],e(c))this.removeListener(a,c);else if(c)for(;c.length;)this.removeListener(a,c[c.length-1]);return delete this._events[a],this},d.prototype.listeners=function(a){var b;return b=this._events&&this._events[a]?e(this._events[a])?[this._events[a]]:this._events[a].slice():[]},d.prototype.listenerCount=function(a){if(this._events){var b=this._events[a];if(e(b))return 1;if(b)return b.length}return 0},d.listenerCount=function(a,b){return a.listenerCount(b)}}),a.register("a",["b","c"],function(a,b){"use strict";var c,d,e,f,g,h,i;return{setters:[function(a){c=a.default},function(a){d=a.default}],execute:function(){e=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},f=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),g=function(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b},h=function(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)},a("Fullscreen",i=function(a){function b(a){e(this,b);var c=g(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));return c.$element=d(a),c.element=c.$element.get(0),d(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange msfullscreenchange",c.fullscreenChange.bind(c)).on("fullscreenerror webkitfullscreenerror mozfullscreenerror msfullscreenerror",c.fullscreenError.bind(c)),setTimeout(function(){b.isSupported||c.emit("unsupported")},0),c}return h(b,a),f(b,[{key:"requestFullscreen",value:function(){var a=this.element;return a.requestFullscreen?a.requestFullscreen():a.webkitRequestFullscreen?a.webkitRequestFullscreen():a.mozRequestFullScreen?a.mozRequestFullScreen():a.msRequestFullscreen?a.msRequestFullscreen():void 0}},{key:"fullscreenChange",value:function(a){var b=this.isActive;this.emit("change",b,a),this.emit("fullscreenchange",b,a)}},{key:"fullscreenError",value:function(a){var b=new Error("fullscreen failed");this.emit("error",b,a),this.emit("fullscreenerror",b,a)}},{key:"isActive",get:function(){return b.fullscreenElement===this.element}}],[{key:"exitFullscreen",value:function(){return document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():void 0}},{key:"fullscreenElement",get:function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||null}},{key:"fullscreenEnabled",get:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled||!1}},{key:"isSupported",get:function(){return b.fullscreenEnabled}}]),b}(c)),a("Fullscreen",i),a("default",i)}}})})(function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports&&"function"==typeof require?module.exports=a(require("jquery")):jsFullscreen=a($)});