PHP Classes

File: upload/themes/bb_simple/assets/lightgallery/plugins/autoplay/lg-autoplay.min.js

Recommend this page to a friend!
  Classes of James Brows   PHP Bulletin Board   upload/themes/bb_simple/assets/lightgallery/plugins/autoplay/lg-autoplay.min.js   Download  
File: upload/themes/bb_simple/assets/lightgallery/plugins/autoplay/lg-autoplay.min.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: PHP Bulletin Board
Manage and post messages in multi-user forums
Author: By
Last change:
Date: 2 years ago
Size: 3,773 bytes
 

Contents

Class file image Download
/** * lightgallery | 2.2.1 | September 4th 2021 * http://www.lightgalleryjs.com/ * Copyright (c) 2020 Sachin Neravath; * @license GPLv3 */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).lgAutoplay=e()}(this,(function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,o=1,s=arguments.length;o<s;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},e="lgSlideItemLoad",o="lgBeforeSlide",s="lgAfterSlide",r="lgDragStart",i="lgDragEnd",a={autoplay:!0,slideShowAutoplay:!1,slideShowInterval:5e3,progressBar:!0,forceSlideShowAutoplay:!1,autoplayControls:!0,appendAutoplayControlsTo:".lg-toolbar"};return function(){function n(e){return this.core=e,this.settings=t(t({},a),this.core.settings),this}return n.prototype.init=function(){var t=this;this.settings.autoplay&&(this.interval=!1,this.fromAuto=!0,this.pausedOnTouchDrag=!1,this.pausedOnSlideChange=!1,this.settings.autoplayControls&&this.controls(),this.settings.progressBar&&this.core.outer.append('<div class="lg-progress-bar"><div class="lg-progress"></div></div>'),this.settings.slideShowAutoplay&&this.core.LGel.once(e+".autoplay",(function(){t.startAuto()})),this.core.LGel.on(r+".autoplay touchstart.lg.autoplay",(function(){t.interval&&(t.cancelAuto(),t.pausedOnTouchDrag=!0)})),this.core.LGel.on(i+".autoplay touchend.lg.autoplay",(function(){!t.interval&&t.pausedOnTouchDrag&&(t.startAuto(),t.pausedOnTouchDrag=!1)})),this.core.LGel.on(o+".autoplay",(function(){t.showProgressBar(),!t.fromAuto&&t.interval?(t.cancelAuto(),t.pausedOnSlideChange=!0):t.pausedOnSlideChange=!1,t.fromAuto=!1})),this.core.LGel.on(s+".autoplay",(function(){t.pausedOnSlideChange&&!t.interval&&t.settings.forceSlideShowAutoplay&&(t.startAuto(),t.pausedOnSlideChange=!1)})),this.showProgressBar())},n.prototype.showProgressBar=function(){var t=this;if(this.settings.progressBar&&this.fromAuto){var e=this.core.outer.find(".lg-progress-bar"),o=this.core.outer.find(".lg-progress");this.interval&&(o.removeAttr("style"),e.removeClass("lg-start"),setTimeout((function(){o.css("transition","width "+(t.core.settings.speed+t.settings.slideShowInterval)+"ms ease 0s"),e.addClass("lg-start")}),20))}},n.prototype.controls=function(){var t=this;this.core.outer.find(this.settings.appendAutoplayControlsTo).append('<button aria-label="Toggle autoplay" type="button" class="lg-autoplay-button lg-icon"></button>'),this.core.outer.find(".lg-autoplay-button").first().on("click.lg.autoplay",(function(){t.core.outer.hasClass("lg-show-autoplay")?t.cancelAuto():t.interval||t.startAuto()}))},n.prototype.startAuto=function(){var t=this;this.core.outer.find(".lg-progress").css("transition","width "+(this.core.settings.speed+this.settings.slideShowInterval)+"ms ease 0s"),this.core.outer.addClass("lg-show-autoplay"),this.core.outer.find(".lg-progress-bar").addClass("lg-start"),this.interval=setInterval((function(){t.core.index+1<t.core.galleryItems.length?t.core.index++:t.core.index=0,t.fromAuto=!0,t.core.slide(t.core.index,!1,!1,"next")}),this.core.settings.speed+this.settings.slideShowInterval)},n.prototype.cancelAuto=function(){this.interval&&(this.core.outer.find(".lg-progress").removeAttr("style"),this.core.outer.removeClass("lg-show-autoplay"),this.core.outer.find(".lg-progress-bar").removeClass("lg-start")),clearInterval(this.interval),this.interval=!1},n.prototype.closeGallery=function(){this.cancelAuto()},n.prototype.destroy=function(){this.settings.autoplay&&this.core.outer.find(".lg-progress-bar").remove(),this.core.LGel.off(".lg.autoplay"),this.core.LGel.off(".autoplay")},n}()}));