diff options
author | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2020-07-16 23:25:01 -0300 |
---|---|---|
committer | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2020-07-16 23:25:01 -0300 |
commit | d219bf257bbb6739c677882cd7c92c4feff17fba (patch) | |
tree | 758e3ad72711940b1306c01af5b23bcd20ca7ff2 /docusaurus/static/js/blueimp-gallery-fullscreen.js | |
parent | 0df6c68c4318c7d1b1a75ec82d96f03ccda8301b (diff) | |
download | PSP.git-d219bf257bbb6739c677882cd7c92c4feff17fba.tar.gz PSP.git-d219bf257bbb6739c677882cd7c92c4feff17fba.tar.xz PSP.git-d219bf257bbb6739c677882cd7c92c4feff17fba.zip |
PSP-UFu website update
Diffstat (limited to 'docusaurus/static/js/blueimp-gallery-fullscreen.js')
-rw-r--r-- | docusaurus/static/js/blueimp-gallery-fullscreen.js | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/docusaurus/static/js/blueimp-gallery-fullscreen.js b/docusaurus/static/js/blueimp-gallery-fullscreen.js new file mode 100644 index 0000000..7a1139d --- /dev/null +++ b/docusaurus/static/js/blueimp-gallery-fullscreen.js @@ -0,0 +1,86 @@ +/* + * blueimp Gallery Fullscreen JS + * https://github.com/blueimp/Gallery + * + * Copyright 2013, Sebastian Tschan + * https://blueimp.net + * + * Licensed under the MIT license: + * https://opensource.org/licenses/MIT + */ + +/* global define */ + +;(function (factory) { + 'use strict' + if (typeof define === 'function' && define.amd) { + // Register as an anonymous AMD module: + define(['./blueimp-helper', './blueimp-gallery'], factory) + } else { + // Browser globals: + factory(window.blueimp.helper || window.jQuery, window.blueimp.Gallery) + } +})(function ($, Gallery) { + 'use strict' + + var galleryPrototype = Gallery.prototype + + $.extend(galleryPrototype.options, { + // Defines if the gallery should open in fullscreen mode: + fullscreen: false + }) + + var initialize = galleryPrototype.initialize + var close = galleryPrototype.close + + $.extend(galleryPrototype, { + getFullScreenElement: function () { + return ( + document.fullscreenElement || + document.webkitFullscreenElement || + document.mozFullScreenElement || + document.msFullscreenElement + ) + }, + + requestFullScreen: function (element) { + if (element.requestFullscreen) { + element.requestFullscreen() + } else if (element.webkitRequestFullscreen) { + element.webkitRequestFullscreen() + } else if (element.mozRequestFullScreen) { + element.mozRequestFullScreen() + } else if (element.msRequestFullscreen) { + element.msRequestFullscreen() + } + }, + + exitFullScreen: function () { + if (document.exitFullscreen) { + document.exitFullscreen() + } else if (document.webkitCancelFullScreen) { + document.webkitCancelFullScreen() + } else if (document.mozCancelFullScreen) { + document.mozCancelFullScreen() + } else if (document.msExitFullscreen) { + document.msExitFullscreen() + } + }, + + initialize: function () { + initialize.call(this) + if (this.options.fullscreen && !this.getFullScreenElement()) { + this.requestFullScreen(this.container[0]) + } + }, + + close: function () { + if (this.getFullScreenElement() === this.container[0]) { + this.exitFullScreen() + } + close.call(this) + } + }) + + return Gallery +}) |