lightgallery 2.4.0-beta.0 → 2.5.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/README.md +2 -2
  2. package/lg-settings.d.ts +15 -3
  3. package/lib/lg-settings.js.map +1 -1
  4. package/lib/lgQuery.js +4 -2
  5. package/lib/lgQuery.js.map +1 -1
  6. package/lib/plugins/autoplay/lg-autoplay-settings.js +3 -1
  7. package/lib/plugins/autoplay/lg-autoplay-settings.js.map +1 -1
  8. package/lib/plugins/comment/lg-comment-settings.js +3 -1
  9. package/lib/plugins/comment/lg-comment-settings.js.map +1 -1
  10. package/lib/plugins/fullscreen/lg-fullscreen-settings.js +3 -1
  11. package/lib/plugins/fullscreen/lg-fullscreen-settings.js.map +1 -1
  12. package/lib/plugins/rotate/lg-rotate-settings.js.map +1 -1
  13. package/lib/plugins/share/lg-share-settings.js.map +1 -1
  14. package/lib/plugins/thumbnail/lg-thumbnail-settings.js +3 -1
  15. package/lib/plugins/thumbnail/lg-thumbnail-settings.js.map +1 -1
  16. package/lib/plugins/video/lg-video-settings.js +1 -0
  17. package/lib/plugins/video/lg-video-settings.js.map +1 -1
  18. package/lib/plugins/video/lg-video-utils.js +13 -5
  19. package/lib/plugins/video/lg-video-utils.js.map +1 -1
  20. package/lib/plugins/video/lg-video.js +3 -1
  21. package/lib/plugins/video/lg-video.js.map +1 -1
  22. package/lib/plugins/vimeoThumbnail/lg-vimeo-thumbnail-settings.js +8 -0
  23. package/lib/plugins/vimeoThumbnail/lg-vimeo-thumbnail-settings.js.map +1 -0
  24. package/lib/plugins/vimeoThumbnail/lg-vimeo-thumbnail.js +122 -0
  25. package/lib/plugins/vimeoThumbnail/lg-vimeo-thumbnail.js.map +1 -0
  26. package/lib/plugins/zoom/lg-zoom-settings.js.map +1 -1
  27. package/lightgallery.es5.js +5 -3
  28. package/lightgallery.es5.js.map +1 -1
  29. package/lightgallery.min.js +2 -2
  30. package/lightgallery.umd.js +5 -3
  31. package/lightgallery.umd.js.map +1 -1
  32. package/lit/lightgallery.esm.js +2 -2
  33. package/lit/lightgallery.umd.js +2 -2
  34. package/package.json +1 -1
  35. package/plugins/autoplay/lg-autoplay-settings.d.ts +4 -3
  36. package/plugins/autoplay/lg-autoplay.es5.js +4 -2
  37. package/plugins/autoplay/lg-autoplay.es5.js.map +1 -1
  38. package/plugins/autoplay/lg-autoplay.min.js +1 -1
  39. package/plugins/autoplay/lg-autoplay.umd.js +4 -2
  40. package/plugins/autoplay/lg-autoplay.umd.js.map +1 -1
  41. package/plugins/comment/lg-comment-settings.d.ts +4 -3
  42. package/plugins/comment/lg-comment.es5.js +4 -2
  43. package/plugins/comment/lg-comment.es5.js.map +1 -1
  44. package/plugins/comment/lg-comment.min.js +1 -1
  45. package/plugins/comment/lg-comment.umd.js +4 -2
  46. package/plugins/comment/lg-comment.umd.js.map +1 -1
  47. package/plugins/fullscreen/lg-fullscreen-settings.d.ts +4 -3
  48. package/plugins/fullscreen/lg-fullscreen.es5.js +4 -2
  49. package/plugins/fullscreen/lg-fullscreen.es5.js.map +1 -1
  50. package/plugins/fullscreen/lg-fullscreen.min.js +1 -1
  51. package/plugins/fullscreen/lg-fullscreen.umd.js +4 -2
  52. package/plugins/fullscreen/lg-fullscreen.umd.js.map +1 -1
  53. package/plugins/hash/lg-hash.es5.js +1 -1
  54. package/plugins/hash/lg-hash.min.js +1 -1
  55. package/plugins/hash/lg-hash.umd.js +1 -1
  56. package/plugins/mediumZoom/lg-medium-zoom.es5.js +1 -1
  57. package/plugins/mediumZoom/lg-medium-zoom.min.js +1 -1
  58. package/plugins/mediumZoom/lg-medium-zoom.umd.js +1 -1
  59. package/plugins/pager/lg-pager.es5.js +1 -1
  60. package/plugins/pager/lg-pager.min.js +1 -1
  61. package/plugins/pager/lg-pager.umd.js +1 -1
  62. package/plugins/relativeCaption/lg-relative-caption.es5.js +1 -1
  63. package/plugins/relativeCaption/lg-relative-caption.min.js +1 -1
  64. package/plugins/relativeCaption/lg-relative-caption.umd.js +1 -1
  65. package/plugins/rotate/lg-rotate-settings.d.ts +8 -9
  66. package/plugins/rotate/lg-rotate.es5.js +1 -1
  67. package/plugins/rotate/lg-rotate.es5.js.map +1 -1
  68. package/plugins/rotate/lg-rotate.min.js +1 -1
  69. package/plugins/rotate/lg-rotate.umd.js +1 -1
  70. package/plugins/rotate/lg-rotate.umd.js.map +1 -1
  71. package/plugins/share/lg-share-settings.d.ts +5 -6
  72. package/plugins/share/lg-share.es5.js +1 -1
  73. package/plugins/share/lg-share.es5.js.map +1 -1
  74. package/plugins/share/lg-share.min.js +1 -1
  75. package/plugins/share/lg-share.umd.js +1 -1
  76. package/plugins/share/lg-share.umd.js.map +1 -1
  77. package/plugins/thumbnail/lg-thumbnail-settings.d.ts +5 -3
  78. package/plugins/thumbnail/lg-thumbnail.es5.js +4 -2
  79. package/plugins/thumbnail/lg-thumbnail.es5.js.map +1 -1
  80. package/plugins/thumbnail/lg-thumbnail.min.js +1 -1
  81. package/plugins/thumbnail/lg-thumbnail.umd.js +4 -2
  82. package/plugins/thumbnail/lg-thumbnail.umd.js.map +1 -1
  83. package/plugins/video/lg-video-settings.d.ts +6 -1
  84. package/plugins/video/lg-video.es5.js +18 -7
  85. package/plugins/video/lg-video.es5.js.map +1 -1
  86. package/plugins/video/lg-video.min.js +2 -2
  87. package/plugins/video/lg-video.umd.js +18 -7
  88. package/plugins/video/lg-video.umd.js.map +1 -1
  89. package/plugins/vimeoThumbnail/lg-vimeo-thumbnail-settings.d.ts +11 -0
  90. package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.d.ts +14 -0
  91. package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.es5.js +182 -0
  92. package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.es5.js.map +1 -0
  93. package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.min.js +8 -0
  94. package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.umd.js +190 -0
  95. package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.umd.js.map +1 -0
  96. package/plugins/vimeoThumbnail/package.json +7 -0
  97. package/plugins/zoom/lg-zoom-settings.d.ts +6 -3
  98. package/plugins/zoom/lg-zoom.es5.js +1 -1
  99. package/plugins/zoom/lg-zoom.es5.js.map +1 -1
  100. package/plugins/zoom/lg-zoom.min.js +1 -1
  101. package/plugins/zoom/lg-zoom.umd.js +1 -1
  102. package/plugins/zoom/lg-zoom.umd.js.map +1 -1
  103. package/react/Lightgallery.es5.js +5 -3
  104. package/react/Lightgallery.es5.js.map +1 -1
  105. package/react/Lightgallery.umd.js +5 -3
  106. package/react/Lightgallery.umd.js.map +1 -1
  107. package/vue/LightGalleryVue.common.js +3 -1
  108. package/vue/LightGalleryVue.common.js.map +1 -1
  109. package/vue/LightGalleryVue.umd.js +3 -1
  110. package/vue/LightGalleryVue.umd.js.map +1 -1
  111. package/vue/LightGalleryVue.umd.min.js +1 -1
  112. package/vue/LightGalleryVue.umd.min.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"lg-autoplay.es5.js","sources":["../../../src/lg-events.ts","../../../src/plugins/autoplay/lg-autoplay-settings.ts","../../../src/plugins/autoplay/lg-autoplay.ts"],"sourcesContent":["import { LightGallery } from './lightgallery';\nimport { VideoSource } from './plugins/video/types';\n\n/**\n * List of lightGallery events\n * All events should be documented here\n * Below interfaces are used to build the website documentations\n * */\nexport const lGEvents: {\n [key: string]: string;\n} = {\n afterAppendSlide: 'lgAfterAppendSlide',\n init: 'lgInit',\n hasVideo: 'lgHasVideo',\n containerResize: 'lgContainerResize',\n updateSlides: 'lgUpdateSlides',\n afterAppendSubHtml: 'lgAfterAppendSubHtml',\n beforeOpen: 'lgBeforeOpen',\n afterOpen: 'lgAfterOpen',\n slideItemLoad: 'lgSlideItemLoad',\n beforeSlide: 'lgBeforeSlide',\n afterSlide: 'lgAfterSlide',\n posterClick: 'lgPosterClick',\n dragStart: 'lgDragStart',\n dragMove: 'lgDragMove',\n dragEnd: 'lgDragEnd',\n beforeNextSlide: 'lgBeforeNextSlide',\n beforePrevSlide: 'lgBeforePrevSlide',\n beforeClose: 'lgBeforeClose',\n afterClose: 'lgAfterClose',\n rotateLeft: 'lgRotateLeft',\n rotateRight: 'lgRotateRight',\n flipHorizontal: 'lgFlipHorizontal',\n flipVertical: 'lgFlipVertical',\n autoplay: 'lgAutoplay',\n autoplayStart: 'lgAutoplayStart',\n autoplayStop: 'lgAutoplayStop',\n};\n\n// Follow the below format for the event documentation\n// @method is the method name when event is used with Angular/React components\n\n/**\n * Fired only once when lightGallery is initialized\n * @name lgInit\n * @method onInit\n * @example\n * const lg = document.getElementById('custom-events-demo');\n * // Perform any action on lightGallery initialization.\n * // Init event returns the plugin instance that can be used to call any lightGalley public method\n * let pluginInstance = null;\n * lg.addEventListener('lgInit', (event) => {\n * pluginInstance = event.detail.instance;\n * });\n * lightGallery(lg);\n * @see <a href=\"/docs/methods\">Methods<a>\n */\nexport interface InitDetail {\n /**\n * lightGallery plugin instance\n */\n instance: LightGallery;\n}\n\n/**\n * Fired when the slide content has been inserted into it's slide container.\n * @name lgAfterAppendSlide\n * @method onAfterAppendSlide\n */\nexport interface AfterAppendSlideEventDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired immediately before opening the gallery\n * @name lgBeforeOpen\n * @method onBeforeOpen\n */\nexport interface BeforeOpenDetail {}\n\n/**\n * Fired immediately after opening the gallery\n * @name lgAfterOpen\n * @method onAfterOpen\n */\nexport interface AfterOpenDetail {}\n\n/**\n * Fired once the media inside the slide has been completely loaded .\n * @name lgSlideItemLoad\n * @method onSlideItemLoad\n */\nexport interface SlideItemLoadDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * For the first slide, lightGallery adds some delay for displaying the loaded slide item.\n * This delay is required for the transition effect when the slide item is displayed\n * Respect the delay when you use this event\n */\n delay: number;\n\n // Will be true for the first slide\n isFirstSlide: boolean;\n}\n\n/**\n * Fired immediately before each slide transition.\n * @name lgBeforeSlide\n * @method onBeforeSlide\n * @example\n * const lg = document.getElementById('custom-events-demo');\n * // Perform any action before each slide transition\n * lg.addEventListener('lgBeforeSlide', (event) => {\n * const { index, prevIndex } = event.detail;\n * alert(index, prevIndex);\n * });\n * lightGallery(lg);\n */\nexport interface BeforeSlideDetail {\n /**\n * Index of the previous slide\n */\n prevIndex: number;\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n /**\n * true if slide function called via thumbnail click\n */\n fromThumb: boolean;\n}\n\n/**\n * Fired immediately after each slide transition.\n * @name lgAfterSlide\n * @method onAfterSlide\n */\nexport interface AfterSlideDetail {\n /**\n * Index of the previous slide\n */\n prevIndex: number;\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n /**\n * true if slide function called via thumbnail click\n */\n fromThumb: boolean;\n}\n\n/**\n * Fired when the video poster is clicked.\n * @name lgPosterClick\n * @method onPosterClick\n */\nexport interface PosterClickDetail {}\n\n/**\n * Fired when the drag event to move to different slide starts.\n * @name lgDragStart\n * @method onDragStart\n */\nexport interface DragStartDetail {}\n\n/**\n * Fired periodically during the drag operation.\n * @name lgDragMove\n * @method onDragMove\n */\nexport interface DragMoveDetail {}\n\n/**\n * Fired when the user has finished the drag operation\n * @name lgDragEnd\n * @method onDragEnd\n */\nexport interface DragEndDetail {}\n\n/**\n * Fired immediately before the start of the close process.\n * @name lgBeforeClose\n * @method onBeforeClose\n */\nexport interface BeforeCloseDetail {}\n\n/**\n * Fired immediately once lightGallery is closed.\n * @name lgAfterClose\n * @method onAfterClose\n */\nexport interface AfterCloseDetail {\n /**\n * lightGallery plugin instance\n */\n instance: LightGallery;\n}\n\n/**\n * Fired immediately before each \"next\" slide transition\n * @name lgBeforeNextSlide\n * @method onBeforeNextSlide\n */\nexport interface BeforeNextSlideDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n}\n\n/**\n * Fired immediately before each \"prev\" slide transition\n * @name lgBeforePrevSlide\n * @method onBeforePrevSlide\n */\nexport interface BeforePrevSlideDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n}\n\n/**\n * Fired when the sub-html content (ex : title/ description) has been appended into the slide.\n * @name lgAfterAppendSubHtml\n * @method onAfterAppendSubHtml\n */\nexport interface AfterAppendSubHtmlDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the lightGallery container has been resized.\n * @name lgContainerResize\n * @method onContainerResize\n */\nexport interface ContainerResizeDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when lightGallery detects video slide\n * @name lgHasVideo\n * @method onHasVideo\n */\nexport interface HasVideoDetail {\n /**\n * Index of the slide,\n */\n index: number;\n /**\n * Video source\n */\n src: string;\n /**\n * HTML5 video source if available\n * <p>\n HTML5 video source = source: {\n src: string;\n type: string;\n }[];\n attributes: HTMLVideoElement;\n * </p>\n */\n html5Video: VideoSource;\n /**\n * True if video has poster\n */\n hasPoster: boolean;\n}\n\n/**\n * Fired when the image is rotated in anticlockwise direction\n * @name lgRotateLeft\n * @method onRotateLeft\n */\nexport interface RotateLeftDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is rotated in clockwise direction\n * @name lgRotateRight\n * @method onRotateRight\n */\nexport interface RotateRightDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is flipped horizontally\n * @name lgFlipHorizontal\n * @method onFlipHorizontal\n */\nexport interface FlipHorizontalDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is flipped vertically\n * @name lgFlipVertical\n * @method onFlipVertical\n */\nexport interface FlipVerticalDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n","export interface AutoplaySettings {\n /**\n * Enable autoplay plugin\n */\n autoplay: boolean;\n\n /**\n * Enable slideshow autoplay\n */\n slideShowAutoplay: boolean;\n\n /**\n * The time (in ms) between each auto transition.\n */\n slideShowInterval: number;\n\n /**\n * Show autoplay progressBar\n */\n progressBar: boolean;\n\n /**\n * If false autoplay will be stopped after first user action\n */\n forceSlideShowAutoplay: boolean;\n\n /**\n * Show/hide autoplay controls.\n */\n autoplayControls: boolean;\n\n /**\n * Specify where the autoplay controls should be appended.\n */\n appendAutoplayControlsTo: string;\n\n /**\n * Custom translation strings for aria-labels\n */\n autoplayPluginStrings: { [key: string]: string };\n}\nexport const autoplaySettings: AutoplaySettings = {\n autoplay: true,\n slideShowAutoplay: false,\n slideShowInterval: 5000,\n progressBar: true,\n forceSlideShowAutoplay: false,\n autoplayControls: true,\n appendAutoplayControlsTo: '.lg-toolbar',\n autoplayPluginStrings: { toggleAutoplay: 'Toggle Autoplay' },\n};\n","import { lGEvents } from '../../lg-events';\nimport { LightGallery } from '../../lightgallery';\nimport { AutoplaySettings, autoplaySettings } from './lg-autoplay-settings';\n\n/**\n * Creates the autoplay plugin.\n * @param {object} element - lightGallery element\n */\nexport default class Autoplay {\n core: LightGallery;\n settings: AutoplaySettings;\n interval!: any;\n fromAuto!: boolean;\n pausedOnTouchDrag!: boolean;\n pausedOnSlideChange!: boolean;\n\n constructor(instance: LightGallery) {\n this.core = instance;\n\n // extend module default settings with lightGallery core settings\n this.settings = { ...autoplaySettings, ...this.core.settings };\n\n return this;\n }\n\n public init(): void {\n if (!this.settings.autoplay) {\n return;\n }\n\n this.interval = false;\n\n // Identify if slide happened from autoplay\n this.fromAuto = true;\n\n // Identify if autoplay canceled from touch/drag\n this.pausedOnTouchDrag = false;\n\n this.pausedOnSlideChange = false;\n\n // append autoplay controls\n if (this.settings.autoplayControls) {\n this.controls();\n }\n\n // Create progress bar\n if (this.settings.progressBar) {\n this.core.outer.append(\n '<div class=\"lg-progress-bar\"><div class=\"lg-progress\"></div></div>',\n );\n }\n\n // Start autoplay\n if (this.settings.slideShowAutoplay) {\n this.core.LGel.once(`${lGEvents.slideItemLoad}.autoplay`, () => {\n this.startAutoPlay();\n });\n }\n\n // cancel interval on touchstart and dragstart\n this.core.LGel.on(\n `${lGEvents.dragStart}.autoplay touchstart.lg.autoplay`,\n () => {\n if (this.interval) {\n this.stopAutoPlay();\n this.pausedOnTouchDrag = true;\n }\n },\n );\n\n // restore autoplay if autoplay canceled from touchstart / dragstart\n this.core.LGel.on(\n `${lGEvents.dragEnd}.autoplay touchend.lg.autoplay`,\n () => {\n if (!this.interval && this.pausedOnTouchDrag) {\n this.startAutoPlay();\n this.pausedOnTouchDrag = false;\n }\n },\n );\n\n this.core.LGel.on(`${lGEvents.beforeSlide}.autoplay`, () => {\n this.showProgressBar();\n if (!this.fromAuto && this.interval) {\n this.stopAutoPlay();\n this.pausedOnSlideChange = true;\n } else {\n this.pausedOnSlideChange = false;\n }\n this.fromAuto = false;\n });\n\n // restore autoplay if autoplay canceled from touchstart / dragstart\n this.core.LGel.on(`${lGEvents.afterSlide}.autoplay`, () => {\n if (\n this.pausedOnSlideChange &&\n !this.interval &&\n this.settings.forceSlideShowAutoplay\n ) {\n this.startAutoPlay();\n this.pausedOnSlideChange = false;\n }\n });\n\n // set progress\n this.showProgressBar();\n }\n\n private showProgressBar() {\n if (this.settings.progressBar && this.fromAuto) {\n const _$progressBar = this.core.outer.find('.lg-progress-bar');\n const _$progress = this.core.outer.find('.lg-progress');\n if (this.interval) {\n _$progress.removeAttr('style');\n _$progressBar.removeClass('lg-start');\n setTimeout(() => {\n _$progress.css(\n 'transition',\n 'width ' +\n (this.core.settings.speed +\n this.settings.slideShowInterval) +\n 'ms ease 0s',\n );\n _$progressBar.addClass('lg-start');\n }, 20);\n }\n }\n }\n\n // Manage autoplay via play/stop buttons\n private controls() {\n const _html = `<button aria-label=\"${this.settings.autoplayPluginStrings['toggleAutoplay']}\" type=\"button\" class=\"lg-autoplay-button lg-icon\"></button>`;\n\n // Append autoplay controls\n this.core.outer\n .find(this.settings.appendAutoplayControlsTo)\n .append(_html);\n\n this.core.outer\n .find('.lg-autoplay-button')\n .first()\n .on('click.lg.autoplay', () => {\n if (this.core.outer.hasClass('lg-show-autoplay')) {\n this.stopAutoPlay();\n } else {\n if (!this.interval) {\n this.startAutoPlay();\n }\n }\n });\n }\n\n // Autostart gallery\n public startAutoPlay(): void {\n this.core.outer\n .find('.lg-progress')\n .css(\n 'transition',\n 'width ' +\n (this.core.settings.speed +\n this.settings.slideShowInterval) +\n 'ms ease 0s',\n );\n this.core.outer.addClass('lg-show-autoplay');\n this.core.outer.find('.lg-progress-bar').addClass('lg-start');\n this.core.LGel.trigger(lGEvents.autoplayStart, {\n index: this.core.index,\n });\n\n this.interval = setInterval(() => {\n if (this.core.index + 1 < this.core.galleryItems.length) {\n this.core.index++;\n } else {\n this.core.index = 0;\n }\n\n this.core.LGel.trigger(lGEvents.autoplay, {\n index: this.core.index,\n });\n\n this.fromAuto = true;\n this.core.slide(this.core.index, false, false, 'next');\n }, this.core.settings.speed + this.settings.slideShowInterval);\n }\n\n // cancel Autostart\n public stopAutoPlay(): void {\n if (this.interval) {\n this.core.LGel.trigger(lGEvents.autoplayStop, {\n index: this.core.index,\n });\n this.core.outer.find('.lg-progress').removeAttr('style');\n this.core.outer.removeClass('lg-show-autoplay');\n this.core.outer.find('.lg-progress-bar').removeClass('lg-start');\n }\n clearInterval(this.interval);\n this.interval = false;\n }\n\n public closeGallery(): void {\n this.stopAutoPlay();\n }\n public destroy(): void {\n if (this.settings.autoplay) {\n this.core.outer.find('.lg-progress-bar').remove();\n }\n // Remove all event listeners added by autoplay plugin\n this.core.LGel.off('.lg.autoplay');\n this.core.LGel.off('.autoplay');\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;;;;AAKO,IAAM,QAAQ,GAEjB;IACA,gBAAgB,EAAE,oBAAoB;IACtC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,YAAY;IACt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E;QACD,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC7B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;KACzB;IAEM,+BAAY,GAAnB;QACI,IAAI,CAAC,YAAY,EAAE,CAAC;KACvB;IACM,0BAAO,GAAd;QACI,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE;YACxB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,EAAE,CAAC;SACrD;;QAED,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACnC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;KACnC;IACL,eAAC;AAAD,CAAC;;"}
1
+ {"version":3,"file":"lg-autoplay.es5.js","sources":["../../../src/lg-events.ts","../../../src/plugins/autoplay/lg-autoplay-settings.ts","../../../src/plugins/autoplay/lg-autoplay.ts"],"sourcesContent":["import { LightGallery } from './lightgallery';\nimport { VideoSource } from './plugins/video/types';\n\n/**\n * List of lightGallery events\n * All events should be documented here\n * Below interfaces are used to build the website documentations\n * */\nexport const lGEvents: {\n [key: string]: string;\n} = {\n afterAppendSlide: 'lgAfterAppendSlide',\n init: 'lgInit',\n hasVideo: 'lgHasVideo',\n containerResize: 'lgContainerResize',\n updateSlides: 'lgUpdateSlides',\n afterAppendSubHtml: 'lgAfterAppendSubHtml',\n beforeOpen: 'lgBeforeOpen',\n afterOpen: 'lgAfterOpen',\n slideItemLoad: 'lgSlideItemLoad',\n beforeSlide: 'lgBeforeSlide',\n afterSlide: 'lgAfterSlide',\n posterClick: 'lgPosterClick',\n dragStart: 'lgDragStart',\n dragMove: 'lgDragMove',\n dragEnd: 'lgDragEnd',\n beforeNextSlide: 'lgBeforeNextSlide',\n beforePrevSlide: 'lgBeforePrevSlide',\n beforeClose: 'lgBeforeClose',\n afterClose: 'lgAfterClose',\n rotateLeft: 'lgRotateLeft',\n rotateRight: 'lgRotateRight',\n flipHorizontal: 'lgFlipHorizontal',\n flipVertical: 'lgFlipVertical',\n autoplay: 'lgAutoplay',\n autoplayStart: 'lgAutoplayStart',\n autoplayStop: 'lgAutoplayStop',\n};\n\n// Follow the below format for the event documentation\n// @method is the method name when event is used with Angular/React components\n\n/**\n * Fired only once when lightGallery is initialized\n * @name lgInit\n * @method onInit\n * @example\n * const lg = document.getElementById('custom-events-demo');\n * // Perform any action on lightGallery initialization.\n * // Init event returns the plugin instance that can be used to call any lightGalley public method\n * let pluginInstance = null;\n * lg.addEventListener('lgInit', (event) => {\n * pluginInstance = event.detail.instance;\n * });\n * lightGallery(lg);\n * @see <a href=\"/docs/methods\">Methods<a>\n */\nexport interface InitDetail {\n /**\n * lightGallery plugin instance\n */\n instance: LightGallery;\n}\n\n/**\n * Fired when the slide content has been inserted into it's slide container.\n * @name lgAfterAppendSlide\n * @method onAfterAppendSlide\n */\nexport interface AfterAppendSlideEventDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired immediately before opening the gallery\n * @name lgBeforeOpen\n * @method onBeforeOpen\n */\nexport interface BeforeOpenDetail {}\n\n/**\n * Fired immediately after opening the gallery\n * @name lgAfterOpen\n * @method onAfterOpen\n */\nexport interface AfterOpenDetail {}\n\n/**\n * Fired once the media inside the slide has been completely loaded .\n * @name lgSlideItemLoad\n * @method onSlideItemLoad\n */\nexport interface SlideItemLoadDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * For the first slide, lightGallery adds some delay for displaying the loaded slide item.\n * This delay is required for the transition effect when the slide item is displayed\n * Respect the delay when you use this event\n */\n delay: number;\n\n // Will be true for the first slide\n isFirstSlide: boolean;\n}\n\n/**\n * Fired immediately before each slide transition.\n * @name lgBeforeSlide\n * @method onBeforeSlide\n * @example\n * const lg = document.getElementById('custom-events-demo');\n * // Perform any action before each slide transition\n * lg.addEventListener('lgBeforeSlide', (event) => {\n * const { index, prevIndex } = event.detail;\n * alert(index, prevIndex);\n * });\n * lightGallery(lg);\n */\nexport interface BeforeSlideDetail {\n /**\n * Index of the previous slide\n */\n prevIndex: number;\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n /**\n * true if slide function called via thumbnail click\n */\n fromThumb: boolean;\n}\n\n/**\n * Fired immediately after each slide transition.\n * @name lgAfterSlide\n * @method onAfterSlide\n */\nexport interface AfterSlideDetail {\n /**\n * Index of the previous slide\n */\n prevIndex: number;\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n /**\n * true if slide function called via thumbnail click\n */\n fromThumb: boolean;\n}\n\n/**\n * Fired when the video poster is clicked.\n * @name lgPosterClick\n * @method onPosterClick\n */\nexport interface PosterClickDetail {}\n\n/**\n * Fired when the drag event to move to different slide starts.\n * @name lgDragStart\n * @method onDragStart\n */\nexport interface DragStartDetail {}\n\n/**\n * Fired periodically during the drag operation.\n * @name lgDragMove\n * @method onDragMove\n */\nexport interface DragMoveDetail {}\n\n/**\n * Fired when the user has finished the drag operation\n * @name lgDragEnd\n * @method onDragEnd\n */\nexport interface DragEndDetail {}\n\n/**\n * Fired immediately before the start of the close process.\n * @name lgBeforeClose\n * @method onBeforeClose\n */\nexport interface BeforeCloseDetail {}\n\n/**\n * Fired immediately once lightGallery is closed.\n * @name lgAfterClose\n * @method onAfterClose\n */\nexport interface AfterCloseDetail {\n /**\n * lightGallery plugin instance\n */\n instance: LightGallery;\n}\n\n/**\n * Fired immediately before each \"next\" slide transition\n * @name lgBeforeNextSlide\n * @method onBeforeNextSlide\n */\nexport interface BeforeNextSlideDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n}\n\n/**\n * Fired immediately before each \"prev\" slide transition\n * @name lgBeforePrevSlide\n * @method onBeforePrevSlide\n */\nexport interface BeforePrevSlideDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n}\n\n/**\n * Fired when the sub-html content (ex : title/ description) has been appended into the slide.\n * @name lgAfterAppendSubHtml\n * @method onAfterAppendSubHtml\n */\nexport interface AfterAppendSubHtmlDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the lightGallery container has been resized.\n * @name lgContainerResize\n * @method onContainerResize\n */\nexport interface ContainerResizeDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when lightGallery detects video slide\n * @name lgHasVideo\n * @method onHasVideo\n */\nexport interface HasVideoDetail {\n /**\n * Index of the slide,\n */\n index: number;\n /**\n * Video source\n */\n src: string;\n /**\n * HTML5 video source if available\n * <p>\n HTML5 video source = source: {\n src: string;\n type: string;\n }[];\n attributes: HTMLVideoElement;\n * </p>\n */\n html5Video: VideoSource;\n /**\n * True if video has poster\n */\n hasPoster: boolean;\n}\n\n/**\n * Fired when the image is rotated in anticlockwise direction\n * @name lgRotateLeft\n * @method onRotateLeft\n */\nexport interface RotateLeftDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is rotated in clockwise direction\n * @name lgRotateRight\n * @method onRotateRight\n */\nexport interface RotateRightDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is flipped horizontally\n * @name lgFlipHorizontal\n * @method onFlipHorizontal\n */\nexport interface FlipHorizontalDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is flipped vertically\n * @name lgFlipVertical\n * @method onFlipVertical\n */\nexport interface FlipVerticalDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n","export interface AutoplayStrings {\n toggleAutoplay: string;\n}\n\nexport interface AutoplaySettings {\n /**\n * Enable autoplay plugin\n */\n autoplay: boolean;\n\n /**\n * Enable slideshow autoplay\n */\n slideShowAutoplay: boolean;\n\n /**\n * The time (in ms) between each auto transition.\n */\n slideShowInterval: number;\n\n /**\n * Show autoplay progressBar\n */\n progressBar: boolean;\n\n /**\n * If false autoplay will be stopped after first user action\n */\n forceSlideShowAutoplay: boolean;\n\n /**\n * Show/hide autoplay controls.\n */\n autoplayControls: boolean;\n\n /**\n * Specify where the autoplay controls should be appended.\n */\n appendAutoplayControlsTo: string;\n\n /**\n * Custom translation strings for aria-labels\n */\n autoplayPluginStrings: AutoplayStrings;\n}\nexport const autoplaySettings: AutoplaySettings = {\n autoplay: true,\n slideShowAutoplay: false,\n slideShowInterval: 5000,\n progressBar: true,\n forceSlideShowAutoplay: false,\n autoplayControls: true,\n appendAutoplayControlsTo: '.lg-toolbar',\n autoplayPluginStrings: {\n toggleAutoplay: 'Toggle Autoplay',\n } as AutoplayStrings,\n};\n","import { lGEvents } from '../../lg-events';\nimport { LightGallery } from '../../lightgallery';\nimport { AutoplaySettings, autoplaySettings } from './lg-autoplay-settings';\n\n/**\n * Creates the autoplay plugin.\n * @param {object} element - lightGallery element\n */\nexport default class Autoplay {\n core: LightGallery;\n settings: AutoplaySettings;\n interval!: any;\n fromAuto!: boolean;\n pausedOnTouchDrag!: boolean;\n pausedOnSlideChange!: boolean;\n\n constructor(instance: LightGallery) {\n this.core = instance;\n\n // extend module default settings with lightGallery core settings\n this.settings = { ...autoplaySettings, ...this.core.settings };\n\n return this;\n }\n\n public init(): void {\n if (!this.settings.autoplay) {\n return;\n }\n\n this.interval = false;\n\n // Identify if slide happened from autoplay\n this.fromAuto = true;\n\n // Identify if autoplay canceled from touch/drag\n this.pausedOnTouchDrag = false;\n\n this.pausedOnSlideChange = false;\n\n // append autoplay controls\n if (this.settings.autoplayControls) {\n this.controls();\n }\n\n // Create progress bar\n if (this.settings.progressBar) {\n this.core.outer.append(\n '<div class=\"lg-progress-bar\"><div class=\"lg-progress\"></div></div>',\n );\n }\n\n // Start autoplay\n if (this.settings.slideShowAutoplay) {\n this.core.LGel.once(`${lGEvents.slideItemLoad}.autoplay`, () => {\n this.startAutoPlay();\n });\n }\n\n // cancel interval on touchstart and dragstart\n this.core.LGel.on(\n `${lGEvents.dragStart}.autoplay touchstart.lg.autoplay`,\n () => {\n if (this.interval) {\n this.stopAutoPlay();\n this.pausedOnTouchDrag = true;\n }\n },\n );\n\n // restore autoplay if autoplay canceled from touchstart / dragstart\n this.core.LGel.on(\n `${lGEvents.dragEnd}.autoplay touchend.lg.autoplay`,\n () => {\n if (!this.interval && this.pausedOnTouchDrag) {\n this.startAutoPlay();\n this.pausedOnTouchDrag = false;\n }\n },\n );\n\n this.core.LGel.on(`${lGEvents.beforeSlide}.autoplay`, () => {\n this.showProgressBar();\n if (!this.fromAuto && this.interval) {\n this.stopAutoPlay();\n this.pausedOnSlideChange = true;\n } else {\n this.pausedOnSlideChange = false;\n }\n this.fromAuto = false;\n });\n\n // restore autoplay if autoplay canceled from touchstart / dragstart\n this.core.LGel.on(`${lGEvents.afterSlide}.autoplay`, () => {\n if (\n this.pausedOnSlideChange &&\n !this.interval &&\n this.settings.forceSlideShowAutoplay\n ) {\n this.startAutoPlay();\n this.pausedOnSlideChange = false;\n }\n });\n\n // set progress\n this.showProgressBar();\n }\n\n private showProgressBar() {\n if (this.settings.progressBar && this.fromAuto) {\n const _$progressBar = this.core.outer.find('.lg-progress-bar');\n const _$progress = this.core.outer.find('.lg-progress');\n if (this.interval) {\n _$progress.removeAttr('style');\n _$progressBar.removeClass('lg-start');\n setTimeout(() => {\n _$progress.css(\n 'transition',\n 'width ' +\n (this.core.settings.speed +\n this.settings.slideShowInterval) +\n 'ms ease 0s',\n );\n _$progressBar.addClass('lg-start');\n }, 20);\n }\n }\n }\n\n // Manage autoplay via play/stop buttons\n private controls() {\n const _html = `<button aria-label=\"${this.settings.autoplayPluginStrings['toggleAutoplay']}\" type=\"button\" class=\"lg-autoplay-button lg-icon\"></button>`;\n\n // Append autoplay controls\n this.core.outer\n .find(this.settings.appendAutoplayControlsTo)\n .append(_html);\n\n this.core.outer\n .find('.lg-autoplay-button')\n .first()\n .on('click.lg.autoplay', () => {\n if (this.core.outer.hasClass('lg-show-autoplay')) {\n this.stopAutoPlay();\n } else {\n if (!this.interval) {\n this.startAutoPlay();\n }\n }\n });\n }\n\n // Autostart gallery\n public startAutoPlay(): void {\n this.core.outer\n .find('.lg-progress')\n .css(\n 'transition',\n 'width ' +\n (this.core.settings.speed +\n this.settings.slideShowInterval) +\n 'ms ease 0s',\n );\n this.core.outer.addClass('lg-show-autoplay');\n this.core.outer.find('.lg-progress-bar').addClass('lg-start');\n this.core.LGel.trigger(lGEvents.autoplayStart, {\n index: this.core.index,\n });\n\n this.interval = setInterval(() => {\n if (this.core.index + 1 < this.core.galleryItems.length) {\n this.core.index++;\n } else {\n this.core.index = 0;\n }\n\n this.core.LGel.trigger(lGEvents.autoplay, {\n index: this.core.index,\n });\n\n this.fromAuto = true;\n this.core.slide(this.core.index, false, false, 'next');\n }, this.core.settings.speed + this.settings.slideShowInterval);\n }\n\n // cancel Autostart\n public stopAutoPlay(): void {\n if (this.interval) {\n this.core.LGel.trigger(lGEvents.autoplayStop, {\n index: this.core.index,\n });\n this.core.outer.find('.lg-progress').removeAttr('style');\n this.core.outer.removeClass('lg-show-autoplay');\n this.core.outer.find('.lg-progress-bar').removeClass('lg-start');\n }\n clearInterval(this.interval);\n this.interval = false;\n }\n\n public closeGallery(): void {\n this.stopAutoPlay();\n }\n public destroy(): void {\n if (this.settings.autoplay) {\n this.core.outer.find('.lg-progress-bar').remove();\n }\n // Remove all event listeners added by autoplay plugin\n this.core.LGel.off('.lg.autoplay');\n this.core.LGel.off('.autoplay');\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;;;;AAKO,IAAM,QAAQ,GAEjB;IACA,gBAAgB,EAAE,oBAAoB;IACtC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,YAAY;IACtB,eAAe,EAAE,mBAAmB;IACpC,YAAY,EAAE,gBAAgB;IAC9B,kBAAkB,EAAE,sBAAsB;IA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KAAK,CAAC;KACzB;IAEM,+BAAY,GAAnB;QACI,IAAI,CAAC,YAAY,EAAE,CAAC;KACvB;IACM,0BAAO,GAAd;QACI,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE;YACxB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,EAAE,CAAC;SACrD;;QAED,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACnC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;KACnC;IACL,eAAC;AAAD,CAAC;;"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * lightgallery | 2.4.0-beta.0 | December 12th 2021
2
+ * lightgallery | 2.5.0-beta.2 | March 6th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * lightgallery | 2.4.0-beta.0 | December 12th 2021
2
+ * lightgallery | 2.5.0-beta.2 | March 6th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -79,7 +79,9 @@
79
79
  forceSlideShowAutoplay: false,
80
80
  autoplayControls: true,
81
81
  appendAutoplayControlsTo: '.lg-toolbar',
82
- autoplayPluginStrings: { toggleAutoplay: 'Toggle Autoplay' },
82
+ autoplayPluginStrings: {
83
+ toggleAutoplay: 'Toggle Autoplay',
84
+ },
83
85
  };
84
86
 
85
87
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"lg-autoplay.umd.js","sources":["../../../src/lg-events.ts","../../../src/plugins/autoplay/lg-autoplay-settings.ts","../../../src/plugins/autoplay/lg-autoplay.ts"],"sourcesContent":["import { LightGallery } from './lightgallery';\nimport { VideoSource } from './plugins/video/types';\n\n/**\n * List of lightGallery events\n * All events should be documented here\n * Below interfaces are used to build the website documentations\n * */\nexport const lGEvents: {\n [key: string]: string;\n} = {\n afterAppendSlide: 'lgAfterAppendSlide',\n init: 'lgInit',\n hasVideo: 'lgHasVideo',\n containerResize: 'lgContainerResize',\n updateSlides: 'lgUpdateSlides',\n afterAppendSubHtml: 'lgAfterAppendSubHtml',\n beforeOpen: 'lgBeforeOpen',\n afterOpen: 'lgAfterOpen',\n slideItemLoad: 'lgSlideItemLoad',\n beforeSlide: 'lgBeforeSlide',\n afterSlide: 'lgAfterSlide',\n posterClick: 'lgPosterClick',\n dragStart: 'lgDragStart',\n dragMove: 'lgDragMove',\n dragEnd: 'lgDragEnd',\n beforeNextSlide: 'lgBeforeNextSlide',\n beforePrevSlide: 'lgBeforePrevSlide',\n beforeClose: 'lgBeforeClose',\n afterClose: 'lgAfterClose',\n rotateLeft: 'lgRotateLeft',\n rotateRight: 'lgRotateRight',\n flipHorizontal: 'lgFlipHorizontal',\n flipVertical: 'lgFlipVertical',\n autoplay: 'lgAutoplay',\n autoplayStart: 'lgAutoplayStart',\n autoplayStop: 'lgAutoplayStop',\n};\n\n// Follow the below format for the event documentation\n// @method is the method name when event is used with Angular/React components\n\n/**\n * Fired only once when lightGallery is initialized\n * @name lgInit\n * @method onInit\n * @example\n * const lg = document.getElementById('custom-events-demo');\n * // Perform any action on lightGallery initialization.\n * // Init event returns the plugin instance that can be used to call any lightGalley public method\n * let pluginInstance = null;\n * lg.addEventListener('lgInit', (event) => {\n * pluginInstance = event.detail.instance;\n * });\n * lightGallery(lg);\n * @see <a href=\"/docs/methods\">Methods<a>\n */\nexport interface InitDetail {\n /**\n * lightGallery plugin instance\n */\n instance: LightGallery;\n}\n\n/**\n * Fired when the slide content has been inserted into it's slide container.\n * @name lgAfterAppendSlide\n * @method onAfterAppendSlide\n */\nexport interface AfterAppendSlideEventDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired immediately before opening the gallery\n * @name lgBeforeOpen\n * @method onBeforeOpen\n */\nexport interface BeforeOpenDetail {}\n\n/**\n * Fired immediately after opening the gallery\n * @name lgAfterOpen\n * @method onAfterOpen\n */\nexport interface AfterOpenDetail {}\n\n/**\n * Fired once the media inside the slide has been completely loaded .\n * @name lgSlideItemLoad\n * @method onSlideItemLoad\n */\nexport interface SlideItemLoadDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * For the first slide, lightGallery adds some delay for displaying the loaded slide item.\n * This delay is required for the transition effect when the slide item is displayed\n * Respect the delay when you use this event\n */\n delay: number;\n\n // Will be true for the first slide\n isFirstSlide: boolean;\n}\n\n/**\n * Fired immediately before each slide transition.\n * @name lgBeforeSlide\n * @method onBeforeSlide\n * @example\n * const lg = document.getElementById('custom-events-demo');\n * // Perform any action before each slide transition\n * lg.addEventListener('lgBeforeSlide', (event) => {\n * const { index, prevIndex } = event.detail;\n * alert(index, prevIndex);\n * });\n * lightGallery(lg);\n */\nexport interface BeforeSlideDetail {\n /**\n * Index of the previous slide\n */\n prevIndex: number;\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n /**\n * true if slide function called via thumbnail click\n */\n fromThumb: boolean;\n}\n\n/**\n * Fired immediately after each slide transition.\n * @name lgAfterSlide\n * @method onAfterSlide\n */\nexport interface AfterSlideDetail {\n /**\n * Index of the previous slide\n */\n prevIndex: number;\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n /**\n * true if slide function called via thumbnail click\n */\n fromThumb: boolean;\n}\n\n/**\n * Fired when the video poster is clicked.\n * @name lgPosterClick\n * @method onPosterClick\n */\nexport interface PosterClickDetail {}\n\n/**\n * Fired when the drag event to move to different slide starts.\n * @name lgDragStart\n * @method onDragStart\n */\nexport interface DragStartDetail {}\n\n/**\n * Fired periodically during the drag operation.\n * @name lgDragMove\n * @method onDragMove\n */\nexport interface DragMoveDetail {}\n\n/**\n * Fired when the user has finished the drag operation\n * @name lgDragEnd\n * @method onDragEnd\n */\nexport interface DragEndDetail {}\n\n/**\n * Fired immediately before the start of the close process.\n * @name lgBeforeClose\n * @method onBeforeClose\n */\nexport interface BeforeCloseDetail {}\n\n/**\n * Fired immediately once lightGallery is closed.\n * @name lgAfterClose\n * @method onAfterClose\n */\nexport interface AfterCloseDetail {\n /**\n * lightGallery plugin instance\n */\n instance: LightGallery;\n}\n\n/**\n * Fired immediately before each \"next\" slide transition\n * @name lgBeforeNextSlide\n * @method onBeforeNextSlide\n */\nexport interface BeforeNextSlideDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n}\n\n/**\n * Fired immediately before each \"prev\" slide transition\n * @name lgBeforePrevSlide\n * @method onBeforePrevSlide\n */\nexport interface BeforePrevSlideDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n}\n\n/**\n * Fired when the sub-html content (ex : title/ description) has been appended into the slide.\n * @name lgAfterAppendSubHtml\n * @method onAfterAppendSubHtml\n */\nexport interface AfterAppendSubHtmlDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the lightGallery container has been resized.\n * @name lgContainerResize\n * @method onContainerResize\n */\nexport interface ContainerResizeDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when lightGallery detects video slide\n * @name lgHasVideo\n * @method onHasVideo\n */\nexport interface HasVideoDetail {\n /**\n * Index of the slide,\n */\n index: number;\n /**\n * Video source\n */\n src: string;\n /**\n * HTML5 video source if available\n * <p>\n HTML5 video source = source: {\n src: string;\n type: string;\n }[];\n attributes: HTMLVideoElement;\n * </p>\n */\n html5Video: VideoSource;\n /**\n * True if video has poster\n */\n hasPoster: boolean;\n}\n\n/**\n * Fired when the image is rotated in anticlockwise direction\n * @name lgRotateLeft\n * @method onRotateLeft\n */\nexport interface RotateLeftDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is rotated in clockwise direction\n * @name lgRotateRight\n * @method onRotateRight\n */\nexport interface RotateRightDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is flipped horizontally\n * @name lgFlipHorizontal\n * @method onFlipHorizontal\n */\nexport interface FlipHorizontalDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is flipped vertically\n * @name lgFlipVertical\n * @method onFlipVertical\n */\nexport interface FlipVerticalDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n","export interface AutoplaySettings {\n /**\n * Enable autoplay plugin\n */\n autoplay: boolean;\n\n /**\n * Enable slideshow autoplay\n */\n slideShowAutoplay: boolean;\n\n /**\n * The time (in ms) between each auto transition.\n */\n slideShowInterval: number;\n\n /**\n * Show autoplay progressBar\n */\n progressBar: boolean;\n\n /**\n * If false autoplay will be stopped after first user action\n */\n forceSlideShowAutoplay: boolean;\n\n /**\n * Show/hide autoplay controls.\n */\n autoplayControls: boolean;\n\n /**\n * Specify where the autoplay controls should be appended.\n */\n appendAutoplayControlsTo: string;\n\n /**\n * Custom translation strings for aria-labels\n */\n autoplayPluginStrings: { [key: string]: string };\n}\nexport const autoplaySettings: AutoplaySettings = {\n autoplay: true,\n slideShowAutoplay: false,\n slideShowInterval: 5000,\n progressBar: true,\n forceSlideShowAutoplay: false,\n autoplayControls: true,\n appendAutoplayControlsTo: '.lg-toolbar',\n autoplayPluginStrings: { toggleAutoplay: 'Toggle Autoplay' },\n};\n","import { lGEvents } from '../../lg-events';\nimport { LightGallery } from '../../lightgallery';\nimport { AutoplaySettings, autoplaySettings } from './lg-autoplay-settings';\n\n/**\n * Creates the autoplay plugin.\n * @param {object} element - lightGallery element\n */\nexport default class Autoplay {\n core: LightGallery;\n settings: AutoplaySettings;\n interval!: any;\n fromAuto!: boolean;\n pausedOnTouchDrag!: boolean;\n pausedOnSlideChange!: boolean;\n\n constructor(instance: LightGallery) {\n this.core = instance;\n\n // extend module default settings with lightGallery core settings\n this.settings = { ...autoplaySettings, ...this.core.settings };\n\n return this;\n }\n\n public init(): void {\n if (!this.settings.autoplay) {\n return;\n }\n\n this.interval = false;\n\n // Identify if slide happened from autoplay\n this.fromAuto = true;\n\n // Identify if autoplay canceled from touch/drag\n this.pausedOnTouchDrag = false;\n\n this.pausedOnSlideChange = false;\n\n // append autoplay controls\n if (this.settings.autoplayControls) {\n this.controls();\n }\n\n // Create progress bar\n if (this.settings.progressBar) {\n this.core.outer.append(\n '<div class=\"lg-progress-bar\"><div class=\"lg-progress\"></div></div>',\n );\n }\n\n // Start autoplay\n if (this.settings.slideShowAutoplay) {\n this.core.LGel.once(`${lGEvents.slideItemLoad}.autoplay`, () => {\n this.startAutoPlay();\n });\n }\n\n // cancel interval on touchstart and dragstart\n this.core.LGel.on(\n `${lGEvents.dragStart}.autoplay touchstart.lg.autoplay`,\n () => {\n if (this.interval) {\n this.stopAutoPlay();\n this.pausedOnTouchDrag = true;\n }\n },\n );\n\n // restore autoplay if autoplay canceled from touchstart / dragstart\n this.core.LGel.on(\n `${lGEvents.dragEnd}.autoplay touchend.lg.autoplay`,\n () => {\n if (!this.interval && this.pausedOnTouchDrag) {\n this.startAutoPlay();\n this.pausedOnTouchDrag = false;\n }\n },\n );\n\n this.core.LGel.on(`${lGEvents.beforeSlide}.autoplay`, () => {\n this.showProgressBar();\n if (!this.fromAuto && this.interval) {\n this.stopAutoPlay();\n this.pausedOnSlideChange = true;\n } else {\n this.pausedOnSlideChange = false;\n }\n this.fromAuto = false;\n });\n\n // restore autoplay if autoplay canceled from touchstart / dragstart\n this.core.LGel.on(`${lGEvents.afterSlide}.autoplay`, () => {\n if (\n this.pausedOnSlideChange &&\n !this.interval &&\n this.settings.forceSlideShowAutoplay\n ) {\n this.startAutoPlay();\n this.pausedOnSlideChange = false;\n }\n });\n\n // set progress\n this.showProgressBar();\n }\n\n private showProgressBar() {\n if (this.settings.progressBar && this.fromAuto) {\n const _$progressBar = this.core.outer.find('.lg-progress-bar');\n const _$progress = this.core.outer.find('.lg-progress');\n if (this.interval) {\n _$progress.removeAttr('style');\n _$progressBar.removeClass('lg-start');\n setTimeout(() => {\n _$progress.css(\n 'transition',\n 'width ' +\n (this.core.settings.speed +\n this.settings.slideShowInterval) +\n 'ms ease 0s',\n );\n _$progressBar.addClass('lg-start');\n }, 20);\n }\n }\n }\n\n // Manage autoplay via play/stop buttons\n private controls() {\n const _html = `<button aria-label=\"${this.settings.autoplayPluginStrings['toggleAutoplay']}\" type=\"button\" class=\"lg-autoplay-button lg-icon\"></button>`;\n\n // Append autoplay controls\n this.core.outer\n .find(this.settings.appendAutoplayControlsTo)\n .append(_html);\n\n this.core.outer\n .find('.lg-autoplay-button')\n .first()\n .on('click.lg.autoplay', () => {\n if (this.core.outer.hasClass('lg-show-autoplay')) {\n this.stopAutoPlay();\n } else {\n if (!this.interval) {\n this.startAutoPlay();\n }\n }\n });\n }\n\n // Autostart gallery\n public startAutoPlay(): void {\n this.core.outer\n .find('.lg-progress')\n .css(\n 'transition',\n 'width ' +\n (this.core.settings.speed +\n this.settings.slideShowInterval) +\n 'ms ease 0s',\n );\n this.core.outer.addClass('lg-show-autoplay');\n this.core.outer.find('.lg-progress-bar').addClass('lg-start');\n this.core.LGel.trigger(lGEvents.autoplayStart, {\n index: this.core.index,\n });\n\n this.interval = setInterval(() => {\n if (this.core.index + 1 < this.core.galleryItems.length) {\n this.core.index++;\n } else {\n this.core.index = 0;\n }\n\n this.core.LGel.trigger(lGEvents.autoplay, {\n index: this.core.index,\n });\n\n this.fromAuto = true;\n this.core.slide(this.core.index, false, false, 'next');\n }, this.core.settings.speed + this.settings.slideShowInterval);\n }\n\n // cancel Autostart\n public stopAutoPlay(): void {\n if (this.interval) {\n this.core.LGel.trigger(lGEvents.autoplayStop, {\n index: this.core.index,\n });\n this.core.outer.find('.lg-progress').removeAttr('style');\n this.core.outer.removeClass('lg-show-autoplay');\n this.core.outer.find('.lg-progress-bar').removeClass('lg-start');\n }\n clearInterval(this.interval);\n this.interval = false;\n }\n\n public closeGallery(): void {\n this.stopAutoPlay();\n }\n public destroy(): void {\n if (this.settings.autoplay) {\n this.core.outer.find('.lg-progress-bar').remove();\n }\n // Remove all event listeners added by autoplay plugin\n this.core.LGel.off('.lg.autoplay');\n this.core.LGel.off('.autoplay');\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAGA;;;;;IAKO,IAAM,QAAQ,GAEjB;QACA,gBAAgB,EAAE,oBAAoB;QACtC,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,YAAY;QACtB,eAAe,EAAE,mBAAmB;QACpC,YAAY,EAAE,gBAAgB;QAC9B,kBAAkB,EAAE,sBAAsB;QAC1C,UAAU,EAAE,cAAc;QAC1B,SAAS,EAAE,aAAa;QACxB,aAAa,EAAE,iBAAiB;QAChC,WAAW,EAAE,eAAe;QAC5B,UAAU,EAAE,cAAc;QAC1B,WAAW,EAAE,eAAe;QAC5B,SAAS,EAAE,aAAa;QACxB,QAAQ,EAAE,YAAY;QACtB,OAAO,EAAE,WAAW;QACpB,eAAe,EAAE,mBAAmB;QACpC,eAAe,EAAE,mBAAmB;QACpC,WAAW,EAAE,eAAe;QAC5B,UAAU,EAAE,cAAc;QAC1B,UAAU,EAAE,cAAc;QAC1B,WAAW,EAAE,eAAe;QAC5B,cAAc,EAAE,kBAAkB;QAClC,YAAY,EAAE,gBAAgB;QAC9B,QAAQ,EAAE,YAAY;QACtB,aAAa,EAAE,iBAAiB;QAChC,YAAY,EAAE,gBAAgB;KACjC;;ICIM,IAAM,gBAAgB,GAAqB;QAC9C,QAAQ,EAAE,IAAI;QACd,iBAAiB,EAAE,KAAK;QACxB,iBAAiB,EAAE,IAAI;QACvB,WAAW,EAAE,IAAI;QACjB,sBAAsB,EAAE,KAAK;QAC7B,gBAAgB,EAAE,IAAI;QACtB,wBAAwB,EAAE,aAAa;QACvC,qBAAqB,EAAE,EAAE,cAAc,E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EAAE;gBACf,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,EAAE;oBAC1C,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK;iBACzB,CAAC,CAAC;gBACH,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;gBACzD,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;gBAChD,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;aACpE;YACD,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC7B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;SACzB;QAEM,+BAAY,GAAnB;YACI,IAAI,CAAC,YAAY,EAAE,CAAC;SACvB;QACM,0BAAO,GAAd;YACI,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE;gBACxB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,EAAE,CAAC;aACrD;;YAED,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;YACnC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;SACnC;QACL,eAAC;IAAD,CAAC;;;;"}
1
+ {"version":3,"file":"lg-autoplay.umd.js","sources":["../../../src/lg-events.ts","../../../src/plugins/autoplay/lg-autoplay-settings.ts","../../../src/plugins/autoplay/lg-autoplay.ts"],"sourcesContent":["import { LightGallery } from './lightgallery';\nimport { VideoSource } from './plugins/video/types';\n\n/**\n * List of lightGallery events\n * All events should be documented here\n * Below interfaces are used to build the website documentations\n * */\nexport const lGEvents: {\n [key: string]: string;\n} = {\n afterAppendSlide: 'lgAfterAppendSlide',\n init: 'lgInit',\n hasVideo: 'lgHasVideo',\n containerResize: 'lgContainerResize',\n updateSlides: 'lgUpdateSlides',\n afterAppendSubHtml: 'lgAfterAppendSubHtml',\n beforeOpen: 'lgBeforeOpen',\n afterOpen: 'lgAfterOpen',\n slideItemLoad: 'lgSlideItemLoad',\n beforeSlide: 'lgBeforeSlide',\n afterSlide: 'lgAfterSlide',\n posterClick: 'lgPosterClick',\n dragStart: 'lgDragStart',\n dragMove: 'lgDragMove',\n dragEnd: 'lgDragEnd',\n beforeNextSlide: 'lgBeforeNextSlide',\n beforePrevSlide: 'lgBeforePrevSlide',\n beforeClose: 'lgBeforeClose',\n afterClose: 'lgAfterClose',\n rotateLeft: 'lgRotateLeft',\n rotateRight: 'lgRotateRight',\n flipHorizontal: 'lgFlipHorizontal',\n flipVertical: 'lgFlipVertical',\n autoplay: 'lgAutoplay',\n autoplayStart: 'lgAutoplayStart',\n autoplayStop: 'lgAutoplayStop',\n};\n\n// Follow the below format for the event documentation\n// @method is the method name when event is used with Angular/React components\n\n/**\n * Fired only once when lightGallery is initialized\n * @name lgInit\n * @method onInit\n * @example\n * const lg = document.getElementById('custom-events-demo');\n * // Perform any action on lightGallery initialization.\n * // Init event returns the plugin instance that can be used to call any lightGalley public method\n * let pluginInstance = null;\n * lg.addEventListener('lgInit', (event) => {\n * pluginInstance = event.detail.instance;\n * });\n * lightGallery(lg);\n * @see <a href=\"/docs/methods\">Methods<a>\n */\nexport interface InitDetail {\n /**\n * lightGallery plugin instance\n */\n instance: LightGallery;\n}\n\n/**\n * Fired when the slide content has been inserted into it's slide container.\n * @name lgAfterAppendSlide\n * @method onAfterAppendSlide\n */\nexport interface AfterAppendSlideEventDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired immediately before opening the gallery\n * @name lgBeforeOpen\n * @method onBeforeOpen\n */\nexport interface BeforeOpenDetail {}\n\n/**\n * Fired immediately after opening the gallery\n * @name lgAfterOpen\n * @method onAfterOpen\n */\nexport interface AfterOpenDetail {}\n\n/**\n * Fired once the media inside the slide has been completely loaded .\n * @name lgSlideItemLoad\n * @method onSlideItemLoad\n */\nexport interface SlideItemLoadDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * For the first slide, lightGallery adds some delay for displaying the loaded slide item.\n * This delay is required for the transition effect when the slide item is displayed\n * Respect the delay when you use this event\n */\n delay: number;\n\n // Will be true for the first slide\n isFirstSlide: boolean;\n}\n\n/**\n * Fired immediately before each slide transition.\n * @name lgBeforeSlide\n * @method onBeforeSlide\n * @example\n * const lg = document.getElementById('custom-events-demo');\n * // Perform any action before each slide transition\n * lg.addEventListener('lgBeforeSlide', (event) => {\n * const { index, prevIndex } = event.detail;\n * alert(index, prevIndex);\n * });\n * lightGallery(lg);\n */\nexport interface BeforeSlideDetail {\n /**\n * Index of the previous slide\n */\n prevIndex: number;\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n /**\n * true if slide function called via thumbnail click\n */\n fromThumb: boolean;\n}\n\n/**\n * Fired immediately after each slide transition.\n * @name lgAfterSlide\n * @method onAfterSlide\n */\nexport interface AfterSlideDetail {\n /**\n * Index of the previous slide\n */\n prevIndex: number;\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n /**\n * true if slide function called via thumbnail click\n */\n fromThumb: boolean;\n}\n\n/**\n * Fired when the video poster is clicked.\n * @name lgPosterClick\n * @method onPosterClick\n */\nexport interface PosterClickDetail {}\n\n/**\n * Fired when the drag event to move to different slide starts.\n * @name lgDragStart\n * @method onDragStart\n */\nexport interface DragStartDetail {}\n\n/**\n * Fired periodically during the drag operation.\n * @name lgDragMove\n * @method onDragMove\n */\nexport interface DragMoveDetail {}\n\n/**\n * Fired when the user has finished the drag operation\n * @name lgDragEnd\n * @method onDragEnd\n */\nexport interface DragEndDetail {}\n\n/**\n * Fired immediately before the start of the close process.\n * @name lgBeforeClose\n * @method onBeforeClose\n */\nexport interface BeforeCloseDetail {}\n\n/**\n * Fired immediately once lightGallery is closed.\n * @name lgAfterClose\n * @method onAfterClose\n */\nexport interface AfterCloseDetail {\n /**\n * lightGallery plugin instance\n */\n instance: LightGallery;\n}\n\n/**\n * Fired immediately before each \"next\" slide transition\n * @name lgBeforeNextSlide\n * @method onBeforeNextSlide\n */\nexport interface BeforeNextSlideDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n}\n\n/**\n * Fired immediately before each \"prev\" slide transition\n * @name lgBeforePrevSlide\n * @method onBeforePrevSlide\n */\nexport interface BeforePrevSlideDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n}\n\n/**\n * Fired when the sub-html content (ex : title/ description) has been appended into the slide.\n * @name lgAfterAppendSubHtml\n * @method onAfterAppendSubHtml\n */\nexport interface AfterAppendSubHtmlDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the lightGallery container has been resized.\n * @name lgContainerResize\n * @method onContainerResize\n */\nexport interface ContainerResizeDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when lightGallery detects video slide\n * @name lgHasVideo\n * @method onHasVideo\n */\nexport interface HasVideoDetail {\n /**\n * Index of the slide,\n */\n index: number;\n /**\n * Video source\n */\n src: string;\n /**\n * HTML5 video source if available\n * <p>\n HTML5 video source = source: {\n src: string;\n type: string;\n }[];\n attributes: HTMLVideoElement;\n * </p>\n */\n html5Video: VideoSource;\n /**\n * True if video has poster\n */\n hasPoster: boolean;\n}\n\n/**\n * Fired when the image is rotated in anticlockwise direction\n * @name lgRotateLeft\n * @method onRotateLeft\n */\nexport interface RotateLeftDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is rotated in clockwise direction\n * @name lgRotateRight\n * @method onRotateRight\n */\nexport interface RotateRightDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is flipped horizontally\n * @name lgFlipHorizontal\n * @method onFlipHorizontal\n */\nexport interface FlipHorizontalDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is flipped vertically\n * @name lgFlipVertical\n * @method onFlipVertical\n */\nexport interface FlipVerticalDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n","export interface AutoplayStrings {\n toggleAutoplay: string;\n}\n\nexport interface AutoplaySettings {\n /**\n * Enable autoplay plugin\n */\n autoplay: boolean;\n\n /**\n * Enable slideshow autoplay\n */\n slideShowAutoplay: boolean;\n\n /**\n * The time (in ms) between each auto transition.\n */\n slideShowInterval: number;\n\n /**\n * Show autoplay progressBar\n */\n progressBar: boolean;\n\n /**\n * If false autoplay will be stopped after first user action\n */\n forceSlideShowAutoplay: boolean;\n\n /**\n * Show/hide autoplay controls.\n */\n autoplayControls: boolean;\n\n /**\n * Specify where the autoplay controls should be appended.\n */\n appendAutoplayControlsTo: string;\n\n /**\n * Custom translation strings for aria-labels\n */\n autoplayPluginStrings: AutoplayStrings;\n}\nexport const autoplaySettings: AutoplaySettings = {\n autoplay: true,\n slideShowAutoplay: false,\n slideShowInterval: 5000,\n progressBar: true,\n forceSlideShowAutoplay: false,\n autoplayControls: true,\n appendAutoplayControlsTo: '.lg-toolbar',\n autoplayPluginStrings: {\n toggleAutoplay: 'Toggle Autoplay',\n } as AutoplayStrings,\n};\n","import { lGEvents } from '../../lg-events';\nimport { LightGallery } from '../../lightgallery';\nimport { AutoplaySettings, autoplaySettings } from './lg-autoplay-settings';\n\n/**\n * Creates the autoplay plugin.\n * @param {object} element - lightGallery element\n */\nexport default class Autoplay {\n core: LightGallery;\n settings: AutoplaySettings;\n interval!: any;\n fromAuto!: boolean;\n pausedOnTouchDrag!: boolean;\n pausedOnSlideChange!: boolean;\n\n constructor(instance: LightGallery) {\n this.core = instance;\n\n // extend module default settings with lightGallery core settings\n this.settings = { ...autoplaySettings, ...this.core.settings };\n\n return this;\n }\n\n public init(): void {\n if (!this.settings.autoplay) {\n return;\n }\n\n this.interval = false;\n\n // Identify if slide happened from autoplay\n this.fromAuto = true;\n\n // Identify if autoplay canceled from touch/drag\n this.pausedOnTouchDrag = false;\n\n this.pausedOnSlideChange = false;\n\n // append autoplay controls\n if (this.settings.autoplayControls) {\n this.controls();\n }\n\n // Create progress bar\n if (this.settings.progressBar) {\n this.core.outer.append(\n '<div class=\"lg-progress-bar\"><div class=\"lg-progress\"></div></div>',\n );\n }\n\n // Start autoplay\n if (this.settings.slideShowAutoplay) {\n this.core.LGel.once(`${lGEvents.slideItemLoad}.autoplay`, () => {\n this.startAutoPlay();\n });\n }\n\n // cancel interval on touchstart and dragstart\n this.core.LGel.on(\n `${lGEvents.dragStart}.autoplay touchstart.lg.autoplay`,\n () => {\n if (this.interval) {\n this.stopAutoPlay();\n this.pausedOnTouchDrag = true;\n }\n },\n );\n\n // restore autoplay if autoplay canceled from touchstart / dragstart\n this.core.LGel.on(\n `${lGEvents.dragEnd}.autoplay touchend.lg.autoplay`,\n () => {\n if (!this.interval && this.pausedOnTouchDrag) {\n this.startAutoPlay();\n this.pausedOnTouchDrag = false;\n }\n },\n );\n\n this.core.LGel.on(`${lGEvents.beforeSlide}.autoplay`, () => {\n this.showProgressBar();\n if (!this.fromAuto && this.interval) {\n this.stopAutoPlay();\n this.pausedOnSlideChange = true;\n } else {\n this.pausedOnSlideChange = false;\n }\n this.fromAuto = false;\n });\n\n // restore autoplay if autoplay canceled from touchstart / dragstart\n this.core.LGel.on(`${lGEvents.afterSlide}.autoplay`, () => {\n if (\n this.pausedOnSlideChange &&\n !this.interval &&\n this.settings.forceSlideShowAutoplay\n ) {\n this.startAutoPlay();\n this.pausedOnSlideChange = false;\n }\n });\n\n // set progress\n this.showProgressBar();\n }\n\n private showProgressBar() {\n if (this.settings.progressBar && this.fromAuto) {\n const _$progressBar = this.core.outer.find('.lg-progress-bar');\n const _$progress = this.core.outer.find('.lg-progress');\n if (this.interval) {\n _$progress.removeAttr('style');\n _$progressBar.removeClass('lg-start');\n setTimeout(() => {\n _$progress.css(\n 'transition',\n 'width ' +\n (this.core.settings.speed +\n this.settings.slideShowInterval) +\n 'ms ease 0s',\n );\n _$progressBar.addClass('lg-start');\n }, 20);\n }\n }\n }\n\n // Manage autoplay via play/stop buttons\n private controls() {\n const _html = `<button aria-label=\"${this.settings.autoplayPluginStrings['toggleAutoplay']}\" type=\"button\" class=\"lg-autoplay-button lg-icon\"></button>`;\n\n // Append autoplay controls\n this.core.outer\n .find(this.settings.appendAutoplayControlsTo)\n .append(_html);\n\n this.core.outer\n .find('.lg-autoplay-button')\n .first()\n .on('click.lg.autoplay', () => {\n if (this.core.outer.hasClass('lg-show-autoplay')) {\n this.stopAutoPlay();\n } else {\n if (!this.interval) {\n this.startAutoPlay();\n }\n }\n });\n }\n\n // Autostart gallery\n public startAutoPlay(): void {\n this.core.outer\n .find('.lg-progress')\n .css(\n 'transition',\n 'width ' +\n (this.core.settings.speed +\n this.settings.slideShowInterval) +\n 'ms ease 0s',\n );\n this.core.outer.addClass('lg-show-autoplay');\n this.core.outer.find('.lg-progress-bar').addClass('lg-start');\n this.core.LGel.trigger(lGEvents.autoplayStart, {\n index: this.core.index,\n });\n\n this.interval = setInterval(() => {\n if (this.core.index + 1 < this.core.galleryItems.length) {\n this.core.index++;\n } else {\n this.core.index = 0;\n }\n\n this.core.LGel.trigger(lGEvents.autoplay, {\n index: this.core.index,\n });\n\n this.fromAuto = true;\n this.core.slide(this.core.index, false, false, 'next');\n }, this.core.settings.speed + this.settings.slideShowInterval);\n }\n\n // cancel Autostart\n public stopAutoPlay(): void {\n if (this.interval) {\n this.core.LGel.trigger(lGEvents.autoplayStop, {\n index: this.core.index,\n });\n this.core.outer.find('.lg-progress').removeAttr('style');\n this.core.outer.removeClass('lg-show-autoplay');\n this.core.outer.find('.lg-progress-bar').removeClass('lg-start');\n }\n clearInterval(this.interval);\n this.interval = false;\n }\n\n public closeGallery(): void {\n this.stopAutoPlay();\n }\n public destroy(): void {\n if (this.settings.autoplay) {\n this.core.outer.find('.lg-progress-bar').remove();\n }\n // Remove all event listeners added by autoplay plugin\n this.core.LGel.off('.lg.autoplay');\n this.core.LGel.off('.autoplay');\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAGA;;;;;IAKO,IAAM,QAAQ,GAEjB;QACA,gBAAgB,EAAE,oBAAoB;QACtC,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,YAAY;QACtB,eAAe,EAAE,mBAAmB;QACpC,YAAY,EAAE,gBAAgB;QAC9B,kBAAkB,EAAE,sBAAsB;QAC1C,UAAU,EAAE,cAAc;QAC1B,SAAS,EAAE,aAAa;QACxB,aAAa,EAAE,iBAAiB;QAChC,WAAW,EAAE,eAAe;QAC5B,UAAU,EAAE,cAAc;QAC1B,WAAW,EAAE,eAAe;QAC5B,SAAS,EAAE,aAAa;QACxB,QAAQ,EAAE,YAAY;QACtB,OAAO,EAAE,WAAW;QACpB,eAAe,EAAE,mBAAmB;QACpC,eAAe,EAAE,mBAAmB;QACpC,WAAW,EAAE,eAAe;QAC5B,UAAU,EAAE,cAAc;QAC1B,UAAU,EAAE,cAAc;QAC1B,WAAW,EAAE,eAAe;QAC5B,cAAc,EAAE,kBAAkB;QAClC,YAAY,EAAE,gBAAgB;QAC9B,QAAQ,EAAE,YAAY;QACtB,aAAa,EAAE,iBAAiB;QAChC,YAAY,EAAE,gBAAgB;KACjC;;ICQM,IAAM,gBAAgB,GAAqB;QAC9C,QAAQ,EAAE,IAAI;QACd,iBAAiB,EAAE,KAAK;QACxB,iBAAiB,EAAE,IAAI;QACvB,WAAW,EAAE,IAAI;QACjB,sBAAsB,EAAE,KAAK;QAC7B,gBAAgB,EAAE,IAAI;QACtB,wBAAwB,EAAE,aAAa;QACvC,qBAAqB,EAAE;YACnB,cAAc,EAAE,iBAAiB;SACj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CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,EAAE;oBAC1C,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK;iBACzB,CAAC,CAAC;gBACH,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;gBACzD,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;gBAChD,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;aACpE;YACD,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC7B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;SACzB;QAEM,+BAAY,GAAnB;YACI,IAAI,CAAC,YAAY,EAAE,CAAC;SACvB;QACM,0BAAO,GAAd;YACI,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE;gBACxB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,EAAE,CAAC;aACrD;;YAED,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;YACnC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;SACnC;QACL,eAAC;IAAD,CAAC;;;;"}
@@ -1,3 +1,6 @@
1
+ export interface CommentStrings {
2
+ toggleComments: string;
3
+ }
1
4
  export interface CommentSettings {
2
5
  /**
3
6
  * Enable comment box
@@ -25,8 +28,6 @@ export interface CommentSettings {
25
28
  /**
26
29
  * Custom translation strings for aria-labels
27
30
  */
28
- commentPluginStrings: {
29
- [key: string]: string;
30
- };
31
+ commentPluginStrings: CommentStrings;
31
32
  }
32
33
  export declare const commentSettings: CommentSettings;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * lightgallery | 2.4.0-beta.0 | December 12th 2021
2
+ * lightgallery | 2.5.0-beta.2 | March 6th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -74,7 +74,9 @@ var commentSettings = {
74
74
  language: 'en',
75
75
  },
76
76
  commentsMarkup: '<div id="lg-comment-box" class="lg-comment-box lg-fb-comment-box"><div class="lg-comment-header"><h3 class="lg-comment-title">Leave a comment.</h3><span class="lg-comment-close lg-icon"></span></div><div class="lg-comment-body"></div></div>',
77
- commentPluginStrings: { toggleComments: 'Toggle Comments' },
77
+ commentPluginStrings: {
78
+ toggleComments: 'Toggle Comments',
79
+ },
78
80
  };
79
81
 
80
82
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"lg-comment.es5.js","sources":["../../../src/lg-events.ts","../../../src/plugins/comment/lg-comment-settings.ts","../../../src/plugins/comment/lg-comment.ts"],"sourcesContent":["import { LightGallery } from './lightgallery';\nimport { VideoSource } from './plugins/video/types';\n\n/**\n * List of lightGallery events\n * All events should be documented here\n * Below interfaces are used to build the website documentations\n * */\nexport const lGEvents: {\n [key: string]: string;\n} = {\n afterAppendSlide: 'lgAfterAppendSlide',\n init: 'lgInit',\n hasVideo: 'lgHasVideo',\n containerResize: 'lgContainerResize',\n updateSlides: 'lgUpdateSlides',\n afterAppendSubHtml: 'lgAfterAppendSubHtml',\n beforeOpen: 'lgBeforeOpen',\n afterOpen: 'lgAfterOpen',\n slideItemLoad: 'lgSlideItemLoad',\n beforeSlide: 'lgBeforeSlide',\n afterSlide: 'lgAfterSlide',\n posterClick: 'lgPosterClick',\n dragStart: 'lgDragStart',\n dragMove: 'lgDragMove',\n dragEnd: 'lgDragEnd',\n beforeNextSlide: 'lgBeforeNextSlide',\n beforePrevSlide: 'lgBeforePrevSlide',\n beforeClose: 'lgBeforeClose',\n afterClose: 'lgAfterClose',\n rotateLeft: 'lgRotateLeft',\n rotateRight: 'lgRotateRight',\n flipHorizontal: 'lgFlipHorizontal',\n flipVertical: 'lgFlipVertical',\n autoplay: 'lgAutoplay',\n autoplayStart: 'lgAutoplayStart',\n autoplayStop: 'lgAutoplayStop',\n};\n\n// Follow the below format for the event documentation\n// @method is the method name when event is used with Angular/React components\n\n/**\n * Fired only once when lightGallery is initialized\n * @name lgInit\n * @method onInit\n * @example\n * const lg = document.getElementById('custom-events-demo');\n * // Perform any action on lightGallery initialization.\n * // Init event returns the plugin instance that can be used to call any lightGalley public method\n * let pluginInstance = null;\n * lg.addEventListener('lgInit', (event) => {\n * pluginInstance = event.detail.instance;\n * });\n * lightGallery(lg);\n * @see <a href=\"/docs/methods\">Methods<a>\n */\nexport interface InitDetail {\n /**\n * lightGallery plugin instance\n */\n instance: LightGallery;\n}\n\n/**\n * Fired when the slide content has been inserted into it's slide container.\n * @name lgAfterAppendSlide\n * @method onAfterAppendSlide\n */\nexport interface AfterAppendSlideEventDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired immediately before opening the gallery\n * @name lgBeforeOpen\n * @method onBeforeOpen\n */\nexport interface BeforeOpenDetail {}\n\n/**\n * Fired immediately after opening the gallery\n * @name lgAfterOpen\n * @method onAfterOpen\n */\nexport interface AfterOpenDetail {}\n\n/**\n * Fired once the media inside the slide has been completely loaded .\n * @name lgSlideItemLoad\n * @method onSlideItemLoad\n */\nexport interface SlideItemLoadDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * For the first slide, lightGallery adds some delay for displaying the loaded slide item.\n * This delay is required for the transition effect when the slide item is displayed\n * Respect the delay when you use this event\n */\n delay: number;\n\n // Will be true for the first slide\n isFirstSlide: boolean;\n}\n\n/**\n * Fired immediately before each slide transition.\n * @name lgBeforeSlide\n * @method onBeforeSlide\n * @example\n * const lg = document.getElementById('custom-events-demo');\n * // Perform any action before each slide transition\n * lg.addEventListener('lgBeforeSlide', (event) => {\n * const { index, prevIndex } = event.detail;\n * alert(index, prevIndex);\n * });\n * lightGallery(lg);\n */\nexport interface BeforeSlideDetail {\n /**\n * Index of the previous slide\n */\n prevIndex: number;\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n /**\n * true if slide function called via thumbnail click\n */\n fromThumb: boolean;\n}\n\n/**\n * Fired immediately after each slide transition.\n * @name lgAfterSlide\n * @method onAfterSlide\n */\nexport interface AfterSlideDetail {\n /**\n * Index of the previous slide\n */\n prevIndex: number;\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n /**\n * true if slide function called via thumbnail click\n */\n fromThumb: boolean;\n}\n\n/**\n * Fired when the video poster is clicked.\n * @name lgPosterClick\n * @method onPosterClick\n */\nexport interface PosterClickDetail {}\n\n/**\n * Fired when the drag event to move to different slide starts.\n * @name lgDragStart\n * @method onDragStart\n */\nexport interface DragStartDetail {}\n\n/**\n * Fired periodically during the drag operation.\n * @name lgDragMove\n * @method onDragMove\n */\nexport interface DragMoveDetail {}\n\n/**\n * Fired when the user has finished the drag operation\n * @name lgDragEnd\n * @method onDragEnd\n */\nexport interface DragEndDetail {}\n\n/**\n * Fired immediately before the start of the close process.\n * @name lgBeforeClose\n * @method onBeforeClose\n */\nexport interface BeforeCloseDetail {}\n\n/**\n * Fired immediately once lightGallery is closed.\n * @name lgAfterClose\n * @method onAfterClose\n */\nexport interface AfterCloseDetail {\n /**\n * lightGallery plugin instance\n */\n instance: LightGallery;\n}\n\n/**\n * Fired immediately before each \"next\" slide transition\n * @name lgBeforeNextSlide\n * @method onBeforeNextSlide\n */\nexport interface BeforeNextSlideDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n}\n\n/**\n * Fired immediately before each \"prev\" slide transition\n * @name lgBeforePrevSlide\n * @method onBeforePrevSlide\n */\nexport interface BeforePrevSlideDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n}\n\n/**\n * Fired when the sub-html content (ex : title/ description) has been appended into the slide.\n * @name lgAfterAppendSubHtml\n * @method onAfterAppendSubHtml\n */\nexport interface AfterAppendSubHtmlDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the lightGallery container has been resized.\n * @name lgContainerResize\n * @method onContainerResize\n */\nexport interface ContainerResizeDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when lightGallery detects video slide\n * @name lgHasVideo\n * @method onHasVideo\n */\nexport interface HasVideoDetail {\n /**\n * Index of the slide,\n */\n index: number;\n /**\n * Video source\n */\n src: string;\n /**\n * HTML5 video source if available\n * <p>\n HTML5 video source = source: {\n src: string;\n type: string;\n }[];\n attributes: HTMLVideoElement;\n * </p>\n */\n html5Video: VideoSource;\n /**\n * True if video has poster\n */\n hasPoster: boolean;\n}\n\n/**\n * Fired when the image is rotated in anticlockwise direction\n * @name lgRotateLeft\n * @method onRotateLeft\n */\nexport interface RotateLeftDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is rotated in clockwise direction\n * @name lgRotateRight\n * @method onRotateRight\n */\nexport interface RotateRightDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is flipped horizontally\n * @name lgFlipHorizontal\n * @method onFlipHorizontal\n */\nexport interface FlipHorizontalDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is flipped vertically\n * @name lgFlipVertical\n * @method onFlipVertical\n */\nexport interface FlipVerticalDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n","export interface CommentSettings {\n /**\n * Enable comment box\n */\n commentBox: boolean;\n /**\n * Enable facebook comment box\n */\n fbComments: boolean;\n /**\n * Enable disqus comment box\n */\n disqusComments: boolean;\n\n /**\n * Disqus comment config\n */\n disqusConfig: {\n title?: string;\n language: string;\n };\n\n /**\n * Facebook comments default markup\n */\n commentsMarkup: string;\n\n /**\n * Custom translation strings for aria-labels\n */\n commentPluginStrings: { [key: string]: string };\n}\n\nexport const commentSettings: CommentSettings = {\n commentBox: false,\n fbComments: false,\n disqusComments: false,\n disqusConfig: {\n title: undefined,\n language: 'en',\n },\n commentsMarkup:\n '<div id=\"lg-comment-box\" class=\"lg-comment-box lg-fb-comment-box\"><div class=\"lg-comment-header\"><h3 class=\"lg-comment-title\">Leave a comment.</h3><span class=\"lg-comment-close lg-icon\"></span></div><div class=\"lg-comment-body\"></div></div>',\n commentPluginStrings: { toggleComments: 'Toggle Comments' },\n};\n","/**\n * lightGallery comments module\n * Supports facebook and disqus comments\n *\n * @ref - https://help.disqus.com/customer/portal/articles/472098-javascript-configuration-variables\n * @ref - https://github.com/disqus/DISQUS-API-Recipes/blob/master/snippets/js/disqus-reset/disqus_reset.html\n * @ref - https://css-tricks.com/lazy-loading-disqus-comments/\n * @ref - https://developers.facebook.com/docs/plugins/comments/#comments-plugin\n *\n */\n\nimport { lGEvents } from '../../lg-events';\nimport { LgQuery } from '../../lgQuery';\nimport { LightGallery } from '../../lightgallery';\nimport { commentSettings, CommentSettings } from './lg-comment-settings';\n\ndeclare let FB: any;\ndeclare let DISQUS: any;\n\nexport default class CommentBox {\n core: LightGallery;\n settings: CommentSettings;\n private $LG!: LgQuery;\n constructor(instance: LightGallery, $LG: LgQuery) {\n // get lightGallery core plugin instance\n this.core = instance;\n this.$LG = $LG;\n\n // extend module default settings with lightGallery core settings\n this.settings = { ...commentSettings, ...this.core.settings };\n\n return this;\n }\n\n public init(): void {\n if (!this.settings.commentBox) {\n return;\n }\n this.setMarkup();\n this.toggleCommentBox();\n if (this.settings.fbComments) {\n this.addFbComments();\n } else if (this.settings.disqusComments) {\n this.addDisqusComments();\n }\n }\n\n private setMarkup() {\n this.core.outer.append(\n this.settings.commentsMarkup +\n '<div class=\"lg-comment-overlay\"></div>',\n );\n\n const commentToggleBtn = `<button type=\"button\" aria-label=\"${this.settings.commentPluginStrings['toggleComments']}\" class=\"lg-comment-toggle lg-icon\"></button>`;\n this.core.$toolbar.append(commentToggleBtn);\n }\n\n toggleCommentBox(): void {\n this.core.outer\n .find('.lg-comment-toggle')\n .first()\n .on('click.lg.comment', () => {\n this.core.outer.toggleClass('lg-comment-active');\n });\n\n this.core.outer\n .find('.lg-comment-overlay')\n .first()\n .on('click.lg.comment', () => {\n this.core.outer.removeClass('lg-comment-active');\n });\n this.core.outer\n .find('.lg-comment-close')\n .first()\n .on('click.lg.comment', () => {\n this.core.outer.removeClass('lg-comment-active');\n });\n }\n\n addFbComments() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const _this = this;\n this.core.LGel.on(`${lGEvents.beforeSlide}.comment`, (event) => {\n const html = this.core.galleryItems[event.detail.index].fbHtml;\n this.core.outer.find('.lg-comment-body').html(html as string);\n });\n this.core.LGel.on(`${lGEvents.afterSlide}.comment`, function () {\n try {\n FB.XFBML.parse();\n } catch (err) {\n _this.$LG(window).on('fbAsyncInit', function () {\n FB.XFBML.parse();\n });\n }\n });\n }\n\n addDisqusComments(): void {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const _this = this;\n const $disqusThread = this.$LG('#disqus_thread');\n $disqusThread.remove();\n this.core.outer\n .find('.lg-comment-body')\n .append('<div id=\"disqus_thread\"></div>');\n\n this.core.LGel.on(`${lGEvents.beforeSlide}.comment`, () => {\n $disqusThread.html('');\n });\n\n this.core.LGel.on(`${lGEvents.afterSlide}.comment`, (event) => {\n const { index } = event.detail;\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const _this = this;\n // DISQUS needs sometime to intialize when lightGallery is opened from direct url(hash plugin).\n setTimeout(\n function () {\n try {\n DISQUS.reset({\n reload: true,\n config: function () {\n this.page.identifier =\n _this.core.galleryItems[\n index\n ].disqusIdentifier;\n this.page.url =\n _this.core.galleryItems[index].disqusURL;\n this.page.title =\n _this.settings.disqusConfig.title;\n this.language =\n _this.settings.disqusConfig.language;\n },\n });\n } catch (err) {\n console.error(\n 'Make sure you have included disqus JavaScript code in your document. Ex - https://lg-disqus.disqus.com/admin/install/platforms/universalcode/',\n );\n }\n },\n _this.core.lGalleryOn ? 0 : 1000,\n );\n });\n }\n\n destroy(): void {\n this.core.LGel.off('.lg.comment');\n this.core.LGel.off('.comment');\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;;;;AAKO,IAAM,QAAQ,GAEjB;IACA,gBAAgB,EAAE,oBAAoB;IACtC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,YAAY;IACtB,eAAe,EAAE,mBAAmB;IACpC,YAAY,EAAE,gBAAgB;IAC9B,kBAAkB,EAAE,sBAAsB;IAC1C,UAAU,EAAE,cAAc;IAC1B,SAAS,EAAE,aAAa;IACxB,aAAa,EAAE,iBAAiB;IAChC,WAAW,EAAE,eAAe;IAC5B,UAAU,EAAE,cAAc;IAC1B,WAAW,EAAE,eAAe;IAC5B,SAAS,EAAE,aAAa;IACxB,QAAQ,EAAE,YAAY;IACtB,OAAO,EAAE,WAAW;IACpB,eAAe,EAAE,mBAAmB;IACpC,eAAe,EAAE,mBAAmB;IACpC,WAAW,EAAE,eAAe;IAC5B,UAAU,EAAE,cAAc;IAC1B,UAAU,EAAE,cAAc;IAC1B,WAAW,EAAE,eAAe;IAC5B,cAAc,EAAE,kBAAkB;IAClC,YAAY,EAAE,gBAAgB;IAC9B,QAAQ,EAAE,YAAY;IACtB,aAAa,EAAE,iBAAiB;IAChC,YAAY,EAAE,gBAAgB;CACjC;;ACJM,IAAM,eAAe,GAAoB;IAC5C,UAAU,EAAE,KAAK;IACjB,UAAU,EAAE,KAAK;IACjB,cAAc,EAAE,KAAK;IACrB,YAAY,EAAE;QACV,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,IAAI;KACjB;IACD,cAAc,EACV,kPAAkP;IACtP,oBAAoB,EAAE,EAAE,cAAc,EAAE,iBAAiB,EAAE;CAC9D;;AC5CD;;;;;;;;;;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,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAClC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;KAClC;IACL,iBAAC;AAAD,CAAC;;"}
1
+ {"version":3,"file":"lg-comment.es5.js","sources":["../../../src/lg-events.ts","../../../src/plugins/comment/lg-comment-settings.ts","../../../src/plugins/comment/lg-comment.ts"],"sourcesContent":["import { LightGallery } from './lightgallery';\nimport { VideoSource } from './plugins/video/types';\n\n/**\n * List of lightGallery events\n * All events should be documented here\n * Below interfaces are used to build the website documentations\n * */\nexport const lGEvents: {\n [key: string]: string;\n} = {\n afterAppendSlide: 'lgAfterAppendSlide',\n init: 'lgInit',\n hasVideo: 'lgHasVideo',\n containerResize: 'lgContainerResize',\n updateSlides: 'lgUpdateSlides',\n afterAppendSubHtml: 'lgAfterAppendSubHtml',\n beforeOpen: 'lgBeforeOpen',\n afterOpen: 'lgAfterOpen',\n slideItemLoad: 'lgSlideItemLoad',\n beforeSlide: 'lgBeforeSlide',\n afterSlide: 'lgAfterSlide',\n posterClick: 'lgPosterClick',\n dragStart: 'lgDragStart',\n dragMove: 'lgDragMove',\n dragEnd: 'lgDragEnd',\n beforeNextSlide: 'lgBeforeNextSlide',\n beforePrevSlide: 'lgBeforePrevSlide',\n beforeClose: 'lgBeforeClose',\n afterClose: 'lgAfterClose',\n rotateLeft: 'lgRotateLeft',\n rotateRight: 'lgRotateRight',\n flipHorizontal: 'lgFlipHorizontal',\n flipVertical: 'lgFlipVertical',\n autoplay: 'lgAutoplay',\n autoplayStart: 'lgAutoplayStart',\n autoplayStop: 'lgAutoplayStop',\n};\n\n// Follow the below format for the event documentation\n// @method is the method name when event is used with Angular/React components\n\n/**\n * Fired only once when lightGallery is initialized\n * @name lgInit\n * @method onInit\n * @example\n * const lg = document.getElementById('custom-events-demo');\n * // Perform any action on lightGallery initialization.\n * // Init event returns the plugin instance that can be used to call any lightGalley public method\n * let pluginInstance = null;\n * lg.addEventListener('lgInit', (event) => {\n * pluginInstance = event.detail.instance;\n * });\n * lightGallery(lg);\n * @see <a href=\"/docs/methods\">Methods<a>\n */\nexport interface InitDetail {\n /**\n * lightGallery plugin instance\n */\n instance: LightGallery;\n}\n\n/**\n * Fired when the slide content has been inserted into it's slide container.\n * @name lgAfterAppendSlide\n * @method onAfterAppendSlide\n */\nexport interface AfterAppendSlideEventDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired immediately before opening the gallery\n * @name lgBeforeOpen\n * @method onBeforeOpen\n */\nexport interface BeforeOpenDetail {}\n\n/**\n * Fired immediately after opening the gallery\n * @name lgAfterOpen\n * @method onAfterOpen\n */\nexport interface AfterOpenDetail {}\n\n/**\n * Fired once the media inside the slide has been completely loaded .\n * @name lgSlideItemLoad\n * @method onSlideItemLoad\n */\nexport interface SlideItemLoadDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * For the first slide, lightGallery adds some delay for displaying the loaded slide item.\n * This delay is required for the transition effect when the slide item is displayed\n * Respect the delay when you use this event\n */\n delay: number;\n\n // Will be true for the first slide\n isFirstSlide: boolean;\n}\n\n/**\n * Fired immediately before each slide transition.\n * @name lgBeforeSlide\n * @method onBeforeSlide\n * @example\n * const lg = document.getElementById('custom-events-demo');\n * // Perform any action before each slide transition\n * lg.addEventListener('lgBeforeSlide', (event) => {\n * const { index, prevIndex } = event.detail;\n * alert(index, prevIndex);\n * });\n * lightGallery(lg);\n */\nexport interface BeforeSlideDetail {\n /**\n * Index of the previous slide\n */\n prevIndex: number;\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n /**\n * true if slide function called via thumbnail click\n */\n fromThumb: boolean;\n}\n\n/**\n * Fired immediately after each slide transition.\n * @name lgAfterSlide\n * @method onAfterSlide\n */\nexport interface AfterSlideDetail {\n /**\n * Index of the previous slide\n */\n prevIndex: number;\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n /**\n * true if slide function called via thumbnail click\n */\n fromThumb: boolean;\n}\n\n/**\n * Fired when the video poster is clicked.\n * @name lgPosterClick\n * @method onPosterClick\n */\nexport interface PosterClickDetail {}\n\n/**\n * Fired when the drag event to move to different slide starts.\n * @name lgDragStart\n * @method onDragStart\n */\nexport interface DragStartDetail {}\n\n/**\n * Fired periodically during the drag operation.\n * @name lgDragMove\n * @method onDragMove\n */\nexport interface DragMoveDetail {}\n\n/**\n * Fired when the user has finished the drag operation\n * @name lgDragEnd\n * @method onDragEnd\n */\nexport interface DragEndDetail {}\n\n/**\n * Fired immediately before the start of the close process.\n * @name lgBeforeClose\n * @method onBeforeClose\n */\nexport interface BeforeCloseDetail {}\n\n/**\n * Fired immediately once lightGallery is closed.\n * @name lgAfterClose\n * @method onAfterClose\n */\nexport interface AfterCloseDetail {\n /**\n * lightGallery plugin instance\n */\n instance: LightGallery;\n}\n\n/**\n * Fired immediately before each \"next\" slide transition\n * @name lgBeforeNextSlide\n * @method onBeforeNextSlide\n */\nexport interface BeforeNextSlideDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n}\n\n/**\n * Fired immediately before each \"prev\" slide transition\n * @name lgBeforePrevSlide\n * @method onBeforePrevSlide\n */\nexport interface BeforePrevSlideDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n}\n\n/**\n * Fired when the sub-html content (ex : title/ description) has been appended into the slide.\n * @name lgAfterAppendSubHtml\n * @method onAfterAppendSubHtml\n */\nexport interface AfterAppendSubHtmlDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the lightGallery container has been resized.\n * @name lgContainerResize\n * @method onContainerResize\n */\nexport interface ContainerResizeDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when lightGallery detects video slide\n * @name lgHasVideo\n * @method onHasVideo\n */\nexport interface HasVideoDetail {\n /**\n * Index of the slide,\n */\n index: number;\n /**\n * Video source\n */\n src: string;\n /**\n * HTML5 video source if available\n * <p>\n HTML5 video source = source: {\n src: string;\n type: string;\n }[];\n attributes: HTMLVideoElement;\n * </p>\n */\n html5Video: VideoSource;\n /**\n * True if video has poster\n */\n hasPoster: boolean;\n}\n\n/**\n * Fired when the image is rotated in anticlockwise direction\n * @name lgRotateLeft\n * @method onRotateLeft\n */\nexport interface RotateLeftDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is rotated in clockwise direction\n * @name lgRotateRight\n * @method onRotateRight\n */\nexport interface RotateRightDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is flipped horizontally\n * @name lgFlipHorizontal\n * @method onFlipHorizontal\n */\nexport interface FlipHorizontalDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is flipped vertically\n * @name lgFlipVertical\n * @method onFlipVertical\n */\nexport interface FlipVerticalDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n","export interface CommentStrings {\n toggleComments: string;\n}\n\nexport interface CommentSettings {\n /**\n * Enable comment box\n */\n commentBox: boolean;\n /**\n * Enable facebook comment box\n */\n fbComments: boolean;\n /**\n * Enable disqus comment box\n */\n disqusComments: boolean;\n\n /**\n * Disqus comment config\n */\n disqusConfig: {\n title?: string;\n language: string;\n };\n\n /**\n * Facebook comments default markup\n */\n commentsMarkup: string;\n\n /**\n * Custom translation strings for aria-labels\n */\n commentPluginStrings: CommentStrings;\n}\n\nexport const commentSettings: CommentSettings = {\n commentBox: false,\n fbComments: false,\n disqusComments: false,\n disqusConfig: {\n title: undefined,\n language: 'en',\n },\n commentsMarkup:\n '<div id=\"lg-comment-box\" class=\"lg-comment-box lg-fb-comment-box\"><div class=\"lg-comment-header\"><h3 class=\"lg-comment-title\">Leave a comment.</h3><span class=\"lg-comment-close lg-icon\"></span></div><div class=\"lg-comment-body\"></div></div>',\n commentPluginStrings: {\n toggleComments: 'Toggle Comments',\n } as CommentStrings,\n};\n","/**\n * lightGallery comments module\n * Supports facebook and disqus comments\n *\n * @ref - https://help.disqus.com/customer/portal/articles/472098-javascript-configuration-variables\n * @ref - https://github.com/disqus/DISQUS-API-Recipes/blob/master/snippets/js/disqus-reset/disqus_reset.html\n * @ref - https://css-tricks.com/lazy-loading-disqus-comments/\n * @ref - https://developers.facebook.com/docs/plugins/comments/#comments-plugin\n *\n */\n\nimport { lGEvents } from '../../lg-events';\nimport { LgQuery } from '../../lgQuery';\nimport { LightGallery } from '../../lightgallery';\nimport { commentSettings, CommentSettings } from './lg-comment-settings';\n\ndeclare let FB: any;\ndeclare let DISQUS: any;\n\nexport default class CommentBox {\n core: LightGallery;\n settings: CommentSettings;\n private $LG!: LgQuery;\n constructor(instance: LightGallery, $LG: LgQuery) {\n // get lightGallery core plugin instance\n this.core = instance;\n this.$LG = $LG;\n\n // extend module default settings with lightGallery core settings\n this.settings = { ...commentSettings, ...this.core.settings };\n\n return this;\n }\n\n public init(): void {\n if (!this.settings.commentBox) {\n return;\n }\n this.setMarkup();\n this.toggleCommentBox();\n if (this.settings.fbComments) {\n this.addFbComments();\n } else if (this.settings.disqusComments) {\n this.addDisqusComments();\n }\n }\n\n private setMarkup() {\n this.core.outer.append(\n this.settings.commentsMarkup +\n '<div class=\"lg-comment-overlay\"></div>',\n );\n\n const commentToggleBtn = `<button type=\"button\" aria-label=\"${this.settings.commentPluginStrings['toggleComments']}\" class=\"lg-comment-toggle lg-icon\"></button>`;\n this.core.$toolbar.append(commentToggleBtn);\n }\n\n toggleCommentBox(): void {\n this.core.outer\n .find('.lg-comment-toggle')\n .first()\n .on('click.lg.comment', () => {\n this.core.outer.toggleClass('lg-comment-active');\n });\n\n this.core.outer\n .find('.lg-comment-overlay')\n .first()\n .on('click.lg.comment', () => {\n this.core.outer.removeClass('lg-comment-active');\n });\n this.core.outer\n .find('.lg-comment-close')\n .first()\n .on('click.lg.comment', () => {\n this.core.outer.removeClass('lg-comment-active');\n });\n }\n\n addFbComments() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const _this = this;\n this.core.LGel.on(`${lGEvents.beforeSlide}.comment`, (event) => {\n const html = this.core.galleryItems[event.detail.index].fbHtml;\n this.core.outer.find('.lg-comment-body').html(html as string);\n });\n this.core.LGel.on(`${lGEvents.afterSlide}.comment`, function () {\n try {\n FB.XFBML.parse();\n } catch (err) {\n _this.$LG(window).on('fbAsyncInit', function () {\n FB.XFBML.parse();\n });\n }\n });\n }\n\n addDisqusComments(): void {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const _this = this;\n const $disqusThread = this.$LG('#disqus_thread');\n $disqusThread.remove();\n this.core.outer\n .find('.lg-comment-body')\n .append('<div id=\"disqus_thread\"></div>');\n\n this.core.LGel.on(`${lGEvents.beforeSlide}.comment`, () => {\n $disqusThread.html('');\n });\n\n this.core.LGel.on(`${lGEvents.afterSlide}.comment`, (event) => {\n const { index } = event.detail;\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const _this = this;\n // DISQUS needs sometime to intialize when lightGallery is opened from direct url(hash plugin).\n setTimeout(\n function () {\n try {\n DISQUS.reset({\n reload: true,\n config: function () {\n this.page.identifier =\n _this.core.galleryItems[\n index\n ].disqusIdentifier;\n this.page.url =\n _this.core.galleryItems[index].disqusURL;\n this.page.title =\n _this.settings.disqusConfig.title;\n this.language =\n _this.settings.disqusConfig.language;\n },\n });\n } catch (err) {\n console.error(\n 'Make sure you have included disqus JavaScript code in your document. Ex - https://lg-disqus.disqus.com/admin/install/platforms/universalcode/',\n );\n }\n },\n _this.core.lGalleryOn ? 0 : 1000,\n );\n });\n }\n\n destroy(): void {\n this.core.LGel.off('.lg.comment');\n this.core.LGel.off('.comment');\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;;;;AAKO,IAAM,QAAQ,GAEjB;IACA,gBAAgB,E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c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * lightgallery | 2.4.0-beta.0 | December 12th 2021
2
+ * lightgallery | 2.5.0-beta.2 | March 6th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -80,7 +80,9 @@
80
80
  language: 'en',
81
81
  },
82
82
  commentsMarkup: '<div id="lg-comment-box" class="lg-comment-box lg-fb-comment-box"><div class="lg-comment-header"><h3 class="lg-comment-title">Leave a comment.</h3><span class="lg-comment-close lg-icon"></span></div><div class="lg-comment-body"></div></div>',
83
- commentPluginStrings: { toggleComments: 'Toggle Comments' },
83
+ commentPluginStrings: {
84
+ toggleComments: 'Toggle Comments',
85
+ },
84
86
  };
85
87
 
86
88
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"lg-comment.umd.js","sources":["../../../src/lg-events.ts","../../../src/plugins/comment/lg-comment-settings.ts","../../../src/plugins/comment/lg-comment.ts"],"sourcesContent":["import { LightGallery } from './lightgallery';\nimport { VideoSource } from './plugins/video/types';\n\n/**\n * List of lightGallery events\n * All events should be documented here\n * Below interfaces are used to build the website documentations\n * */\nexport const lGEvents: {\n [key: string]: string;\n} = {\n afterAppendSlide: 'lgAfterAppendSlide',\n init: 'lgInit',\n hasVideo: 'lgHasVideo',\n containerResize: 'lgContainerResize',\n updateSlides: 'lgUpdateSlides',\n afterAppendSubHtml: 'lgAfterAppendSubHtml',\n beforeOpen: 'lgBeforeOpen',\n afterOpen: 'lgAfterOpen',\n slideItemLoad: 'lgSlideItemLoad',\n beforeSlide: 'lgBeforeSlide',\n afterSlide: 'lgAfterSlide',\n posterClick: 'lgPosterClick',\n dragStart: 'lgDragStart',\n dragMove: 'lgDragMove',\n dragEnd: 'lgDragEnd',\n beforeNextSlide: 'lgBeforeNextSlide',\n beforePrevSlide: 'lgBeforePrevSlide',\n beforeClose: 'lgBeforeClose',\n afterClose: 'lgAfterClose',\n rotateLeft: 'lgRotateLeft',\n rotateRight: 'lgRotateRight',\n flipHorizontal: 'lgFlipHorizontal',\n flipVertical: 'lgFlipVertical',\n autoplay: 'lgAutoplay',\n autoplayStart: 'lgAutoplayStart',\n autoplayStop: 'lgAutoplayStop',\n};\n\n// Follow the below format for the event documentation\n// @method is the method name when event is used with Angular/React components\n\n/**\n * Fired only once when lightGallery is initialized\n * @name lgInit\n * @method onInit\n * @example\n * const lg = document.getElementById('custom-events-demo');\n * // Perform any action on lightGallery initialization.\n * // Init event returns the plugin instance that can be used to call any lightGalley public method\n * let pluginInstance = null;\n * lg.addEventListener('lgInit', (event) => {\n * pluginInstance = event.detail.instance;\n * });\n * lightGallery(lg);\n * @see <a href=\"/docs/methods\">Methods<a>\n */\nexport interface InitDetail {\n /**\n * lightGallery plugin instance\n */\n instance: LightGallery;\n}\n\n/**\n * Fired when the slide content has been inserted into it's slide container.\n * @name lgAfterAppendSlide\n * @method onAfterAppendSlide\n */\nexport interface AfterAppendSlideEventDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired immediately before opening the gallery\n * @name lgBeforeOpen\n * @method onBeforeOpen\n */\nexport interface BeforeOpenDetail {}\n\n/**\n * Fired immediately after opening the gallery\n * @name lgAfterOpen\n * @method onAfterOpen\n */\nexport interface AfterOpenDetail {}\n\n/**\n * Fired once the media inside the slide has been completely loaded .\n * @name lgSlideItemLoad\n * @method onSlideItemLoad\n */\nexport interface SlideItemLoadDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * For the first slide, lightGallery adds some delay for displaying the loaded slide item.\n * This delay is required for the transition effect when the slide item is displayed\n * Respect the delay when you use this event\n */\n delay: number;\n\n // Will be true for the first slide\n isFirstSlide: boolean;\n}\n\n/**\n * Fired immediately before each slide transition.\n * @name lgBeforeSlide\n * @method onBeforeSlide\n * @example\n * const lg = document.getElementById('custom-events-demo');\n * // Perform any action before each slide transition\n * lg.addEventListener('lgBeforeSlide', (event) => {\n * const { index, prevIndex } = event.detail;\n * alert(index, prevIndex);\n * });\n * lightGallery(lg);\n */\nexport interface BeforeSlideDetail {\n /**\n * Index of the previous slide\n */\n prevIndex: number;\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n /**\n * true if slide function called via thumbnail click\n */\n fromThumb: boolean;\n}\n\n/**\n * Fired immediately after each slide transition.\n * @name lgAfterSlide\n * @method onAfterSlide\n */\nexport interface AfterSlideDetail {\n /**\n * Index of the previous slide\n */\n prevIndex: number;\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n /**\n * true if slide function called via thumbnail click\n */\n fromThumb: boolean;\n}\n\n/**\n * Fired when the video poster is clicked.\n * @name lgPosterClick\n * @method onPosterClick\n */\nexport interface PosterClickDetail {}\n\n/**\n * Fired when the drag event to move to different slide starts.\n * @name lgDragStart\n * @method onDragStart\n */\nexport interface DragStartDetail {}\n\n/**\n * Fired periodically during the drag operation.\n * @name lgDragMove\n * @method onDragMove\n */\nexport interface DragMoveDetail {}\n\n/**\n * Fired when the user has finished the drag operation\n * @name lgDragEnd\n * @method onDragEnd\n */\nexport interface DragEndDetail {}\n\n/**\n * Fired immediately before the start of the close process.\n * @name lgBeforeClose\n * @method onBeforeClose\n */\nexport interface BeforeCloseDetail {}\n\n/**\n * Fired immediately once lightGallery is closed.\n * @name lgAfterClose\n * @method onAfterClose\n */\nexport interface AfterCloseDetail {\n /**\n * lightGallery plugin instance\n */\n instance: LightGallery;\n}\n\n/**\n * Fired immediately before each \"next\" slide transition\n * @name lgBeforeNextSlide\n * @method onBeforeNextSlide\n */\nexport interface BeforeNextSlideDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n}\n\n/**\n * Fired immediately before each \"prev\" slide transition\n * @name lgBeforePrevSlide\n * @method onBeforePrevSlide\n */\nexport interface BeforePrevSlideDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n}\n\n/**\n * Fired when the sub-html content (ex : title/ description) has been appended into the slide.\n * @name lgAfterAppendSubHtml\n * @method onAfterAppendSubHtml\n */\nexport interface AfterAppendSubHtmlDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the lightGallery container has been resized.\n * @name lgContainerResize\n * @method onContainerResize\n */\nexport interface ContainerResizeDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when lightGallery detects video slide\n * @name lgHasVideo\n * @method onHasVideo\n */\nexport interface HasVideoDetail {\n /**\n * Index of the slide,\n */\n index: number;\n /**\n * Video source\n */\n src: string;\n /**\n * HTML5 video source if available\n * <p>\n HTML5 video source = source: {\n src: string;\n type: string;\n }[];\n attributes: HTMLVideoElement;\n * </p>\n */\n html5Video: VideoSource;\n /**\n * True if video has poster\n */\n hasPoster: boolean;\n}\n\n/**\n * Fired when the image is rotated in anticlockwise direction\n * @name lgRotateLeft\n * @method onRotateLeft\n */\nexport interface RotateLeftDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is rotated in clockwise direction\n * @name lgRotateRight\n * @method onRotateRight\n */\nexport interface RotateRightDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is flipped horizontally\n * @name lgFlipHorizontal\n * @method onFlipHorizontal\n */\nexport interface FlipHorizontalDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is flipped vertically\n * @name lgFlipVertical\n * @method onFlipVertical\n */\nexport interface FlipVerticalDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n","export interface CommentSettings {\n /**\n * Enable comment box\n */\n commentBox: boolean;\n /**\n * Enable facebook comment box\n */\n fbComments: boolean;\n /**\n * Enable disqus comment box\n */\n disqusComments: boolean;\n\n /**\n * Disqus comment config\n */\n disqusConfig: {\n title?: string;\n language: string;\n };\n\n /**\n * Facebook comments default markup\n */\n commentsMarkup: string;\n\n /**\n * Custom translation strings for aria-labels\n */\n commentPluginStrings: { [key: string]: string };\n}\n\nexport const commentSettings: CommentSettings = {\n commentBox: false,\n fbComments: false,\n disqusComments: false,\n disqusConfig: {\n title: undefined,\n language: 'en',\n },\n commentsMarkup:\n '<div id=\"lg-comment-box\" class=\"lg-comment-box lg-fb-comment-box\"><div class=\"lg-comment-header\"><h3 class=\"lg-comment-title\">Leave a comment.</h3><span class=\"lg-comment-close lg-icon\"></span></div><div class=\"lg-comment-body\"></div></div>',\n commentPluginStrings: { toggleComments: 'Toggle Comments' },\n};\n","/**\n * lightGallery comments module\n * Supports facebook and disqus comments\n *\n * @ref - https://help.disqus.com/customer/portal/articles/472098-javascript-configuration-variables\n * @ref - https://github.com/disqus/DISQUS-API-Recipes/blob/master/snippets/js/disqus-reset/disqus_reset.html\n * @ref - https://css-tricks.com/lazy-loading-disqus-comments/\n * @ref - https://developers.facebook.com/docs/plugins/comments/#comments-plugin\n *\n */\n\nimport { lGEvents } from '../../lg-events';\nimport { LgQuery } from '../../lgQuery';\nimport { LightGallery } from '../../lightgallery';\nimport { commentSettings, CommentSettings } from './lg-comment-settings';\n\ndeclare let FB: any;\ndeclare let DISQUS: any;\n\nexport default class CommentBox {\n core: LightGallery;\n settings: CommentSettings;\n private $LG!: LgQuery;\n constructor(instance: LightGallery, $LG: LgQuery) {\n // get lightGallery core plugin instance\n this.core = instance;\n this.$LG = $LG;\n\n // extend module default settings with lightGallery core settings\n this.settings = { ...commentSettings, ...this.core.settings };\n\n return this;\n }\n\n public init(): void {\n if (!this.settings.commentBox) {\n return;\n }\n this.setMarkup();\n this.toggleCommentBox();\n if (this.settings.fbComments) {\n this.addFbComments();\n } else if (this.settings.disqusComments) {\n this.addDisqusComments();\n }\n }\n\n private setMarkup() {\n this.core.outer.append(\n this.settings.commentsMarkup +\n '<div class=\"lg-comment-overlay\"></div>',\n );\n\n const commentToggleBtn = `<button type=\"button\" aria-label=\"${this.settings.commentPluginStrings['toggleComments']}\" class=\"lg-comment-toggle lg-icon\"></button>`;\n this.core.$toolbar.append(commentToggleBtn);\n }\n\n toggleCommentBox(): void {\n this.core.outer\n .find('.lg-comment-toggle')\n .first()\n .on('click.lg.comment', () => {\n this.core.outer.toggleClass('lg-comment-active');\n });\n\n this.core.outer\n .find('.lg-comment-overlay')\n .first()\n .on('click.lg.comment', () => {\n this.core.outer.removeClass('lg-comment-active');\n });\n this.core.outer\n .find('.lg-comment-close')\n .first()\n .on('click.lg.comment', () => {\n this.core.outer.removeClass('lg-comment-active');\n });\n }\n\n addFbComments() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const _this = this;\n this.core.LGel.on(`${lGEvents.beforeSlide}.comment`, (event) => {\n const html = this.core.galleryItems[event.detail.index].fbHtml;\n this.core.outer.find('.lg-comment-body').html(html as string);\n });\n this.core.LGel.on(`${lGEvents.afterSlide}.comment`, function () {\n try {\n FB.XFBML.parse();\n } catch (err) {\n _this.$LG(window).on('fbAsyncInit', function () {\n FB.XFBML.parse();\n });\n }\n });\n }\n\n addDisqusComments(): void {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const _this = this;\n const $disqusThread = this.$LG('#disqus_thread');\n $disqusThread.remove();\n this.core.outer\n .find('.lg-comment-body')\n .append('<div id=\"disqus_thread\"></div>');\n\n this.core.LGel.on(`${lGEvents.beforeSlide}.comment`, () => {\n $disqusThread.html('');\n });\n\n this.core.LGel.on(`${lGEvents.afterSlide}.comment`, (event) => {\n const { index } = event.detail;\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const _this = this;\n // DISQUS needs sometime to intialize when lightGallery is opened from direct url(hash plugin).\n setTimeout(\n function () {\n try {\n DISQUS.reset({\n reload: true,\n config: function () {\n this.page.identifier =\n _this.core.galleryItems[\n index\n ].disqusIdentifier;\n this.page.url =\n _this.core.galleryItems[index].disqusURL;\n this.page.title =\n _this.settings.disqusConfig.title;\n this.language =\n _this.settings.disqusConfig.language;\n },\n });\n } catch (err) {\n console.error(\n 'Make sure you have included disqus JavaScript code in your document. Ex - https://lg-disqus.disqus.com/admin/install/platforms/universalcode/',\n );\n }\n },\n _this.core.lGalleryOn ? 0 : 1000,\n );\n });\n }\n\n destroy(): void {\n this.core.LGel.off('.lg.comment');\n this.core.LGel.off('.comment');\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAGA;;;;;IAKO,IAAM,QAAQ,GAEjB;QACA,gBAAgB,EAAE,oBAAoB;QACtC,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,YAAY;QACtB,eAAe,EAAE,mBAAmB;QACpC,YAAY,EAAE,gBAAgB;QAC9B,kBAAkB,EAAE,sBAAsB;QAC1C,UAAU,EAAE,cAAc;QAC1B,SAAS,EAAE,aAAa;QACxB,aAAa,EAAE,iBAAiB;QAChC,WAAW,EAAE,eAAe;QAC5B,UAAU,EAAE,cAAc;QAC1B,WAAW,EAAE,eAAe;QAC5B,SAAS,EAAE,aAAa;QACxB,QAAQ,EAAE,YAAY;QACtB,OAAO,EAAE,WAAW;QACpB,eAAe,EAAE,mBAAmB;QACpC,eAAe,EAAE,mBAAmB;QACpC,WAAW,EAAE,eAAe;QAC5B,UAAU,EAAE,cAAc;QAC1B,UAAU,EAAE,cAAc;QAC1B,WAAW,EAAE,eAAe;QAC5B,cAAc,EAAE,kBAAkB;QAClC,YAAY,EAAE,gBAAgB;QAC9B,QAAQ,EAAE,YAAY;QACtB,aAAa,EAAE,iBAAiB;QAChC,YAAY,EAAE,gBAAgB;KACjC;;ICJM,IAAM,eAAe,GAAoB;QAC5C,UAAU,EAAE,KAAK;QACjB,UAAU,EAAE,KAAK;QACjB,cAAc,EAAE,KAAK;QACrB,YAAY,EAAE;YACV,KAAK,EAAE,SAAS;YAChB,QAAQ,EAAE,IAAI;SACjB;QACD,cAAc,EACV,kPAAkP;QACtP,oBAAoB,EAAE,EAAE,c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G,IAAI,CACnC,CAAC;aACL,CAAC,CAAC;SACN;QAED,4BAAO,GAAP;YACI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;YAClC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;SAClC;QACL,iBAAC;IAAD,CAAC;;;;"}
1
+ {"version":3,"file":"lg-comment.umd.js","sources":["../../../src/lg-events.ts","../../../src/plugins/comment/lg-comment-settings.ts","../../../src/plugins/comment/lg-comment.ts"],"sourcesContent":["import { LightGallery } from './lightgallery';\nimport { VideoSource } from './plugins/video/types';\n\n/**\n * List of lightGallery events\n * All events should be documented here\n * Below interfaces are used to build the website documentations\n * */\nexport const lGEvents: {\n [key: string]: string;\n} = {\n afterAppendSlide: 'lgAfterAppendSlide',\n init: 'lgInit',\n hasVideo: 'lgHasVideo',\n containerResize: 'lgContainerResize',\n updateSlides: 'lgUpdateSlides',\n afterAppendSubHtml: 'lgAfterAppendSubHtml',\n beforeOpen: 'lgBeforeOpen',\n afterOpen: 'lgAfterOpen',\n slideItemLoad: 'lgSlideItemLoad',\n beforeSlide: 'lgBeforeSlide',\n afterSlide: 'lgAfterSlide',\n posterClick: 'lgPosterClick',\n dragStart: 'lgDragStart',\n dragMove: 'lgDragMove',\n dragEnd: 'lgDragEnd',\n beforeNextSlide: 'lgBeforeNextSlide',\n beforePrevSlide: 'lgBeforePrevSlide',\n beforeClose: 'lgBeforeClose',\n afterClose: 'lgAfterClose',\n rotateLeft: 'lgRotateLeft',\n rotateRight: 'lgRotateRight',\n flipHorizontal: 'lgFlipHorizontal',\n flipVertical: 'lgFlipVertical',\n autoplay: 'lgAutoplay',\n autoplayStart: 'lgAutoplayStart',\n autoplayStop: 'lgAutoplayStop',\n};\n\n// Follow the below format for the event documentation\n// @method is the method name when event is used with Angular/React components\n\n/**\n * Fired only once when lightGallery is initialized\n * @name lgInit\n * @method onInit\n * @example\n * const lg = document.getElementById('custom-events-demo');\n * // Perform any action on lightGallery initialization.\n * // Init event returns the plugin instance that can be used to call any lightGalley public method\n * let pluginInstance = null;\n * lg.addEventListener('lgInit', (event) => {\n * pluginInstance = event.detail.instance;\n * });\n * lightGallery(lg);\n * @see <a href=\"/docs/methods\">Methods<a>\n */\nexport interface InitDetail {\n /**\n * lightGallery plugin instance\n */\n instance: LightGallery;\n}\n\n/**\n * Fired when the slide content has been inserted into it's slide container.\n * @name lgAfterAppendSlide\n * @method onAfterAppendSlide\n */\nexport interface AfterAppendSlideEventDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired immediately before opening the gallery\n * @name lgBeforeOpen\n * @method onBeforeOpen\n */\nexport interface BeforeOpenDetail {}\n\n/**\n * Fired immediately after opening the gallery\n * @name lgAfterOpen\n * @method onAfterOpen\n */\nexport interface AfterOpenDetail {}\n\n/**\n * Fired once the media inside the slide has been completely loaded .\n * @name lgSlideItemLoad\n * @method onSlideItemLoad\n */\nexport interface SlideItemLoadDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * For the first slide, lightGallery adds some delay for displaying the loaded slide item.\n * This delay is required for the transition effect when the slide item is displayed\n * Respect the delay when you use this event\n */\n delay: number;\n\n // Will be true for the first slide\n isFirstSlide: boolean;\n}\n\n/**\n * Fired immediately before each slide transition.\n * @name lgBeforeSlide\n * @method onBeforeSlide\n * @example\n * const lg = document.getElementById('custom-events-demo');\n * // Perform any action before each slide transition\n * lg.addEventListener('lgBeforeSlide', (event) => {\n * const { index, prevIndex } = event.detail;\n * alert(index, prevIndex);\n * });\n * lightGallery(lg);\n */\nexport interface BeforeSlideDetail {\n /**\n * Index of the previous slide\n */\n prevIndex: number;\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n /**\n * true if slide function called via thumbnail click\n */\n fromThumb: boolean;\n}\n\n/**\n * Fired immediately after each slide transition.\n * @name lgAfterSlide\n * @method onAfterSlide\n */\nexport interface AfterSlideDetail {\n /**\n * Index of the previous slide\n */\n prevIndex: number;\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n /**\n * true if slide function called via thumbnail click\n */\n fromThumb: boolean;\n}\n\n/**\n * Fired when the video poster is clicked.\n * @name lgPosterClick\n * @method onPosterClick\n */\nexport interface PosterClickDetail {}\n\n/**\n * Fired when the drag event to move to different slide starts.\n * @name lgDragStart\n * @method onDragStart\n */\nexport interface DragStartDetail {}\n\n/**\n * Fired periodically during the drag operation.\n * @name lgDragMove\n * @method onDragMove\n */\nexport interface DragMoveDetail {}\n\n/**\n * Fired when the user has finished the drag operation\n * @name lgDragEnd\n * @method onDragEnd\n */\nexport interface DragEndDetail {}\n\n/**\n * Fired immediately before the start of the close process.\n * @name lgBeforeClose\n * @method onBeforeClose\n */\nexport interface BeforeCloseDetail {}\n\n/**\n * Fired immediately once lightGallery is closed.\n * @name lgAfterClose\n * @method onAfterClose\n */\nexport interface AfterCloseDetail {\n /**\n * lightGallery plugin instance\n */\n instance: LightGallery;\n}\n\n/**\n * Fired immediately before each \"next\" slide transition\n * @name lgBeforeNextSlide\n * @method onBeforeNextSlide\n */\nexport interface BeforeNextSlideDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n}\n\n/**\n * Fired immediately before each \"prev\" slide transition\n * @name lgBeforePrevSlide\n * @method onBeforePrevSlide\n */\nexport interface BeforePrevSlideDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n}\n\n/**\n * Fired when the sub-html content (ex : title/ description) has been appended into the slide.\n * @name lgAfterAppendSubHtml\n * @method onAfterAppendSubHtml\n */\nexport interface AfterAppendSubHtmlDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the lightGallery container has been resized.\n * @name lgContainerResize\n * @method onContainerResize\n */\nexport interface ContainerResizeDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when lightGallery detects video slide\n * @name lgHasVideo\n * @method onHasVideo\n */\nexport interface HasVideoDetail {\n /**\n * Index of the slide,\n */\n index: number;\n /**\n * Video source\n */\n src: string;\n /**\n * HTML5 video source if available\n * <p>\n HTML5 video source = source: {\n src: string;\n type: string;\n }[];\n attributes: HTMLVideoElement;\n * </p>\n */\n html5Video: VideoSource;\n /**\n * True if video has poster\n */\n hasPoster: boolean;\n}\n\n/**\n * Fired when the image is rotated in anticlockwise direction\n * @name lgRotateLeft\n * @method onRotateLeft\n */\nexport interface RotateLeftDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is rotated in clockwise direction\n * @name lgRotateRight\n * @method onRotateRight\n */\nexport interface RotateRightDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is flipped horizontally\n * @name lgFlipHorizontal\n * @method onFlipHorizontal\n */\nexport interface FlipHorizontalDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is flipped vertically\n * @name lgFlipVertical\n * @method onFlipVertical\n */\nexport interface FlipVerticalDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n","export interface CommentStrings {\n toggleComments: string;\n}\n\nexport interface CommentSettings {\n /**\n * Enable comment box\n */\n commentBox: boolean;\n /**\n * Enable facebook comment box\n */\n fbComments: boolean;\n /**\n * Enable disqus comment box\n */\n disqusComments: boolean;\n\n /**\n * Disqus comment config\n */\n disqusConfig: {\n title?: string;\n language: string;\n };\n\n /**\n * Facebook comments default markup\n */\n commentsMarkup: string;\n\n /**\n * Custom translation strings for aria-labels\n */\n commentPluginStrings: CommentStrings;\n}\n\nexport const commentSettings: CommentSettings = {\n commentBox: false,\n fbComments: false,\n disqusComments: false,\n disqusConfig: {\n title: undefined,\n language: 'en',\n },\n commentsMarkup:\n '<div id=\"lg-comment-box\" class=\"lg-comment-box lg-fb-comment-box\"><div class=\"lg-comment-header\"><h3 class=\"lg-comment-title\">Leave a comment.</h3><span class=\"lg-comment-close lg-icon\"></span></div><div class=\"lg-comment-body\"></div></div>',\n commentPluginStrings: {\n toggleComments: 'Toggle Comments',\n } as CommentStrings,\n};\n","/**\n * lightGallery comments module\n * Supports facebook and disqus comments\n *\n * @ref - https://help.disqus.com/customer/portal/articles/472098-javascript-configuration-variables\n * @ref - https://github.com/disqus/DISQUS-API-Recipes/blob/master/snippets/js/disqus-reset/disqus_reset.html\n * @ref - https://css-tricks.com/lazy-loading-disqus-comments/\n * @ref - https://developers.facebook.com/docs/plugins/comments/#comments-plugin\n *\n */\n\nimport { lGEvents } from '../../lg-events';\nimport { LgQuery } from '../../lgQuery';\nimport { LightGallery } from '../../lightgallery';\nimport { commentSettings, CommentSettings } from './lg-comment-settings';\n\ndeclare let FB: any;\ndeclare let DISQUS: any;\n\nexport default class CommentBox {\n core: LightGallery;\n settings: CommentSettings;\n private $LG!: LgQuery;\n constructor(instance: LightGallery, $LG: LgQuery) {\n // get lightGallery core plugin instance\n this.core = instance;\n this.$LG = $LG;\n\n // extend module default settings with lightGallery core settings\n this.settings = { ...commentSettings, ...this.core.settings };\n\n return this;\n }\n\n public init(): void {\n if (!this.settings.commentBox) {\n return;\n }\n this.setMarkup();\n this.toggleCommentBox();\n if (this.settings.fbComments) {\n this.addFbComments();\n } else if (this.settings.disqusComments) {\n this.addDisqusComments();\n }\n }\n\n private setMarkup() {\n this.core.outer.append(\n this.settings.commentsMarkup +\n '<div class=\"lg-comment-overlay\"></div>',\n );\n\n const commentToggleBtn = `<button type=\"button\" aria-label=\"${this.settings.commentPluginStrings['toggleComments']}\" class=\"lg-comment-toggle lg-icon\"></button>`;\n this.core.$toolbar.append(commentToggleBtn);\n }\n\n toggleCommentBox(): void {\n this.core.outer\n .find('.lg-comment-toggle')\n .first()\n .on('click.lg.comment', () => {\n this.core.outer.toggleClass('lg-comment-active');\n });\n\n this.core.outer\n .find('.lg-comment-overlay')\n .first()\n .on('click.lg.comment', () => {\n this.core.outer.removeClass('lg-comment-active');\n });\n this.core.outer\n .find('.lg-comment-close')\n .first()\n .on('click.lg.comment', () => {\n this.core.outer.removeClass('lg-comment-active');\n });\n }\n\n addFbComments() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const _this = this;\n this.core.LGel.on(`${lGEvents.beforeSlide}.comment`, (event) => {\n const html = this.core.galleryItems[event.detail.index].fbHtml;\n this.core.outer.find('.lg-comment-body').html(html as string);\n });\n this.core.LGel.on(`${lGEvents.afterSlide}.comment`, function () {\n try {\n FB.XFBML.parse();\n } catch (err) {\n _this.$LG(window).on('fbAsyncInit', function () {\n FB.XFBML.parse();\n });\n }\n });\n }\n\n addDisqusComments(): void {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const _this = this;\n const $disqusThread = this.$LG('#disqus_thread');\n $disqusThread.remove();\n this.core.outer\n .find('.lg-comment-body')\n .append('<div id=\"disqus_thread\"></div>');\n\n this.core.LGel.on(`${lGEvents.beforeSlide}.comment`, () => {\n $disqusThread.html('');\n });\n\n this.core.LGel.on(`${lGEvents.afterSlide}.comment`, (event) => {\n const { index } = event.detail;\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const _this = this;\n // DISQUS needs sometime to intialize when lightGallery is opened from direct url(hash plugin).\n setTimeout(\n function () {\n try {\n DISQUS.reset({\n reload: true,\n config: function () {\n this.page.identifier =\n _this.core.galleryItems[\n index\n ].disqusIdentifier;\n this.page.url =\n _this.core.galleryItems[index].disqusURL;\n this.page.title =\n _this.settings.disqusConfig.title;\n this.language =\n _this.settings.disqusConfig.language;\n },\n });\n } catch (err) {\n console.error(\n 'Make sure you have included disqus JavaScript code in your document. Ex - https://lg-disqus.disqus.com/admin/install/platforms/universalcode/',\n );\n }\n },\n _this.core.lGalleryOn ? 0 : 1000,\n );\n });\n }\n\n destroy(): void {\n this.core.LGel.off('.lg.comment');\n this.core.LGel.off('.comment');\n }\n}\n"],"names":[],"mappings":";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 +1,6 @@
1
+ export interface FullscreenStrings {
2
+ toggleFullscreen: string;
3
+ }
1
4
  export interface FullscreenSettings {
2
5
  /**
3
6
  * Enable/Disable fullscreen option
@@ -6,8 +9,6 @@ export interface FullscreenSettings {
6
9
  /**
7
10
  * Custom translation strings for aria-labels
8
11
  */
9
- fullscreenPluginStrings: {
10
- [key: string]: string;
11
- };
12
+ fullscreenPluginStrings: FullscreenStrings;
12
13
  }
13
14
  export declare const fullscreenSettings: FullscreenSettings;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * lightgallery | 2.4.0-beta.0 | December 12th 2021
2
+ * lightgallery | 2.5.0-beta.2 | March 6th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -33,7 +33,9 @@ var __assign = function() {
33
33
 
34
34
  var fullscreenSettings = {
35
35
  fullScreen: true,
36
- fullscreenPluginStrings: { toggleFullscreen: 'Toggle Fullscreen' },
36
+ fullscreenPluginStrings: {
37
+ toggleFullscreen: 'Toggle Fullscreen',
38
+ },
37
39
  };
38
40
 
39
41
  var FullScreen = /** @class */ (function () {
@@ -1 +1 @@
1
- {"version":3,"file":"lg-fullscreen.es5.js","sources":["../../../src/plugins/fullscreen/lg-fullscreen-settings.ts","../../../src/plugins/fullscreen/lg-fullscreen.ts"],"sourcesContent":["export interface FullscreenSettings {\n /**\n * Enable/Disable fullscreen option\n */\n fullScreen: boolean;\n\n /**\n * Custom translation strings for aria-labels\n */\n fullscreenPluginStrings: { [key: string]: string };\n}\n\nexport const fullscreenSettings: FullscreenSettings = {\n fullScreen: true,\n fullscreenPluginStrings: { toggleFullscreen: 'Toggle Fullscreen' },\n};\n","import { LgQuery } from '../../lgQuery';\nimport { LightGallery } from '../../lightgallery';\nimport {\n FullscreenSettings,\n fullscreenSettings,\n} from './lg-fullscreen-settings';\n\ndeclare let document: any;\n\nexport default class FullScreen {\n core: LightGallery;\n settings: FullscreenSettings;\n private $LG!: LgQuery;\n constructor(instance: LightGallery, $LG: LgQuery) {\n // get lightGallery core plugin instance\n this.core = instance;\n this.$LG = $LG;\n\n // extend module default settings with lightGallery core settings\n this.settings = { ...fullscreenSettings, ...this.core.settings };\n\n return this;\n }\n\n public init(): void {\n let fullScreen = '';\n if (this.settings.fullScreen) {\n // check for fullscreen browser support\n if (\n !document.fullscreenEnabled &&\n !document.webkitFullscreenEnabled &&\n !document.mozFullScreenEnabled &&\n !document.msFullscreenEnabled\n ) {\n return;\n } else {\n fullScreen = `<button type=\"button\" aria-label=\"${this.settings.fullscreenPluginStrings['toggleFullscreen']}\" class=\"lg-fullscreen lg-icon\"></button>`;\n this.core.$toolbar.append(fullScreen);\n this.fullScreen();\n }\n }\n }\n\n private isFullScreen(): boolean {\n return (\n document.fullscreenElement ||\n document.mozFullScreenElement ||\n document.webkitFullscreenElement ||\n document.msFullscreenElement\n );\n }\n\n private requestFullscreen(): void {\n const el = document.documentElement;\n if (el.requestFullscreen) {\n el.requestFullscreen();\n } else if (el.msRequestFullscreen) {\n el.msRequestFullscreen();\n } else if (el.mozRequestFullScreen) {\n el.mozRequestFullScreen();\n } else if (el.webkitRequestFullscreen) {\n el.webkitRequestFullscreen();\n }\n }\n\n private exitFullscreen(): void {\n if (document.exitFullscreen) {\n document.exitFullscreen();\n } else if (document.msExitFullscreen) {\n document.msExitFullscreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.webkitExitFullscreen) {\n document.webkitExitFullscreen();\n }\n }\n\n // https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Using_full_screen_mode\n private fullScreen(): void {\n this.$LG(document).on(\n `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 () => {\n if (!this.core.lgOpened) return;\n this.core.outer.toggleClass('lg-fullscreen-on');\n },\n );\n\n this.core.outer\n .find('.lg-fullscreen')\n .first()\n .on('click.lg', () => {\n if (this.isFullScreen()) {\n this.exitFullscreen();\n } else {\n this.requestFullscreen();\n }\n });\n }\n\n closeGallery(): void {\n // exit from fullscreen if activated\n if (this.isFullScreen()) {\n this.exitFullscreen();\n }\n }\n\n destroy(): void {\n this.$LG(document).off(\n `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 );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYO,IAAM,kBAAkB,GAAuB;IAClD,UAAU,EAAE,IAAI;IAChB,uBAAuB,EAAE,EAAE,gBAAgB,EAAE,mBAAmB,EAAE;CACrE;;;ICFG,oBAAY,QAAsB,EAAE,GAAY;;QAE5C,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;QACrB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;;QAGf,IAAI,CAAC,QAAQ,yBAAQ,kBAAkB,GAAK,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAE,CAAC;QAEjE,OAAO,IAAI,CAAC;KACf;IAEM,yBAAI,GAAX;QACI,IAAI,UAAU,GAAG,EAAE,CAAC;QACpB,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE;;YAE1B,IACI,CAAC,QAAQ,CAAC,iBAAiB;gBAC3B,CAAC,QAAQ,CAAC,uBAAuB;gBACjC,CAAC,QAAQ,CAAC,oBAAoB;gBAC9B,CAAC,QAAQ,CAAC,mBAAmB,EAC/B;gBACE,OAAO;aACV;iBAAM;gBACH,UAAU,GAAG,0CAAqC,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC,kBAAkB,CAAC,iDAA2C,CAAC;gBACvJ,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;gBACtC,IAAI,CAAC,UAAU,EAAE,CAAC;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AAC,QAAQ;gBAAE,OAAO;YAChC,KAAI,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;SACnD,CACJ,CAAC;QAEF,IAAI,CAAC,IAAI,CAAC,KAAK;aACV,IAAI,CAAC,gBAAgB,CAAC;aACtB,KAAK,EAAE;aACP,EAAE,CAAC,UAAU,EAAE;YACZ,IAAI,KAAI,CAAC,YAAY,EAAE,EAAE;gBACrB,KAAI,CAAC,cAAc,EAAE,CAAC;aACzB;iBAAM;gBACH,KAAI,CAAC,iBAAiB,EAAE,CAAC;aAC5B;SACJ,CAAC,CAAC;KACV;IAED,iCAAY,GAAZ;;QAEI,IAAI,IAAI,CAAC,YAAY,EAAE,EAAE;YACrB,IAAI,CAAC,cAAc,EAAE,CAAC;SACzB;KACJ;IAED,4BAAO,GAAP;QACI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,GAAG,CAClB,+BAA6B,IAAI,CAAC,IAAI,CAAC,IAAI,uDACT,IAAI,CAAC,IAAI,CAAC,IAAI,oDACjB,IAAI,CAAC,IAAI,CAAC,IAAI,mDACf,IAAI,CAAC,IAAI,CAAC,IAAM,CACjD,CAAC;KACL;IACL,iBAAC;AAAD,CAAC;;"}
1
+ {"version":3,"file":"lg-fullscreen.es5.js","sources":["../../../src/plugins/fullscreen/lg-fullscreen-settings.ts","../../../src/plugins/fullscreen/lg-fullscreen.ts"],"sourcesContent":["export interface FullscreenStrings {\n toggleFullscreen: string;\n}\nexport interface FullscreenSettings {\n /**\n * Enable/Disable fullscreen option\n */\n fullScreen: boolean;\n\n /**\n * Custom translation strings for aria-labels\n */\n fullscreenPluginStrings: FullscreenStrings;\n}\n\nexport const fullscreenSettings: FullscreenSettings = {\n fullScreen: true,\n fullscreenPluginStrings: {\n toggleFullscreen: 'Toggle Fullscreen',\n } as FullscreenStrings,\n};\n","import { LgQuery } from '../../lgQuery';\nimport { LightGallery } from '../../lightgallery';\nimport {\n FullscreenSettings,\n fullscreenSettings,\n} from './lg-fullscreen-settings';\n\ndeclare let document: any;\n\nexport default class FullScreen {\n core: LightGallery;\n settings: FullscreenSettings;\n private $LG!: LgQuery;\n constructor(instance: LightGallery, $LG: LgQuery) {\n // get lightGallery core plugin instance\n this.core = instance;\n this.$LG = $LG;\n\n // extend module default settings with lightGallery core settings\n this.settings = { ...fullscreenSettings, ...this.core.settings };\n\n return this;\n }\n\n public init(): void {\n let fullScreen = '';\n if (this.settings.fullScreen) {\n // check for fullscreen browser support\n if (\n !document.fullscreenEnabled &&\n !document.webkitFullscreenEnabled &&\n !document.mozFullScreenEnabled &&\n !document.msFullscreenEnabled\n ) {\n return;\n } else {\n fullScreen = `<button type=\"button\" aria-label=\"${this.settings.fullscreenPluginStrings['toggleFullscreen']}\" class=\"lg-fullscreen lg-icon\"></button>`;\n this.core.$toolbar.append(fullScreen);\n this.fullScreen();\n }\n }\n }\n\n private isFullScreen(): boolean {\n return (\n document.fullscreenElement ||\n document.mozFullScreenElement ||\n document.webkitFullscreenElement ||\n document.msFullscreenElement\n );\n }\n\n private requestFullscreen(): void {\n const el = document.documentElement;\n if (el.requestFullscreen) {\n el.requestFullscreen();\n } else if (el.msRequestFullscreen) {\n el.msRequestFullscreen();\n } else if (el.mozRequestFullScreen) {\n el.mozRequestFullScreen();\n } else if (el.webkitRequestFullscreen) {\n el.webkitRequestFullscreen();\n }\n }\n\n private exitFullscreen(): void {\n if (document.exitFullscreen) {\n document.exitFullscreen();\n } else if (document.msExitFullscreen) {\n document.msExitFullscreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.webkitExitFullscreen) {\n document.webkitExitFullscreen();\n }\n }\n\n // https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Using_full_screen_mode\n private fullScreen(): void {\n this.$LG(document).on(\n `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 () => {\n if (!this.core.lgOpened) return;\n this.core.outer.toggleClass('lg-fullscreen-on');\n },\n );\n\n this.core.outer\n .find('.lg-fullscreen')\n .first()\n .on('click.lg', () => {\n if (this.isFullScreen()) {\n this.exitFullscreen();\n } else {\n this.requestFullscreen();\n }\n });\n }\n\n closeGallery(): void {\n // exit from fullscreen if activated\n if (this.isFullScreen()) {\n this.exitFullscreen();\n }\n }\n\n destroy(): void {\n this.$LG(document).off(\n `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 );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeO,IAAM,kBAAkB,GAAuB;IAClD,UAAU,EAAE,IAAI;IAChB,uBAAuB,EAAE;QACrB,gBAAgB,EAAE,mBAAmB;KACnB;CACzB;;;ICPG,oBAAY,QAAsB,EAAE,GAAY;;QAE5C,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;QACrB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;;QAGf,IAAI,CAAC,QAAQ,yBAAQ,kBAAkB,GAAK,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAE,CAAC;QAEjE,OAAO,IAAI,CAAC;KACf;IAEM,yBAAI,GAAX;QACI,IAAI,UAAU,GAAG,EAAE,CAAC;QACpB,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE;;YAE1B,IACI,CAAC,QAAQ,CAAC,iBAAiB;gBAC3B,CAAC,QAAQ,CAAC,uBAAuB;gBACjC,CAAC,QAAQ,CAAC,oBAAoB;gBAC9B,CAAC,QAAQ,CAAC,mBAAmB,EAC/B;gBACE,OAAO;aACV;iBAAM;gBACH,UAAU,GAAG,0CAAqC,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC,kBAAkB,CAAC,iDAA2C,CAAC;gBACvJ,I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