mirror of
https://bitbucket.org/bellord13/kit.git
synced 2026-11-13 19:06:11 +03:00
upLG
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
export interface FullscreenStrings {
|
||||
toggleFullscreen: string;
|
||||
}
|
||||
export interface FullscreenSettings {
|
||||
/**
|
||||
* Enable/Disable fullscreen option
|
||||
*/
|
||||
fullScreen: boolean;
|
||||
/**
|
||||
* Custom translation strings for aria-labels
|
||||
*/
|
||||
fullscreenPluginStrings: FullscreenStrings;
|
||||
}
|
||||
export declare const fullscreenSettings: FullscreenSettings;
|
||||
@@ -0,0 +1,16 @@
|
||||
import { LgQuery } from '../../lgQuery';
|
||||
import { LightGallery } from '../../lightgallery';
|
||||
import { FullscreenSettings } from './lg-fullscreen-settings';
|
||||
export default class FullScreen {
|
||||
core: LightGallery;
|
||||
settings: FullscreenSettings;
|
||||
private $LG;
|
||||
constructor(instance: LightGallery, $LG: LgQuery);
|
||||
init(): void;
|
||||
private isFullScreen;
|
||||
private requestFullscreen;
|
||||
private exitFullscreen;
|
||||
private fullScreen;
|
||||
closeGallery(): void;
|
||||
destroy(): void;
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
/*!
|
||||
* lightgallery | 2.9.0 | October 1st 2025
|
||||
* http://www.lightgalleryjs.com/
|
||||
* Copyright (c) 2020 Sachin Neravath;
|
||||
* @license GPLv3
|
||||
*/
|
||||
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */
|
||||
|
||||
var __assign = function() {
|
||||
__assign = Object.assign || function __assign(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
|
||||
var fullscreenSettings = {
|
||||
fullScreen: true,
|
||||
fullscreenPluginStrings: {
|
||||
toggleFullscreen: 'Toggle Fullscreen',
|
||||
},
|
||||
};
|
||||
|
||||
var FullScreen = /** @class */ (function () {
|
||||
function FullScreen(instance, $LG) {
|
||||
// get lightGallery core plugin instance
|
||||
this.core = instance;
|
||||
this.$LG = $LG;
|
||||
// extend module default settings with lightGallery core settings
|
||||
this.settings = __assign(__assign({}, fullscreenSettings), this.core.settings);
|
||||
return this;
|
||||
}
|
||||
FullScreen.prototype.init = function () {
|
||||
var fullScreen = '';
|
||||
if (this.settings.fullScreen) {
|
||||
// check for fullscreen browser support
|
||||
if (!document.fullscreenEnabled &&
|
||||
!document.webkitFullscreenEnabled &&
|
||||
!document.mozFullScreenEnabled &&
|
||||
!document.msFullscreenEnabled) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
fullScreen = "<button type=\"button\" aria-label=\"" + this.settings.fullscreenPluginStrings['toggleFullscreen'] + "\" class=\"lg-fullscreen lg-icon\"></button>";
|
||||
this.core.$toolbar.append(fullScreen);
|
||||
this.fullScreen();
|
||||
}
|
||||
}
|
||||
};
|
||||
FullScreen.prototype.isFullScreen = function () {
|
||||
return (document.fullscreenElement ||
|
||||
document.mozFullScreenElement ||
|
||||
document.webkitFullscreenElement ||
|
||||
document.msFullscreenElement);
|
||||
};
|
||||
FullScreen.prototype.requestFullscreen = function () {
|
||||
var el = document.documentElement;
|
||||
if (el.requestFullscreen) {
|
||||
el.requestFullscreen();
|
||||
}
|
||||
else if (el.msRequestFullscreen) {
|
||||
el.msRequestFullscreen();
|
||||
}
|
||||
else if (el.mozRequestFullScreen) {
|
||||
el.mozRequestFullScreen();
|
||||
}
|
||||
else if (el.webkitRequestFullscreen) {
|
||||
el.webkitRequestFullscreen();
|
||||
}
|
||||
};
|
||||
FullScreen.prototype.exitFullscreen = function () {
|
||||
if (document.exitFullscreen) {
|
||||
document.exitFullscreen();
|
||||
}
|
||||
else if (document.msExitFullscreen) {
|
||||
document.msExitFullscreen();
|
||||
}
|
||||
else if (document.mozCancelFullScreen) {
|
||||
document.mozCancelFullScreen();
|
||||
}
|
||||
else if (document.webkitExitFullscreen) {
|
||||
document.webkitExitFullscreen();
|
||||
}
|
||||
};
|
||||
// https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Using_full_screen_mode
|
||||
FullScreen.prototype.fullScreen = function () {
|
||||
var _this = this;
|
||||
this.$LG(document).on("fullscreenchange.lg.global" + this.core.lgId + " \n webkitfullscreenchange.lg.global" + this.core.lgId + " \n mozfullscreenchange.lg.global" + this.core.lgId + " \n MSFullscreenChange.lg.global" + this.core.lgId, function () {
|
||||
if (!_this.core.lgOpened)
|
||||
return;
|
||||
_this.core.outer.toggleClass('lg-fullscreen-on');
|
||||
});
|
||||
this.core.outer
|
||||
.find('.lg-fullscreen')
|
||||
.first()
|
||||
.on('click.lg', function () {
|
||||
if (_this.isFullScreen()) {
|
||||
_this.exitFullscreen();
|
||||
}
|
||||
else {
|
||||
_this.requestFullscreen();
|
||||
}
|
||||
});
|
||||
};
|
||||
FullScreen.prototype.closeGallery = function () {
|
||||
// exit from fullscreen if activated
|
||||
if (this.isFullScreen()) {
|
||||
this.exitFullscreen();
|
||||
}
|
||||
};
|
||||
FullScreen.prototype.destroy = function () {
|
||||
this.$LG(document).off("fullscreenchange.lg.global" + this.core.lgId + " \n webkitfullscreenchange.lg.global" + this.core.lgId + " \n mozfullscreenchange.lg.global" + this.core.lgId + " \n MSFullscreenChange.lg.global" + this.core.lgId);
|
||||
};
|
||||
return FullScreen;
|
||||
}());
|
||||
|
||||
export default FullScreen;
|
||||
//# sourceMappingURL=lg-fullscreen.es5.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* lightgallery | 2.9.0 | October 1st 2025
|
||||
* http://www.lightgalleryjs.com/
|
||||
* Copyright (c) 2020 Sachin Neravath;
|
||||
* @license GPLv3
|
||||
*/
|
||||
|
||||
!function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l():"function"==typeof define&&define.amd?define(l):(e="undefined"!=typeof globalThis?globalThis:e||self).lgFullscreen=l()}(this,(function(){"use strict";var e=function(){return(e=Object.assign||function(e){for(var l,n=1,t=arguments.length;n<t;n++)for(var c in l=arguments[n])Object.prototype.hasOwnProperty.call(l,c)&&(e[c]=l[c]);return e}).apply(this,arguments)},l={fullScreen:!0,fullscreenPluginStrings:{toggleFullscreen:"Toggle Fullscreen"}};return function(){function n(n,t){return this.core=n,this.$LG=t,this.settings=e(e({},l),this.core.settings),this}return n.prototype.init=function(){var e="";if(this.settings.fullScreen){if(!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled))return;e='<button type="button" aria-label="'+this.settings.fullscreenPluginStrings.toggleFullscreen+'" class="lg-fullscreen lg-icon"></button>',this.core.$toolbar.append(e),this.fullScreen()}},n.prototype.isFullScreen=function(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement},n.prototype.requestFullscreen=function(){var e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen()},n.prototype.exitFullscreen=function(){document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()},n.prototype.fullScreen=function(){var e=this;this.$LG(document).on("fullscreenchange.lg.global"+this.core.lgId+" \n webkitfullscreenchange.lg.global"+this.core.lgId+" \n mozfullscreenchange.lg.global"+this.core.lgId+" \n MSFullscreenChange.lg.global"+this.core.lgId,(function(){e.core.lgOpened&&e.core.outer.toggleClass("lg-fullscreen-on")})),this.core.outer.find(".lg-fullscreen").first().on("click.lg",(function(){e.isFullScreen()?e.exitFullscreen():e.requestFullscreen()}))},n.prototype.closeGallery=function(){this.isFullScreen()&&this.exitFullscreen()},n.prototype.destroy=function(){this.$LG(document).off("fullscreenchange.lg.global"+this.core.lgId+" \n webkitfullscreenchange.lg.global"+this.core.lgId+" \n mozfullscreenchange.lg.global"+this.core.lgId+" \n MSFullscreenChange.lg.global"+this.core.lgId)},n}()}));
|
||||
@@ -0,0 +1,143 @@
|
||||
/*!
|
||||
* lightgallery | 2.9.0 | October 1st 2025
|
||||
* http://www.lightgalleryjs.com/
|
||||
* Copyright (c) 2020 Sachin Neravath;
|
||||
* @license GPLv3
|
||||
*/
|
||||
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.lgFullscreen = factory());
|
||||
}(this, (function () { 'use strict';
|
||||
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */
|
||||
|
||||
var __assign = function() {
|
||||
__assign = Object.assign || function __assign(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
|
||||
var fullscreenSettings = {
|
||||
fullScreen: true,
|
||||
fullscreenPluginStrings: {
|
||||
toggleFullscreen: 'Toggle Fullscreen',
|
||||
},
|
||||
};
|
||||
|
||||
var FullScreen = /** @class */ (function () {
|
||||
function FullScreen(instance, $LG) {
|
||||
// get lightGallery core plugin instance
|
||||
this.core = instance;
|
||||
this.$LG = $LG;
|
||||
// extend module default settings with lightGallery core settings
|
||||
this.settings = __assign(__assign({}, fullscreenSettings), this.core.settings);
|
||||
return this;
|
||||
}
|
||||
FullScreen.prototype.init = function () {
|
||||
var fullScreen = '';
|
||||
if (this.settings.fullScreen) {
|
||||
// check for fullscreen browser support
|
||||
if (!document.fullscreenEnabled &&
|
||||
!document.webkitFullscreenEnabled &&
|
||||
!document.mozFullScreenEnabled &&
|
||||
!document.msFullscreenEnabled) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
fullScreen = "<button type=\"button\" aria-label=\"" + this.settings.fullscreenPluginStrings['toggleFullscreen'] + "\" class=\"lg-fullscreen lg-icon\"></button>";
|
||||
this.core.$toolbar.append(fullScreen);
|
||||
this.fullScreen();
|
||||
}
|
||||
}
|
||||
};
|
||||
FullScreen.prototype.isFullScreen = function () {
|
||||
return (document.fullscreenElement ||
|
||||
document.mozFullScreenElement ||
|
||||
document.webkitFullscreenElement ||
|
||||
document.msFullscreenElement);
|
||||
};
|
||||
FullScreen.prototype.requestFullscreen = function () {
|
||||
var el = document.documentElement;
|
||||
if (el.requestFullscreen) {
|
||||
el.requestFullscreen();
|
||||
}
|
||||
else if (el.msRequestFullscreen) {
|
||||
el.msRequestFullscreen();
|
||||
}
|
||||
else if (el.mozRequestFullScreen) {
|
||||
el.mozRequestFullScreen();
|
||||
}
|
||||
else if (el.webkitRequestFullscreen) {
|
||||
el.webkitRequestFullscreen();
|
||||
}
|
||||
};
|
||||
FullScreen.prototype.exitFullscreen = function () {
|
||||
if (document.exitFullscreen) {
|
||||
document.exitFullscreen();
|
||||
}
|
||||
else if (document.msExitFullscreen) {
|
||||
document.msExitFullscreen();
|
||||
}
|
||||
else if (document.mozCancelFullScreen) {
|
||||
document.mozCancelFullScreen();
|
||||
}
|
||||
else if (document.webkitExitFullscreen) {
|
||||
document.webkitExitFullscreen();
|
||||
}
|
||||
};
|
||||
// https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Using_full_screen_mode
|
||||
FullScreen.prototype.fullScreen = function () {
|
||||
var _this = this;
|
||||
this.$LG(document).on("fullscreenchange.lg.global" + this.core.lgId + " \n webkitfullscreenchange.lg.global" + this.core.lgId + " \n mozfullscreenchange.lg.global" + this.core.lgId + " \n MSFullscreenChange.lg.global" + this.core.lgId, function () {
|
||||
if (!_this.core.lgOpened)
|
||||
return;
|
||||
_this.core.outer.toggleClass('lg-fullscreen-on');
|
||||
});
|
||||
this.core.outer
|
||||
.find('.lg-fullscreen')
|
||||
.first()
|
||||
.on('click.lg', function () {
|
||||
if (_this.isFullScreen()) {
|
||||
_this.exitFullscreen();
|
||||
}
|
||||
else {
|
||||
_this.requestFullscreen();
|
||||
}
|
||||
});
|
||||
};
|
||||
FullScreen.prototype.closeGallery = function () {
|
||||
// exit from fullscreen if activated
|
||||
if (this.isFullScreen()) {
|
||||
this.exitFullscreen();
|
||||
}
|
||||
};
|
||||
FullScreen.prototype.destroy = function () {
|
||||
this.$LG(document).off("fullscreenchange.lg.global" + this.core.lgId + " \n webkitfullscreenchange.lg.global" + this.core.lgId + " \n mozfullscreenchange.lg.global" + this.core.lgId + " \n MSFullscreenChange.lg.global" + this.core.lgId);
|
||||
};
|
||||
return FullScreen;
|
||||
}());
|
||||
|
||||
return FullScreen;
|
||||
|
||||
})));
|
||||
//# sourceMappingURL=lg-fullscreen.umd.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "lightgallery/plugins/fullscreen",
|
||||
"private": true,
|
||||
"main": "lg-fullscreen.umd.js",
|
||||
"module": "lg-fullscreen.es5.js",
|
||||
"typings": "lg-fullscreen.d.ts"
|
||||
}
|
||||
Reference in New Issue
Block a user