1/* 2 * blueimp Gallery Fullscreen JS 1.2.0 3 * https://github.com/blueimp/Gallery 4 * 5 * Copyright 2013, Sebastian Tschan 6 * https://blueimp.net 7 * 8 * Licensed under the MIT license: 9 * http://www.opensource.org/licenses/MIT 10 */ 11 12/* global define, window, document */ 13 14(function (factory) { 15 'use strict'; 16 if (typeof define === 'function' && define.amd) { 17 // Register as an anonymous AMD module: 18 define([ 19 './blueimp-helper', 20 './blueimp-gallery' 21 ], factory); 22 } else { 23 // Browser globals: 24 factory( 25 window.blueimp.helper || window.jQuery, 26 window.blueimp.Gallery 27 ); 28 } 29}(function ($, Gallery) { 30 'use strict'; 31 32 $.extend(Gallery.prototype.options, { 33 // Defines if the gallery should open in fullscreen mode: 34 fullScreen: false 35 }); 36 37 var initialize = Gallery.prototype.initialize, 38 close = Gallery.prototype.close; 39 40 $.extend(Gallery.prototype, { 41 42 getFullScreenElement: function () { 43 return document.fullscreenElement || 44 document.webkitFullscreenElement || 45 document.mozFullScreenElement || 46 document.msFullscreenElement; 47 }, 48 49 requestFullScreen: function (element) { 50 if (element.requestFullscreen) { 51 element.requestFullscreen(); 52 } else if (element.webkitRequestFullscreen) { 53 element.webkitRequestFullscreen(); 54 } else if (element.mozRequestFullScreen) { 55 element.mozRequestFullScreen(); 56 } else if (element.msRequestFullscreen) { 57 element.msRequestFullscreen(); 58 } 59 }, 60 61 exitFullScreen: function () { 62 if (document.exitFullscreen) { 63 document.exitFullscreen(); 64 } else if (document.webkitCancelFullScreen) { 65 document.webkitCancelFullScreen(); 66 } else if (document.mozCancelFullScreen) { 67 document.mozCancelFullScreen(); 68 } else if (document.msExitFullscreen) { 69 document.msExitFullscreen(); 70 } 71 }, 72 73 initialize: function () { 74 initialize.call(this); 75 if (this.options.fullScreen && !this.getFullScreenElement()) { 76 this.requestFullScreen(this.container[0]); 77 } 78 }, 79 80 close: function () { 81 if (this.getFullScreenElement() === this.container[0]) { 82 this.exitFullScreen(); 83 } 84 close.call(this); 85 } 86 87 }); 88 89 return Gallery; 90}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.