j1-template 2024.3.15 → 2024.3.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/data/amplitude.html +139 -68
- data/assets/data/banner.html +1 -1
- data/assets/data/cookieconsent.html +1 -1
- data/assets/data/docsearch.html +1 -1
- data/assets/data/fab.html +1 -1
- data/assets/data/footer.html +1 -1
- data/assets/data/galeries.html +1 -1
- data/assets/data/gallery_customizer.html +1 -1
- data/assets/data/gemini-ui.html +1 -1
- data/assets/data/iframes.html +1 -1
- data/assets/data/masonry.html +1 -1
- data/assets/data/masterslider.html +1 -1
- data/assets/data/menu.html +1 -1
- data/assets/data/mmenu.html +1 -1
- data/assets/data/mmenu_sidebar.html +1 -1
- data/assets/data/mmenu_toc.html +1 -1
- data/assets/data/panel.html +5 -4
- data/assets/data/quicklinks.html +1 -1
- data/assets/data/rtext_resizer.html +1 -1
- data/assets/data/slick.html +1 -1
- data/assets/data/speak2me.html +1 -1
- data/assets/data/swiper.html +313 -0
- data/assets/theme/j1/adapter/js/amplitude.30.js +1177 -0
- data/assets/theme/j1/adapter/js/amplitude.js +241 -191
- data/assets/theme/j1/adapter/js/j1.js +3 -3
- data/assets/theme/j1/adapter/js/masonry.js +2 -2
- data/assets/theme/j1/adapter/js/masterslider.js +2 -1
- data/assets/theme/j1/adapter/js/swiper.js +231 -0
- data/assets/theme/j1/adapter/js/videojs.js +212 -0
- data/assets/theme/j1/core/css/themes/unolight/bootstrap.css +7 -4
- data/assets/theme/j1/core/css/themes/unolight/bootstrap.css.map +1 -1
- data/assets/theme/j1/core/css/themes/unolight/bootstrap.min.css +1 -1
- data/assets/theme/j1/core/css/themes/unolight/bootstrap.min.css.map +1 -1
- data/assets/theme/j1/core/js/template.js +4 -0
- data/assets/theme/j1/core/js/template.min.js +2 -2
- data/assets/theme/j1/core/js/template.min.js.map +1 -1
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/amplitude.css +94 -4
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/amplitude.min.css +1 -1
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/compact.css +3 -2
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/compact.min.css +1 -1
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/large.css +72 -10
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/large.min.css +2 -1
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/artist.svg +78 -0
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/mute.svg +52 -20
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/next.svg +20 -39
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/now-playing.svg +24 -38
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/playlist-hide.svg +85 -0
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/playlist-music.svg +85 -0
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/playlist-show.svg +85 -0
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/playlist.svg +85 -0
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/previous.svg +18 -37
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/skip-backward.svg +33 -30
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/skip-forward.svg +33 -29
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/small/next.svg +55 -14
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/small/previous.svg +56 -14
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/volume.svg +38 -21
- data/assets/theme/j1/modules/amplitudejs/js/amplitude.map +20 -20
- data/assets/theme/j1/modules/amplitudejs/js/tech/ytp.15.js +1594 -0
- data/assets/theme/j1/modules/amplitudejs/js/tech/ytp.js +1617 -89
- data/assets/theme/j1/modules/amplitudejs/js/visualizations/bar.js +1 -1
- data/assets/theme/j1/modules/amplitudejs/js/visualizations/circular-equalizer.js +31 -1
- data/assets/theme/j1/modules/amplitudejs/js/visualizations/frequency-analyzer.js +1 -1
- data/assets/theme/j1/modules/amplitudejs/js/visualizations/michael-bromley.js +1 -1
- data/assets/theme/j1/modules/amplitudejs/js/visualizations/template.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.js +206 -122
- data/assets/theme/j1/modules/photoswipe/.version_5.4.4 +6 -0
- data/assets/theme/j1/modules/photoswipe/LICENSE +21 -0
- data/assets/theme/j1/modules/photoswipe/README.md +32 -0
- data/assets/theme/j1/modules/photoswipe/css/org/photoswipe-dynamic-caption-plugin.umd.min.js +5 -0
- data/assets/theme/j1/modules/photoswipe/css/org/photoswipe.css +420 -0
- data/assets/theme/j1/modules/photoswipe/css/photoswipe-caption-plugin.css +67 -0
- data/assets/theme/j1/modules/photoswipe/css/photoswipe-caption-plugin.min.css +16 -0
- data/assets/theme/j1/modules/photoswipe/css/photoswipe.css +376 -0
- data/assets/theme/j1/modules/photoswipe/css/photoswipe.min.css +17 -0
- data/assets/theme/j1/modules/photoswipe/css/scss/photoswipe.scss +427 -0
- data/assets/theme/j1/modules/photoswipe/example/photoswipe-caption-plugin.html +237 -0
- data/assets/theme/j1/modules/photoswipe/example/test-gallery.html +36 -0
- data/assets/theme/j1/modules/photoswipe/js/README.md +43 -0
- data/assets/theme/j1/modules/photoswipe/js/photoswipe-caption-plugin.min.js +5 -0
- data/assets/theme/j1/modules/photoswipe/js/photoswipe-core.min.js +18 -0
- data/assets/theme/j1/modules/photoswipe/js/photoswipe-lightbox.min.js +18 -0
- data/assets/theme/j1/modules/swiper/.version_1.2.0 +15 -0
- data/assets/theme/j1/modules/swiper/LICENSE +20 -0
- data/assets/theme/j1/modules/swiper/README.md +95 -0
- data/assets/theme/j1/modules/swiper/css/swiper-bundle.css +740 -0
- data/assets/theme/j1/modules/swiper/css/swiper-bundle.min..css +17 -0
- data/assets/theme/j1/modules/swiper/css/theme/uno.css +249 -0
- data/assets/theme/j1/modules/swiper/css/theme/uno.min.css +154 -0
- data/assets/theme/j1/modules/swiper/js/swiper-bundle.js +9785 -0
- data/assets/theme/j1/modules/swiper/js/swiper-bundle.min.js +17 -0
- data/assets/theme/j1/modules/swiper/swiperjs.com-demos.url +2 -0
- data/assets/theme/j1/modules/videojs/assets/icons/custom-icons/next.svg +82 -0
- data/assets/theme/j1/modules/videojs/css/font/README.md +151 -0
- data/assets/theme/j1/modules/videojs/css/font/VideoJS.svg +150 -0
- data/assets/theme/j1/modules/videojs/css/font/video-js-cdn.css +2012 -0
- data/assets/theme/j1/modules/videojs/css/plugins/controls/skipbuttons.0.css +32 -0
- data/assets/theme/j1/modules/videojs/css/plugins/controls/skipbuttons.1.css +31 -0
- data/assets/theme/j1/modules/videojs/css/plugins/controls/skipbuttons.css +31 -0
- data/assets/theme/j1/modules/videojs/css/plugins/controls/skipbuttons.min.css +21 -0
- data/assets/theme/j1/modules/videojs/css/themes/uno.css +14 -3
- data/assets/theme/j1/modules/videojs/css/themes/uno.min.css +1 -1
- data/assets/theme/j1/modules/videojs/css/videojs.css +1 -0
- data/assets/theme/j1/modules/videojs/js/plugins/controls/autocaption/LICENSE +13 -0
- data/assets/theme/j1/modules/videojs/js/plugins/controls/autocaption/README.md +75 -0
- data/assets/theme/j1/modules/videojs/js/plugins/controls/autocaption/autocaption.js +149 -0
- data/assets/theme/j1/modules/videojs/js/plugins/controls/autocaption/autocaption.min.js +21 -0
- data/assets/theme/j1/modules/videojs/js/plugins/controls/hotkeys/README.md +76 -30
- data/assets/theme/j1/modules/videojs/js/plugins/controls/hotkeys/hotkeys.js +64 -53
- data/assets/theme/j1/modules/videojs/js/plugins/controls/hotkeys/hotkeys.min.js +1 -1
- data/assets/theme/j1/modules/videojs/js/plugins/controls/skipbuttons/README.md +133 -0
- data/assets/theme/j1/modules/videojs/js/plugins/controls/skipbuttons/skipbuttons.js +137 -0
- data/assets/theme/j1/modules/videojs/js/plugins/controls/skipbuttons/skipbuttons.min.js +21 -0
- data/assets/theme/j1/modules/videojs/js/plugins/controls/zoom/zoom.js +15 -12
- data/assets/theme/j1/modules/videojs/js/plugins/players/yt/youtube.js +43 -16
- data/lib/j1/patches/rubygems/eventmachine-1.2.7-x64-mingw32/lib/3.3/fastfilereaderext.so +0 -0
- data/lib/j1/patches/rubygems/eventmachine-1.2.7-x64-mingw32/lib/3.3/rubyeventmachine.so +0 -0
- data/lib/j1/patches/rubygems/eventmachine-1.2.7-x64-mingw32/lib/3.4/fastfilereaderext.so +0 -0
- data/lib/j1/patches/rubygems/eventmachine-1.2.7-x64-mingw32/lib/3.4/rubyeventmachine.so +0 -0
- data/lib/j1/version.rb +1 -1
- data/lib/j1_app/j1_auth_manager/config.rb +0 -4
- data/lib/starter_web/Gemfile +45 -22
- data/lib/starter_web/README.md +5 -5
- data/lib/starter_web/_config.yml +4 -6
- data/lib/starter_web/_data/modules/amplitude.yml +308 -363
- data/lib/starter_web/_data/modules/defaults/amplitude.yml +60 -35
- data/lib/starter_web/_data/modules/defaults/gallery.yml +42 -0
- data/lib/starter_web/_data/modules/defaults/slick.yml +1 -1
- data/lib/starter_web/_data/modules/defaults/swiper.yml +515 -0
- data/lib/starter_web/_data/modules/defaults/videojs.yml +107 -0
- data/lib/starter_web/_data/modules/gallery.yml +30 -14
- data/lib/starter_web/_data/modules/masonry.yml +15 -0
- data/lib/starter_web/_data/modules/swiper.yml +227 -0
- data/lib/starter_web/_data/modules/videojs.yml +57 -0
- data/lib/starter_web/_data/resources.yml +50 -16
- data/lib/starter_web/_data/templates/feed.xml +1 -1
- data/lib/starter_web/_includes/tables/jekyll_variables.asciidoc +1 -0
- data/lib/starter_web/_plugins/asciidoctor/amplitude-block.rb +1 -0
- data/lib/starter_web/_plugins/asciidoctor/dailymotion-block.rb +4 -1
- data/lib/starter_web/_plugins/asciidoctor/videojs-block.rb +141 -24
- data/lib/starter_web/_plugins/asciidoctor/vimeo-block.rb +4 -1
- data/lib/starter_web/_plugins/asciidoctor/wistia-block.rb +313 -0
- data/lib/starter_web/_plugins/asciidoctor/youtube-block.rb +192 -17
- data/lib/starter_web/_plugins/index/lunr.rb +1 -1
- data/lib/starter_web/assets/video/poster/youtube/faelle_des_bnd/der_unverzichtbare_feind.jpg +0 -0
- data/lib/starter_web/assets/video/poster/youtube/faelle_des_bnd/ein_diener_vieler_herren.jpg +0 -0
- data/lib/starter_web/assets/video/poster/youtube/the_piano/the-piano.jpg +0 -0
- data/lib/starter_web/package.json +1 -1
- data/lib/starter_web/pages/public/_includes/attributes.asciidoc +45 -0
- data/lib/starter_web/pages/public/_includes/documents/photoswipe/200_photoswipe_parameters.asciidoc +510 -0
- data/lib/starter_web/pages/public/_includes/documents/photoswipe/210_photoswipe_lightbox_parameters.asciidoc +98 -0
- data/lib/starter_web/pages/public/_includes/documents/photoswipe/300_caption_plugin_for_photoSwipe.asciidoc +327 -0
- data/lib/starter_web/pages/public/_includes/documents/swiper/100_swiper_features.asciidoc +50 -0
- data/lib/starter_web/pages/public/_includes/documents/swiper/100_swiper_html_layout.asciidoc +122 -0
- data/lib/starter_web/pages/public/_includes/documents/swiper/100_swiper_initialization.asciidoc +53 -0
- data/lib/starter_web/pages/public/_includes/documents/swiper/110_swiper_common_options.asciidoc +43 -0
- data/lib/starter_web/pages/public/_includes/documents/swiper/200_swiper_parameters_a_k.asciidoc +994 -0
- data/lib/starter_web/pages/public/_includes/documents/swiper/200_swiper_parameters_l_o.asciidoc +473 -0
- data/lib/starter_web/pages/public/_includes/documents/swiper/200_swiper_parameters_p_s.asciidoc +700 -0
- data/lib/starter_web/pages/public/_includes/documents/swiper/200_swiper_parameters_t_z.asciidoc +413 -0
- data/lib/starter_web/pages/public/_includes/documents/swiper/300_swiper_instance_properties.asciidoc +873 -0
- data/lib/starter_web/pages/public/_includes/documents/swiper/400_swiper_modules.asciidoc +2514 -0
- data/lib/starter_web/pages/public/_includes/documents/swiper/500_swiper_methods.asciidoc +989 -0
- data/lib/starter_web/pages/public/_includes/documents/swiper/600_swiper_events.asciidoc +1534 -0
- data/lib/starter_web/pages/public/amplitude_yt_tester.adoc +89 -62
- data/lib/starter_web/pages/public/manuals/integrations/amplitudejs/amplitudejs-api.adoc +1 -1
- data/lib/starter_web/pages/public/manuals/integrations/videojs/youtube-api.adoc +1638 -0
- data/lib/starter_web/pages/public/photoswipe_api.adoc +150 -0
- data/lib/starter_web/pages/public/swiper_api.adoc +128 -0
- data/lib/starter_web/pages/public/swiper_tester.adoc +973 -0
- data/lib/starter_web/pages/public/tools/previewer/preview_bootstrap_theme.adoc +5 -6
- data/lib/starter_web/pages/public/tools/previewer/preview_videojs.adoc +203 -0
- data/lib/starter_web/pages/{tour → public/tour}/modal_extentions.adoc +12 -5
- data/lib/starter_web/pages/{tour → public/tour}/play_audio.adoc +63 -15
- data/lib/starter_web/pages/{tour → public/tour}/play_video.adoc +79 -40
- data/lib/starter_web/pages/{tour → public/tour}/present_images.adoc +5 -5
- metadata +114 -41
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/_pause.svg +0 -19
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/_play.svg +0 -18
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/show-playlist.svg +0 -15
- data/assets/theme/j1/modules/jqueryScrollbar/LICENSE +0 -20
- data/assets/theme/j1/modules/jqueryScrollbar/README.md +0 -28
- data/assets/theme/j1/modules/jqueryScrollbar/css/scrollbar.css +0 -939
- data/assets/theme/j1/modules/jqueryScrollbar/css/scrollbar.min.css +0 -20
- data/assets/theme/j1/modules/jqueryScrollbar/js/scrollbar.js +0 -851
- data/assets/theme/j1/modules/jqueryScrollbar/js/scrollbar.min.js +0 -36
- data/assets/theme/j1/modules/jqueryScrollbar/sass/scrollbar.scss +0 -806
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.0.js +0 -794
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/attributes.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/100_gistblock.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/410_bottom_info.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/410_bottom_left_warning.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/410_bottom_right_danger.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/410_central_success.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/410_full_height_left_info.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/410_full_height_right_success.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/410_table_bs_modal_examples.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/410_top_info.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/410_top_left_info.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/410_top_right_success.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/419_advanced_modals_demo.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/tables/bs_modal_examples.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/themes_bootstrap.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/themes_rouge.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/asciidoc_extensions.adoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/bootstrap_themes.adoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/highlghter_rouge.adoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/icon_fonts.adoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/quicksearch.adoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/responsive_tables.adoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/typography.adoc +0 -0
@@ -21,7 +21,7 @@
|
|
21
21
|
* Simple visualization that shows the waveforms as a bar graph
|
22
22
|
*/
|
23
23
|
|
24
|
-
function BarVisualization(){
|
24
|
+
function BarVisualization() {
|
25
25
|
/*
|
26
26
|
Define the ID, name, and initialize the container. These are a part
|
27
27
|
of the visualization template and are necessary.
|
@@ -17,4 +17,34 @@
|
|
17
17
|
# -----------------------------------------------------------------------------
|
18
18
|
*/
|
19
19
|
|
20
|
-
function CircularEqualizer()
|
20
|
+
function CircularEqualizer() {
|
21
|
+
this.id = "circular_equalizer", this.name = "Circular Equalizer", this.container = "", this.preferences = {
|
22
|
+
barWidth: 2,
|
23
|
+
barHeight: 2,
|
24
|
+
barSpacing: 5,
|
25
|
+
barColor: "#ffffff",
|
26
|
+
shadowColor: "#ffffff",
|
27
|
+
shadowBlur: 10
|
28
|
+
}, this.analyser = "", this.frequencyData = [], this.canvas = null, this.canvasCtx = null, this.gradient = null, this.getID = function () {
|
29
|
+
return this.id
|
30
|
+
}, this.getName = function () {
|
31
|
+
return this.name
|
32
|
+
}, this.setPreferences = function (t) {
|
33
|
+
for (var e in this.preferences) null != t[e] && (this.preferences[e] = t[e])
|
34
|
+
}, this.startVisualization = function (t) {
|
35
|
+
this.analyser = Amplitude.getAnalyser(), this.container = t, window.cont = this.container, this.canvas = document.createElement("canvas"), this.canvas.width = this.container.offsetWidth, this.canvas.height = this.container.offsetHeight, this.container.appendChild(this.canvas), this.canvasCtx = this.canvas.getContext("2d"), this.frequencyData = new Uint8Array(this.analyser.frequencyBinCount), this.gradient = this.canvasCtx.createLinearGradient(0, 0, 0, 400), this.gradient.addColorStop(0, this.preferences.barColor), this.gradient.addColorStop(1, "orange"), this.canvasCtx.fillStyle = this.gradient, this.canvasCtx.shadowBlur = this.preferences.shadowBlur, this.canvasCtx.shadowColor = this.preferences.shadowColor, requestAnimationFrame(this.renderFrame.bind(this))
|
36
|
+
}, this.stopVisualization = function () {
|
37
|
+
this.container.innerHTML = "", window.cancelAnimationFrame(this.renderFrame.bind(this))
|
38
|
+
}, this.renderFrame = function () {
|
39
|
+
requestAnimationFrame(this.renderFrame.bind(this)), this.analyser.getByteFrequencyData(this.frequencyData), this.canvasCtx.clearRect(0, 0, this.canvas.width, this.canvas.height);
|
40
|
+
for (var t = this.canvas.width / 2, e = this.canvas.height / 2, a = t - 27, i = Math.floor(2 * a * Math.PI / (this.preferences.barWidth + this.preferences.barSpacing)), s = i - Math.floor(25 * i / 100), n = Math.floor(this.frequencyData.length / i), r = 0; r < s; r++) {
|
41
|
+
var h = this.frequencyData[r * n],
|
42
|
+
c = 2 * r * Math.PI / i + Math.PI,
|
43
|
+
o = (135 - this.preferences.barWidth) * Math.PI / 180,
|
44
|
+
f = a - (h / 12 - this.preferences.barHeight),
|
45
|
+
l = this.preferences.barWidth,
|
46
|
+
d = h / 6 + this.preferences.barHeight;
|
47
|
+
this.canvasCtx.save(), this.canvasCtx.translate(t, e), this.canvasCtx.rotate(c - o), this.canvasCtx.fillRect(0, f, l, d), this.canvasCtx.restore()
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
@@ -17,7 +17,7 @@
|
|
17
17
|
# -----------------------------------------------------------------------------
|
18
18
|
*/
|
19
19
|
|
20
|
-
function FrequencyAnalyzerVisualization(){
|
20
|
+
function FrequencyAnalyzerVisualization() {
|
21
21
|
/*
|
22
22
|
Define the ID of your visualization. This is used to apply
|
23
23
|
visualizations to songs, playlists, and default. It is a JSON
|
@@ -613,34 +613,43 @@
|
|
613
613
|
};
|
614
614
|
|
615
615
|
Video.prototype.controlVideo = function (index, action) {
|
616
|
+
const vjsOptions = j1.modules.videojs.options;
|
616
617
|
var trackSrc,
|
617
618
|
$videoElement, videoInfo, videoStart, videoData, videoId,
|
618
|
-
videojsPlayer,
|
619
|
-
|
620
|
-
|
621
|
-
var
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
619
|
+
videojsPlayer, playbackRates,
|
620
|
+
hotKeysPlugin, skipButtonsPlugin, zoomPlugin;
|
621
|
+
|
622
|
+
var playbackRatesDefaults = vjsOptions.playbackRates.values;
|
623
|
+
var chapterTracksEnabled = false;
|
624
|
+
|
625
|
+
var hotKeysPluginDefaults = {
|
626
|
+
volumeStep: vjsOptions.plugins.hotKeys.volumeStep,
|
627
|
+
seekStep: vjsOptions.plugins.hotKeys.seekStep,
|
628
|
+
enableMute: vjsOptions.plugins.hotKeys.enableMute,
|
629
|
+
enableVolumeScroll: vjsOptions.plugins.hotKeys.enableVolumeScroll,
|
630
|
+
enableHoverScroll: vjsOptions.plugins.hotKeys.enableHoverScroll,
|
631
|
+
enableFullscreen: vjsOptions.plugins.hotKeys.enableFullscreen,
|
632
|
+
enableNumbers: vjsOptions.plugins.hotKeys.enableNumbers,
|
633
|
+
enableJogStyle: vjsOptions.plugins.hotKeys.enableJogStyle,
|
634
|
+
alwaysCaptureHotkeys: vjsOptions.plugins.hotKeys.alwaysCaptureHotkeys,
|
635
|
+
captureDocumentHotkeys: vjsOptions.plugins.hotKeys.captureDocumentHotkeys,
|
636
|
+
enableModifiersForNumbers: vjsOptions.plugins.hotKeys.enableModifiersForNumbers,
|
637
|
+
enableInactiveFocus: vjsOptions.plugins.hotKeys.enableInactiveFocus,
|
638
|
+
skipInitialFocus: vjsOptions.plugins.hotKeys.skipInitialFocus
|
637
639
|
};
|
638
640
|
|
639
|
-
var
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
641
|
+
var skipButtonsPluginDefaults = {
|
642
|
+
backward: vjsOptions.plugins.skipButtons.backward,
|
643
|
+
forward: vjsOptions.plugins.skipButtons.forward,
|
644
|
+
backwardIndex: 0,
|
645
|
+
forwardIndex: 1
|
646
|
+
};
|
647
|
+
|
648
|
+
var zoomPluginDefaults = {
|
649
|
+
moveX: vjsOptions.plugins.zoomButtons.moveX,
|
650
|
+
moveY: vjsOptions.plugins.zoomButtons.moveY,
|
651
|
+
rotate: vjsOptions.plugins.zoomButtons.rotate,
|
652
|
+
zoom: vjsOptions.plugins.zoomButtons.zoom
|
644
653
|
};
|
645
654
|
|
646
655
|
videoInfo = this.core.galleryItems[index].__slideVideoInfo || {};
|
@@ -652,116 +661,190 @@
|
|
652
661
|
// chapter tracks only available for VJS
|
653
662
|
//
|
654
663
|
if (this.core.galleryItems[this.core.index].video !== undefined && videoInfo.html5) {
|
655
|
-
|
656
|
-
if (videoData.tracks !== undefined && videoData.tracks.length > 0) {
|
657
|
-
for (var i=0; i<videoData.tracks.length; i++) {
|
658
|
-
if (videoData.tracks[i].kind == 'chapters') {
|
659
|
-
trackSrc = videoData.tracks[i].src;
|
660
|
-
chapterTracksEnabled = true;
|
661
|
-
}
|
662
|
-
}
|
663
|
-
} // END if videoData.tracks
|
664
|
+
videoData = JSON.parse(this.core.galleryItems[this.core.index].video);
|
664
665
|
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
666
|
+
if (videoData.tracks !== undefined && videoData.tracks.length > 0) {
|
667
|
+
for (var i=0; i<videoData.tracks.length; i++) {
|
668
|
+
if (videoData.tracks[i].kind == 'chapters') {
|
669
|
+
trackSrc = videoData.tracks[i].src;
|
670
|
+
chapterTracksEnabled = true;
|
671
|
+
}
|
672
|
+
}
|
673
|
+
} // END if videoData.tracks
|
671
674
|
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
// add zoomPlugin (only available for VJS)
|
703
|
-
if (zoomPlugin !== undefined && zoomPlugin.enabled) {
|
704
|
-
zoomPlugin.options = __assign(__assign({}, zoomPluginDefaults), zoomPlugin.options);
|
705
|
-
videojsPlayer.zoomPlugin({
|
706
|
-
moveX: zoomPlugin.options.moveX,
|
707
|
-
moveY: zoomPlugin.options.moveY,
|
708
|
-
rotate: zoomPlugin.options.rotate,
|
709
|
-
zoom: zoomPlugin.options.zoom
|
710
|
-
});
|
711
|
-
} // END if zoomPlugin enabled
|
712
|
-
|
713
|
-
// jadams, 2023-12-11: added chapter track processing (only available for VJS)
|
714
|
-
// -----------------------------------------------------------------
|
715
|
-
if (chapterTracksEnabled) {
|
716
|
-
var parser = new WebVTTParser();
|
717
|
-
var markers = [];
|
718
|
-
|
719
|
-
function cb_load (data /* ,textStatus, jqXHR */ ) {
|
720
|
-
var tree = parser.parse(data, 'metadata');
|
721
|
-
var marker;
|
722
|
-
|
723
|
-
// add chapter tracks to markers array
|
724
|
-
for (var i=0; i<tree.cues.length; i++) {
|
725
|
-
marker = { time: tree.cues[i].startTime, label: tree.cues[i].text };
|
726
|
-
markers.push(marker);
|
675
|
+
if ($videoElement.selector !== undefined) {
|
676
|
+
videoId = $videoElement.selector.id;
|
677
|
+
videojsPlayer = videojs(videoId);
|
678
|
+
} else {
|
679
|
+
videojsPlayer = 'unknown';
|
680
|
+
}
|
681
|
+
|
682
|
+
if (videojsPlayer !== 'unknown') {
|
683
|
+
|
684
|
+
// added VJS Plugins hotKeys|skipButtons|zoom, playbackRates
|
685
|
+
// -------------------------------------------------------------
|
686
|
+
hotKeysPlugin = this.settings.videojsOptions.controlBar.hotKeysPlugin;
|
687
|
+
skipButtonsPlugin = this.settings.videojsOptions.controlBar.skipButtonsPlugin;
|
688
|
+
zoomPlugin = this.settings.videojsOptions.controlBar.zoomPlugin;
|
689
|
+
playbackRates = (this.settings.videojsOptions.controlBar.playbackRates !== undefined) ? this.settings.videojsOptions.controlBar.playbackRates : playbackRatesDefaults;
|
690
|
+
|
691
|
+
// jadams, 2024-01-22: added video start position
|
692
|
+
// -------------------------------------------------------------
|
693
|
+
if (this.settings.videojsOptions.videoStart !== undefined) {
|
694
|
+
videoStart = this.settings.videojsOptions.videoStart[index];
|
695
|
+
videojsPlayer.on("play", function() {
|
696
|
+
var startFromSecond = new Date('1970-01-01T' + videoStart + 'Z').getTime() / 1000;
|
697
|
+
videojsPlayer.currentTime(startFromSecond);
|
698
|
+
}); // END on event play
|
699
|
+
} // END if videoStart
|
700
|
+
|
701
|
+
// add playbackRates (only available for VJS)
|
702
|
+
if (videojsPlayer.playbackRates !== undefined) {
|
703
|
+
videojsPlayer.playbackRates(playbackRates);
|
727
704
|
}
|
728
|
-
}; // END callback
|
729
705
|
|
730
|
-
|
731
|
-
|
706
|
+
// add hotkeys Plugin (only available for VJS)
|
707
|
+
if (hotKeysPlugin !== undefined && hotKeysPlugin.enabled && videojsPlayer.hotKeys !== undefined) {
|
708
|
+
|
709
|
+
// merge objects
|
710
|
+
hotKeysPlugin.options = __assign(__assign({}, hotKeysPluginDefaults), hotKeysPlugin.options);
|
711
|
+
|
712
|
+
// prevent multiple plugin instances
|
713
|
+
var hotKeysActive = false;
|
714
|
+
if (videojsPlayer.activePlugins_ !== undefined && videojsPlayer.activePlugins_.hotKeys !== undefined) {
|
715
|
+
hotKeysActive = videojsPlayer.activePlugins_.hotKeys;
|
716
|
+
}
|
717
|
+
|
718
|
+
if (!hotKeysActive) {
|
719
|
+
videojsPlayer.hotKeys({
|
720
|
+
volumeStep: hotKeysPlugin.options.volumeStep,
|
721
|
+
seekStep: hotKeysPlugin.options.seekStep,
|
722
|
+
enableMute: hotKeysPlugin.options.enableMute,
|
723
|
+
enableFullscreen: hotKeysPlugin.options.enableFullscreen,
|
724
|
+
enableNumbers: hotKeysPlugin.options.enableNumbers,
|
725
|
+
enableVolumeScroll: hotKeysPlugin.options.enableVolumeScroll,
|
726
|
+
enableHoverScroll: hotKeysPlugin.options.enableHoverScroll,
|
727
|
+
alwaysCaptureHotkeys: hotKeysPlugin.options.alwaysCaptureHotkeys,
|
728
|
+
captureDocumentHotkeys: hotKeysPlugin.options.captureDocumentHotkeys,
|
729
|
+
documentHotkeysFocusElementFilter: hotKeysPlugin.options.documentHotkeysFocusElementFilter,
|
730
|
+
|
731
|
+
// Mimic VLC seek behavior (default to: 15)
|
732
|
+
seekStep: function(e) {
|
733
|
+
if (e.ctrlKey && e.altKey) {
|
734
|
+
return 5*60;
|
735
|
+
} else if (e.ctrlKey) {
|
736
|
+
return 60;
|
737
|
+
} else if (e.altKey) {
|
738
|
+
return 10;
|
739
|
+
} else {
|
740
|
+
return 15;
|
741
|
+
}
|
742
|
+
}
|
743
|
+
|
744
|
+
});
|
745
|
+
} // END if hotKeysActive
|
732
746
|
|
733
|
-
|
734
|
-
videojsPlayer.on("play", function() {
|
735
|
-
videojsPlayer.currentTime(videoStart);
|
747
|
+
} // END if hotKeysPlugin enabled
|
736
748
|
|
737
|
-
|
738
|
-
|
749
|
+
// add skipButtons Plugin (only available for VJS)
|
750
|
+
// -------------------------------------------------------------
|
751
|
+
if (skipButtonsPlugin !== undefined && skipButtonsPlugin.enabled && videojsPlayer.skipButtons !== undefined) {
|
752
|
+
// merge objects
|
753
|
+
skipButtonsPlugin.options = __assign(__assign({}, skipButtonsPluginDefaults), skipButtonsPlugin.options);
|
739
754
|
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
var left = (markers[i].time / total * 100) + '%';
|
746
|
-
var time = markers[i].time;
|
747
|
-
var el = $('<div class="vjs-chapter-marker" style="left: ' +left+ '" data-time="' +time+ '"> <span>' +markers[i].label+ '</span></div>');
|
755
|
+
// prevent multiple plugin instances
|
756
|
+
var skipButtonsActive = false;
|
757
|
+
if (videojsPlayer.activePlugins_ !== undefined && videojsPlayer.activePlugins_.skipButtons !== undefined) {
|
758
|
+
skipButtonsActive = videojsPlayer.activePlugins_.skipButtons;
|
759
|
+
}
|
748
760
|
|
749
|
-
|
750
|
-
|
761
|
+
if (!skipButtonsActive) {
|
762
|
+
videojsPlayer.skipButtons({
|
763
|
+
backward: skipButtonsPlugin.options.backward,
|
764
|
+
forward: skipButtonsPlugin.options.forward,
|
765
|
+
backwardIndex: skipButtonsPlugin.options.backwardIndex,
|
766
|
+
forwardIndex: skipButtonsPlugin.options.forwardIndex
|
751
767
|
});
|
768
|
+
}
|
769
|
+
|
770
|
+
} // END if skipButtons Plugin enabled
|
771
|
+
|
772
|
+
// add zoom Plugin (only available for VJS)
|
773
|
+
// -----------------------------------------------------------------
|
774
|
+
if (zoomPlugin !== undefined && zoomPlugin.enabled && videojsPlayer.zoomButtons !== undefined) {
|
775
|
+
// merge objects
|
776
|
+
zoomPlugin.options = __assign(__assign({}, zoomPluginDefaults), zoomPlugin.options);
|
752
777
|
|
753
|
-
|
754
|
-
|
755
|
-
|
778
|
+
// prevent multiple plugin instances
|
779
|
+
var zoomButtonsActive = false;
|
780
|
+
if (videojsPlayer.activePlugins_ !== undefined && videojsPlayer.activePlugins_.zoomButtons !== undefined) {
|
781
|
+
zoomButtonsActive = videojsPlayer.activePlugins_.zoomButtons;
|
782
|
+
}
|
783
|
+
|
784
|
+
if (!zoomButtonsActive) {
|
785
|
+
videojsPlayer.zoomButtons({
|
786
|
+
moveX: zoomPlugin.options.moveX,
|
787
|
+
moveY: zoomPlugin.options.moveY,
|
788
|
+
rotate: zoomPlugin.options.rotate,
|
789
|
+
zoom: zoomPlugin.options.zoom
|
790
|
+
});
|
756
791
|
}
|
757
|
-
}, 10);
|
758
|
-
}, 1000 );
|
759
792
|
|
760
|
-
|
793
|
+
} // END if zoom Plugin enabled
|
794
|
+
|
795
|
+
// chapter track processing (only available for VJS)
|
796
|
+
// -----------------------------------------------------------------
|
797
|
+
if (chapterTracksEnabled) {
|
798
|
+
var parser = new WebVTTParser();
|
799
|
+
var markers = [];
|
800
|
+
|
801
|
+
function cb_load (data /* ,textStatus, jqXHR */ ) {
|
802
|
+
var tree = parser.parse(data, 'metadata');
|
803
|
+
var marker;
|
804
|
+
|
805
|
+
// add chapter tracks to markers array
|
806
|
+
for (var i=0; i<tree.cues.length; i++) {
|
807
|
+
marker = { time: tree.cues[i].startTime, label: tree.cues[i].text };
|
808
|
+
markers.push(marker);
|
809
|
+
}
|
810
|
+
}; // END function cb_load
|
811
|
+
|
812
|
+
// load chapter tracks
|
813
|
+
// -------------------------------------------------------------
|
814
|
+
loadVtt(trackSrc, cb_load);
|
761
815
|
|
762
|
-
|
816
|
+
// add chapter tracks on play
|
817
|
+
videojsPlayer.on("play", function() {
|
818
|
+
videojsPlayer.currentTime(videoStart);
|
763
819
|
|
764
|
-
|
820
|
+
var total = videojsPlayer.duration();
|
821
|
+
var timeline = $(videojsPlayer.controlBar.progressControl.children_[0].el_);
|
822
|
+
|
823
|
+
// add chapter tracks on timeline (delayed)
|
824
|
+
setTimeout (function() {
|
825
|
+
var markers_loaded = setInterval (function () {
|
826
|
+
if (markers.length) {
|
827
|
+
for (var i=0; i<markers.length; i++) {
|
828
|
+
var left = (markers[i].time / total * 100) + '%';
|
829
|
+
var time = markers[i].time;
|
830
|
+
var el = $('<div class="vjs-chapter-marker" style="left: ' +left+ '" data-time="' +time+ '"> <span>' +markers[i].label+ '</span></div>');
|
831
|
+
|
832
|
+
el.click(function() {
|
833
|
+
videojsPlayer.currentTime($(this).data('time'));
|
834
|
+
});
|
835
|
+
|
836
|
+
timeline.append(el);
|
837
|
+
}
|
838
|
+
clearInterval(markers_loaded);
|
839
|
+
}
|
840
|
+
}, 10); // END markers_loaded
|
841
|
+
}, 1000 ); // END setTimeout
|
842
|
+
|
843
|
+
}); // END on "play"
|
844
|
+
|
845
|
+
} // END if chapterTracksEnabled
|
846
|
+
|
847
|
+
} // END if videojsPlayer is defined
|
765
848
|
|
766
849
|
} // END if videoInfo.html5
|
767
850
|
|
@@ -811,7 +894,8 @@
|
|
811
894
|
console.warn('lightGallery: Make sure you have included //fast.wistia.com/assets/external/E-v1.js');
|
812
895
|
}
|
813
896
|
}
|
814
|
-
|
897
|
+
|
898
|
+
}; // END controlVideo
|
815
899
|
|
816
900
|
Video.prototype.loadVideoOnPosterClick = function ($el, forcePlay) {
|
817
901
|
var _this = this;
|
@@ -875,4 +959,4 @@
|
|
875
959
|
|
876
960
|
return Video;
|
877
961
|
|
878
|
-
})));
|
962
|
+
})));
|
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2014-2022 Dmitry Semenov, https://dimsemenov.com
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
@@ -0,0 +1,32 @@
|
|
1
|
+
[](https://savelife.in.ua/en/)
|
2
|
+
|
3
|
+
|
4
|
+
PhotoSwipe v5 — JavaScript image gallery and lightbox
|
5
|
+
|
6
|
+
**[Demo](https://photoswipe.com)** | **[Documentation](https://photoswipe.com/getting-started/)**
|
7
|
+
|
8
|
+
[](https://opencollective.com/photoswipe)
|
9
|
+
[](https://twitter.com/intent/user?screen_name=photoswipe)
|
10
|
+
|
11
|
+
|
12
|
+
### Repo structure
|
13
|
+
|
14
|
+
- `dist/` - main JS and CSS
|
15
|
+
- `src/` - source JS and CSS.
|
16
|
+
- `src/js/photoswipe.js` - entry for PhotoSwipe Core.
|
17
|
+
- `src/js/lightbox/lightbox.js` - entry for PhotoSwipe Lightbox.
|
18
|
+
- `docs/` - documentation markdown files.
|
19
|
+
- `demo-docs-website/` - website with documentation, demos and manual tests.
|
20
|
+
- `build/` - rollup build config.
|
21
|
+
|
22
|
+
To build JS and CSS in `dist/` directory, run `npm run build`.
|
23
|
+
|
24
|
+
To run the demo website and automatically rebuild files during development, run `npm install` in `demo-docs-website/` and `npm run watch` in the root directory.
|
25
|
+
|
26
|
+
### Older versions
|
27
|
+
|
28
|
+
Documentation for the old version (v4) can be found [here](https://photoswipe.com/v4-docs/getting-started.html) and [the code for 4.1.3 is here](https://github.com/dimsemenov/PhotoSwipe/tree/v4.1.3).
|
29
|
+
|
30
|
+
---
|
31
|
+
|
32
|
+
This project is tested with [BrowserStack](https://www.browserstack.com/).
|
@@ -0,0 +1,5 @@
|
|
1
|
+
/*!
|
2
|
+
* PhotoSwipe Dynamic Caption plugin 1.2.7 - https://photoswipe.com
|
3
|
+
* (c) 2022 Dmytro Semenov
|
4
|
+
*/
|
5
|
+
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(t="undefined"!=typeof globalThis?globalThis:t||self).PhotoSwipeDynamicCaption=i()}(this,(function(){"use strict";const t={captionContent:".pswp-caption-content",type:"auto",horizontalEdgeThreshold:20,mobileCaptionOverlapRatio:.3,mobileLayoutBreakpoint:600,verticallyCenterImage:!1};return class{constructor(i,e){this.options={...t,...e},this.lightbox=i,this.lightbox.on("init",(()=>{this.pswp=this.lightbox.pswp,this.initCaption()}))}initCaption(){const{pswp:t}=this;t.on("change",(()=>{this.showCaption(this.pswp.currSlide)})),t.on("calcSlideSize",(t=>this.onCalcSlideSize(t))),t.on("slideDestroy",(t=>{t.slide.dynamicCaption&&(t.slide.dynamicCaption.element&&t.slide.dynamicCaption.element.remove(),delete t.slide.dynamicCaption)})),t.on("zoomPanUpdate",(({slide:i})=>{if(t.opener.isOpen&&i.dynamicCaption){if(i.currZoomLevel>i.zoomLevels.initial?this.hideCaption(i):this.showCaption(i),i.dynamicCaption.element){let t=0;if(i.currZoomLevel<=i.zoomLevels.initial){const e=i.pan.y-i.bounds.center.y;Math.abs(e)>1&&(t=e)}this.setCaptionYOffset(i.dynamicCaption.element,t)}this.adjustPanArea(i,i.currZoomLevel)}})),t.on("beforeZoomTo",(i=>{this.adjustPanArea(t.currSlide,i.destZoomLevel)})),t.on("tapAction",(t=>{t.originalEvent.target.closest(".pswp__dynamic-caption")&&t.preventDefault()}))}adjustPanArea(t,i){t.dynamicCaption&&t.dynamicCaption.adjustedPanAreaSize&&(i>t.zoomLevels.initial?(t.panAreaSize.x=t.dynamicCaption.originalPanAreaSize.x,t.panAreaSize.y=t.dynamicCaption.originalPanAreaSize.y):(t.panAreaSize.x=t.dynamicCaption.adjustedPanAreaSize.x,t.panAreaSize.y=t.dynamicCaption.adjustedPanAreaSize.y))}useMobileLayout(){const{mobileLayoutBreakpoint:t}=this.options;return"function"==typeof t?t.call(this):"number"==typeof t&&window.innerWidth<t}hideCaption(t){if(t.dynamicCaption&&!t.dynamicCaption.hidden){const i=t.dynamicCaption.element;if(!i)return;t.dynamicCaption.hidden=!0,i.classList.add("pswp__dynamic-caption--faded"),t.captionFadeTimeout&&clearTimeout(t.captionFadeTimeout),t.captionFadeTimeout=setTimeout((()=>{i.style.visibility="hidden",delete t.captionFadeTimeout}),400)}}setCaptionYOffset(t,i){t.style.transform=`translateY(${i}px)`}showCaption(t){if(t.dynamicCaption&&t.dynamicCaption.hidden){const i=t.dynamicCaption.element;if(!i)return;t.dynamicCaption.hidden=!1,i.style.visibility="visible",clearTimeout(t.captionFadeTimeout),t.captionFadeTimeout=setTimeout((()=>{i.classList.remove("pswp__dynamic-caption--faded"),delete t.captionFadeTimeout}),50)}}setCaptionPosition(t,i,e){const s=i<=this.options.horizontalEdgeThreshold;t.classList[s?"add":"remove"]("pswp__dynamic-caption--on-hor-edge"),t.style.left=i+"px",t.style.top=e+"px"}setCaptionWidth(t,i){i?t.style.width=i+"px":t.style.removeProperty("width")}setCaptionType(t,i){const e=t.dataset.pswpCaptionType;i!==e&&(t.classList.add("pswp__dynamic-caption--"+i),t.classList.remove("pswp__dynamic-caption--"+e),t.dataset.pswpCaptionType=i)}updateCaptionPosition(t){if(!t.dynamicCaption||!t.dynamicCaption.type||!t.dynamicCaption.element)return;if("mobile"===t.dynamicCaption.type)return this.setCaptionType(t.dynamicCaption.element,t.dynamicCaption.type),t.dynamicCaption.element.style.removeProperty("left"),t.dynamicCaption.element.style.removeProperty("top"),void this.setCaptionWidth(t.dynamicCaption.element,!1);const i=t.zoomLevels.initial,e=Math.ceil(t.width*i),s=Math.ceil(t.height*i);this.setCaptionType(t.dynamicCaption.element,t.dynamicCaption.type),"aside"===t.dynamicCaption.type?(this.setCaptionPosition(t.dynamicCaption.element,t.bounds.center.x+e,t.bounds.center.y),this.setCaptionWidth(t.dynamicCaption.element,!1)):"below"===t.dynamicCaption.type&&(this.setCaptionPosition(t.dynamicCaption.element,t.bounds.center.x,t.bounds.center.y+s),this.setCaptionWidth(t.dynamicCaption.element,e))}onCalcSlideSize(t){const{slide:i}=t;let e,s;if(!i.dynamicCaption){i.dynamicCaption={element:void 0,type:!1,hidden:!1};const t=this.getCaptionHTML(i);if(!t)return;i.dynamicCaption.element=document.createElement("div"),i.dynamicCaption.element.className="pswp__dynamic-caption pswp__hide-on-close",i.dynamicCaption.element.innerHTML=t,this.pswp.dispatch("dynamicCaptionUpdateHTML",{captionElement:i.dynamicCaption.element,slide:i}),i.holderElement.appendChild(i.dynamicCaption.element)}if(!i.dynamicCaption.element)return;this.storeOriginalPanAreaSize(i),i.bounds.update(i.zoomLevels.initial),this.useMobileLayout()?(i.dynamicCaption.type="mobile",s=!0):"auto"===this.options.type?i.bounds.center.x>i.bounds.center.y?i.dynamicCaption.type="aside":i.dynamicCaption.type="below":i.dynamicCaption.type=this.options.type;const o=Math.ceil(i.width*i.zoomLevels.initial),n=Math.ceil(i.height*i.zoomLevels.initial);if(this.setCaptionType(i.dynamicCaption.element,i.dynamicCaption.type),"aside"===i.dynamicCaption.type){this.setCaptionWidth(i.dynamicCaption.element,!1),e=this.measureCaptionSize(i.dynamicCaption.element,t.slide);const s=e.x,n=o+i.bounds.center.x;i.panAreaSize.x-n<=s&&(i.panAreaSize.x-=s,this.recalculateZoomLevelAndBounds(i))}else if("below"===i.dynamicCaption.type||s){this.setCaptionWidth(i.dynamicCaption.element,s?this.pswp.viewportSize.x:o),e=this.measureCaptionSize(i.dynamicCaption.element,t.slide);const a=e.y;if(this.options.verticallyCenterImage)i.panAreaSize.y-=a,this.recalculateZoomLevelAndBounds(i);else{const t=n+i.bounds.center.y,e=i.panAreaSize.y-t,o=i.panAreaSize.y;if(e<=a){i.panAreaSize.y-=Math.min(2*(a-e),a),this.recalculateZoomLevelAndBounds(i);const t=i.panAreaSize.x*this.options.mobileCaptionOverlapRatio/2;s&&i.bounds.center.x>t&&(i.panAreaSize.y=o,this.recalculateZoomLevelAndBounds(i))}}}this.storeAdjustedPanAreaSize(i),this.updateCaptionPosition(i)}measureCaptionSize(t,i){const e=t.getBoundingClientRect();return this.pswp.dispatch("dynamicCaptionMeasureSize",{captionEl:t,slide:i,captionSize:{x:e.width,y:e.height}}).captionSize}recalculateZoomLevelAndBounds(t){t.zoomLevels.update(t.width,t.height,t.panAreaSize),t.bounds.update(t.zoomLevels.initial)}storeAdjustedPanAreaSize(t){t.dynamicCaption&&(t.dynamicCaption.adjustedPanAreaSize||(t.dynamicCaption.adjustedPanAreaSize={}),t.dynamicCaption.adjustedPanAreaSize.x=t.panAreaSize.x,t.dynamicCaption.adjustedPanAreaSize.y=t.panAreaSize.y)}storeOriginalPanAreaSize(t){t.dynamicCaption&&(t.dynamicCaption.originalPanAreaSize||(t.dynamicCaption.originalPanAreaSize={}),t.dynamicCaption.originalPanAreaSize.x=t.panAreaSize.x,t.dynamicCaption.originalPanAreaSize.y=t.panAreaSize.y)}getCaptionHTML(t){if("function"==typeof this.options.captionContent)return this.options.captionContent.call(this,t);const i=t.data.element;let e="";if(i){const t=i.querySelector(this.options.captionContent);if(t)e=t.innerHTML;else{const t=i.querySelector("img");t&&(e=t.getAttribute("alt"))}}return e}}}));
|