PageSourceSearch

https://www.wafc.info/blueimp/js/blueimp-gallery-fullscreen.js

js wafc.info collected 2026-10-07 21:59:01 UTC 2,276 bytes, 86 lines download raw bytes

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

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.