j1-template 2024.3.22 → 2024.3.23
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.
- checksums.yaml +4 -4
- data/assets/data/{galeries.html → gallery_app.html} +4 -4
- data/assets/theme/bla +0 -0
- data/assets/theme/j1/adapter/js/amplitude.js +144 -52
- data/assets/theme/j1/adapter/js/gallery.js +1 -1
- data/assets/theme/j1/adapter/js/themes.js +41 -69
- data/assets/theme/j1/core/css/themes/unolight/bootstrap.css +19 -52
- data/assets/theme/j1/core/css/themes/unolight/bootstrap.min.css +1 -1
- data/assets/theme/j1/modules/amplitudejs/js/tech/ytp.js +466 -396
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/css/lg-transitions.css +984 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/css/lg-transitions.min.css +26 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/css/lightgallery-bundle.css +1627 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/css/lightgallery-bundle.min.css +25 -0
- data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/uno.css +1 -1
- data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/uno.min.css +1 -1
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/fonts/lg.svg +54 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/fonts/lg.ttf +0 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/fonts/lg.woff +0 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/fonts/lg.woff2 +0 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/images/loading.gif +0 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/img/loading.gif +0 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/img/video-play.png +0 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/img/vimeo-play.png +0 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/img/youtube-play.png +0 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/lightgallery.js +2782 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/lightgallery.min.js +26 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/parser/webvtt/LICENSE.md +44 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/parser/webvtt/README.md +37 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/parser/webvtt/parser.js +890 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/parser/webvtt/parser.min.js +8 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/j1/lg-video.1.js +585 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-autoplay.js +275 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-autoplay.min.js +26 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-comment.js +230 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-comment.min.js +26 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-fullscreen.js +160 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-fullscreen.min.js +26 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-hash.js +223 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-hash.min.js +27 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-medium-zoom.js +157 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-medium-zoom.min.js +26 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-pager.js +164 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-pager.min.js +26 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-rotate.js +299 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-rotate.min.js +26 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-share.js +244 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-share.min.js +27 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-thumbnail.js +509 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-thumbnail.min.js +26 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-video.js +909 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-video.min.js +26 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-vimeo-thumbnail.js +207 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-vimeo-thumbnail.min.js +26 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-zoom.js +999 -0
- data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-zoom.min.js +26 -0
- data/assets/theme/j1/modules/lightGallery/css/lg-transitions.css +3 -126
- data/assets/theme/j1/modules/lightGallery/css/lg-transitions.min.css +3 -10
- data/assets/theme/j1/modules/lightGallery/css/lightgallery-bundle.css +70 -237
- data/assets/theme/j1/modules/lightGallery/css/lightgallery-bundle.min.css +4 -10
- data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/animation-w.png +0 -0
- data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/customize-w.png +0 -0
- data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/dynamic-w.png +0 -0
- data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/facebook-icon.svg +10 -0
- data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/googleplus-icon.svg +30 -0
- data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/html5-w.png +0 -0
- data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/linked-in.png +0 -0
- data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/module-w.png +0 -0
- data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/play-button-hover.svg +94 -0
- data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/play-button.png +0 -0
- data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/play-button.svg +93 -0
- data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/responsive-w.png +0 -0
- data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/thumb-w.png +0 -0
- data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/touch-w.png +0 -0
- data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/twitter-icon.svg +15 -0
- data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/twitter.png +0 -0
- data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/video1-w.png +0 -0
- data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/zoom-w.png +0 -0
- data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/zoom.png +0 -0
- data/assets/theme/j1/modules/lightGallery/css/theme/uno/uno.css +276 -0
- data/assets/theme/j1/modules/lightGallery/css/theme/uno/uno.min.css +17 -0
- data/assets/theme/j1/modules/lightGallery/js/lightgallery.js +163 -120
- data/assets/theme/j1/modules/lightGallery/js/lightgallery.min.js +6 -6
- data/assets/theme/j1/modules/lightGallery/js/plugins/j1/lg-thumbnail.0.js +495 -0
- data/assets/theme/j1/modules/lightGallery/js/plugins/j1/lg-thumbnail.1.js +513 -0
- data/assets/theme/j1/modules/lightGallery/js/plugins/j1/lg-video.0.js +553 -0
- data/assets/theme/j1/modules/lightGallery/js/plugins/j1/lg-video.1.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/j1/lg-video.2.js +914 -0
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-autoplay.js +4 -4
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-autoplay.min.js +5 -5
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-comment.js +5 -5
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-comment.min.js +6 -6
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-fullscreen.js +4 -4
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-fullscreen.min.js +5 -5
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-hash.js +4 -4
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-hash.min.js +5 -6
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-medium-zoom.js +5 -5
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-medium-zoom.min.js +6 -6
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-pager.js +4 -4
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-pager.min.js +5 -5
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-relative-caption.js +179 -0
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-relative-caption.min.js +32 -0
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-rotate.js +4 -4
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-rotate.min.js +6 -6
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-share.js +4 -4
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-share.min.js +6 -7
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-thumbnail.js +27 -20
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-thumbnail.min.js +5 -5
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.js +77 -125
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.min.js +6 -6
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-vimeo-thumbnail.js +4 -4
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-vimeo-thumbnail.min.js +5 -5
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-zoom.js +11 -5
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-zoom.min.js +5 -5
- data/assets/theme/j1/modules/themeSwitcher/js/switcher.js +13 -12
- data/assets/theme/j1/modules/videoPlayer/tiktoc/README.md +1 -0
- data/assets/theme/j1/modules/videojs/!v8.12.0/css/font/README.md +151 -0
- data/assets/theme/j1/modules/videojs/!v8.12.0/css/font/VideoJS.svg +150 -0
- data/assets/theme/j1/modules/videojs/!v8.12.0/css/themes/city.css +147 -0
- data/assets/theme/j1/modules/videojs/!v8.12.0/css/themes/city.min.css +5 -0
- data/assets/theme/j1/modules/videojs/!v8.12.0/css/themes/fantasy.css +113 -0
- data/assets/theme/j1/modules/videojs/!v8.12.0/css/themes/fantasy.min.css +5 -0
- data/assets/theme/j1/modules/videojs/!v8.12.0/css/themes/forest.css +166 -0
- data/assets/theme/j1/modules/videojs/!v8.12.0/css/themes/forest.min.css +5 -0
- data/assets/theme/j1/modules/videojs/!v8.12.0/css/themes/sea.css +72 -0
- data/assets/theme/j1/modules/videojs/!v8.12.0/css/themes/sea.min.css +5 -0
- data/assets/theme/j1/modules/videojs/!v8.12.0/css/themes/uno.css +311 -0
- data/assets/theme/j1/modules/videojs/!v8.12.0/css/themes/uno.min.css +19 -0
- data/assets/theme/j1/modules/videojs/!v8.12.0/css/videojs.css +1686 -0
- data/assets/theme/j1/modules/videojs/!v8.12.0/css/videojs.min.css +13 -0
- data/assets/theme/j1/modules/videojs/!v8.12.0/js/video.js +65226 -0
- data/assets/theme/j1/modules/videojs/!v8.12.0/js/video.min.js +55 -0
- data/assets/theme/j1/modules/videojs/assets/README.md +1 -0
- data/assets/theme/j1/modules/videojs/assets/icons/speedometer-medium.svg +35 -0
- data/assets/theme/j1/modules/videojs/css/font/VideoJS.ttf +0 -0
- data/assets/theme/j1/modules/videojs/css/font/VideoJS.woff +0 -0
- data/assets/theme/j1/modules/videojs/css/themes/uno.css +157 -22
- data/assets/theme/j1/modules/videojs/css/themes/uno.min.css +1 -1
- data/assets/theme/j1/modules/videojs/css/videojs.css +674 -316
- data/assets/theme/j1/modules/videojs/css/videojs.min.css +4 -3
- data/assets/theme/j1/modules/videojs/js/video.js +15893 -12288
- data/assets/theme/j1/modules/videojs/js/video.min.js +22 -23
- data/assets/theme/j1/modules/videojs/plugins/controls/aspect-ratio-panel/!examples/index.html +31 -0
- data/assets/theme/j1/modules/videojs/plugins/controls/aspect-ratio-panel/LICENSE +19 -0
- data/assets/theme/j1/modules/videojs/plugins/controls/aspect-ratio-panel/README.md +69 -0
- data/assets/theme/j1/modules/videojs/plugins/controls/aspect-ratio-panel/css/aspect-ratio-panel.css +2 -0
- data/assets/theme/j1/modules/videojs/plugins/controls/aspect-ratio-panel/css/aspect-ratio-panel.min.css +2 -0
- data/assets/theme/j1/modules/videojs/plugins/controls/aspect-ratio-panel/js/aspect-ratio-panel.js +339 -0
- data/assets/theme/j1/modules/videojs/plugins/controls/aspect-ratio-panel/js/aspect-ratio-panel.min.js +2 -0
- data/assets/theme/j1/modules/videojs/{js/plugins/controls/autocaption → plugins/controls/autocaption/js}/autocaption.js +0 -5
- data/assets/theme/j1/modules/videojs/plugins/controls/persist-settings/!examples/index.html +29 -0
- data/assets/theme/j1/modules/videojs/plugins/controls/persist-settings/LICENSE +19 -0
- data/assets/theme/j1/modules/videojs/plugins/controls/persist-settings/README.md +90 -0
- data/assets/theme/j1/modules/videojs/plugins/controls/persist-settings/js/videojs-persist.js +120 -0
- data/assets/theme/j1/modules/videojs/plugins/controls/persist-settings/js/videojs-persist.min.js +2 -0
- data/assets/theme/j1/modules/videojs/plugins/controls/playbackrate-adjuster/!examples/index.html +37 -0
- data/assets/theme/j1/modules/videojs/plugins/controls/playbackrate-adjuster/LICENSE +19 -0
- data/assets/theme/j1/modules/videojs/plugins/controls/playbackrate-adjuster/README.md +61 -0
- data/assets/theme/j1/modules/videojs/plugins/controls/playbackrate-adjuster/js/playbackrate-adjuster.js +94 -0
- data/assets/theme/j1/modules/videojs/plugins/controls/playbackrate-adjuster/js/playbackrate-adjuster.min.js +20 -0
- data/assets/theme/j1/modules/videojs/{js/plugins → plugins}/controls/skipbuttons/README.md +25 -11
- data/assets/theme/j1/modules/videojs/{css/plugins/controls → plugins/controls/zoom/css}/zoom.css +7 -6
- data/assets/theme/j1/modules/videojs/plugins/controls/zoom/css/zoom.min.css +22 -0
- data/assets/theme/j1/modules/videojs/{js/plugins/players/dm → plugins/players/dm/js}/dailymotion.js +1 -1
- data/assets/theme/j1/modules/videojs/plugins/players/vm/!unused/vimeo.0.js +521 -0
- data/assets/theme/j1/modules/videojs/plugins/players/vm/!unused/vimeo.1.js +605 -0
- data/assets/theme/j1/modules/videojs/plugins/players/vm/!unused/vimeo.3.js +643 -0
- data/assets/theme/j1/modules/videojs/plugins/players/vm/!unused/vimeo.4.js +583 -0
- data/assets/theme/j1/modules/videojs/plugins/players/vm/!unused/vimeo.5.js +665 -0
- data/assets/theme/j1/modules/videojs/plugins/players/vm/!unused/vimeo.6.js +642 -0
- data/assets/theme/j1/modules/videojs/plugins/players/vm/!unused/vimeo.7.js +673 -0
- data/assets/theme/j1/modules/videojs/{js/plugins/players/vm/api → plugins/players/vm/api/js}/vimeo.js +1 -1
- data/assets/theme/j1/modules/videojs/{js/plugins/players/vm/api → plugins/players/vm/api/js}/vimeo.min.js +1 -1
- data/assets/theme/j1/modules/videojs/{js/plugins/players/vm → plugins/players/vm/js}/vimeo.js +4 -5
- data/assets/theme/j1/modules/videojs/plugins/players/vm/js/vimeo.min.js +28 -0
- data/assets/theme/j1/modules/videojs/plugins/players/wt/!unused/wistia.0.js +395 -0
- data/assets/theme/j1/modules/videojs/plugins/players/wt/!unused/wistia.1.js +401 -0
- data/lib/j1/version.rb +1 -1
- data/lib/starter_web/README.md +5 -5
- data/lib/starter_web/_config.yml +1 -1
- data/lib/starter_web/_data/modules/amplitude_playlists.yml +16 -1
- data/lib/starter_web/_data/modules/defaults/gallery.yml +3 -3
- data/lib/starter_web/_data/modules/gallery.yml +83 -87
- data/lib/starter_web/_data/modules/navigator_menu.yml +3 -3
- data/lib/starter_web/_data/resources.yml +16 -12
- data/lib/starter_web/_data/templates/feed.xml +1 -1
- data/lib/starter_web/_plugins/asciidoctor/videojs-block.rb +50 -30
- data/lib/starter_web/_plugins/asciidoctor/youtube-block.rb +37 -23
- data/lib/starter_web/_plugins/index/lunr.rb +1 -1
- data/lib/starter_web/assets/video/poster/vimeo/fall_2011.jpg +0 -0
- data/lib/starter_web/package.json +1 -1
- data/lib/starter_web/pages/public/tools/tester/videojs_macro_tester.adoc +282 -0
- data/lib/starter_web/pages/public/tour/video_data.adoc +1 -0
- metadata +221 -106
- data/assets/data/swiper_app.2.html +0 -757
- data/assets/data/swiper_app.4.html +0 -769
- data/assets/theme/j1/modules/videojs/css/plugins/controls/skipbuttons.0.css +0 -32
- data/assets/theme/j1/modules/videojs/css/plugins/controls/skipbuttons.1.css +0 -31
- data/assets/theme/j1/modules/videojs/css/plugins/controls/zoom.min.css +0 -21
- data/assets/theme/j1/modules/videojs/js/plugins/players/vm/vimeo.min.js +0 -16
- data/assets/theme/j1/modules/videojs/js/plugins/players/wt/api/src/WistiaPlayer.ts +0 -1617
- data/lib/starter_web/assets/video/poster/vimeo/stay_colorful.jpg +0 -0
- /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/animation-w.png +0 -0
- /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/customize-w.png +0 -0
- /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/dynamic-w.png +0 -0
- /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/facebook-icon.svg +0 -0
- /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/googleplus-icon.svg +0 -0
- /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/html5-w.png +0 -0
- /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/linked-in.png +0 -0
- /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/module-w.png +0 -0
- /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/play-button-hover.svg +0 -0
- /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/play-button.png +0 -0
- /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/play-button.svg +0 -0
- /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/responsive-w.png +0 -0
- /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/thumb-w.png +0 -0
- /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/touch-w.png +0 -0
- /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/twitter-icon.svg +0 -0
- /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/twitter.png +0 -0
- /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/video1-w.png +0 -0
- /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/zoom-w.png +0 -0
- /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/zoom.png +0 -0
- /data/assets/theme/j1/modules/lightGallery/{js → !v2.7.2/js}/plugins/j1/j1-video.js +0 -0
- /data/assets/theme/j1/modules/lightGallery/{js → !v2.7.2/js}/plugins/j1/j1-video.min.js +0 -0
- /data/assets/theme/j1/modules/videoPlayer/dailymotion/js/{!readme → README.md} +0 -0
- /data/assets/theme/j1/modules/videoPlayer/tiktoc/{js/player.min.js → player.min.js} +0 -0
- /data/assets/theme/j1/modules/videoPlayer/vimeo/js/{!readme → README.md} +0 -0
- /data/assets/theme/j1/modules/videoPlayer/wistia/js/{!readme → README.md} +0 -0
- /data/assets/theme/j1/modules/videojs/{css → !v8.12.0/css}/font/video-js-cdn.css +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins → plugins}/controls/autocaption/LICENSE +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins → plugins}/controls/autocaption/README.md +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/controls/autocaption → plugins/controls/autocaption/js}/autocaption.min.js +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/controls/hotkeys/examples → plugins/controls/hotkeys/!examples}/example.html +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins → plugins}/controls/hotkeys/LICENSE.md +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins → plugins}/controls/hotkeys/README.md +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/controls/hotkeys → plugins/controls/hotkeys/js}/hotkeys.js +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/controls/hotkeys → plugins/controls/hotkeys/js}/hotkeys.min.js +0 -0
- /data/assets/theme/j1/modules/videojs/{css/plugins/controls → plugins/controls/skipbuttons/css}/skipbuttons.css +0 -0
- /data/assets/theme/j1/modules/videojs/{css/plugins/controls → plugins/controls/skipbuttons/css}/skipbuttons.min.css +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/controls/skipbuttons → plugins/controls/skipbuttons/js}/skipbuttons.js +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/controls/skipbuttons → plugins/controls/skipbuttons/js}/skipbuttons.min.js +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/controls/zoom/examples → plugins/controls/zoom/!examples}/index.html +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/controls/zoom/examples → plugins/controls/zoom/!examples}/index.js +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/controls/zoom/examples → plugins/controls/zoom/!examples}/styles.css +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins → plugins}/controls/zoom/LICENSE.md +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins → plugins}/controls/zoom/README.md +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/controls/zoom → plugins/controls/zoom/js}/zoom.js +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/controls/zoom → plugins/controls/zoom/js}/zoom.min.js +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/dm/examples → plugins/players/dm/!examples}/dailymotion-controls.html +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/dm/examples → plugins/players/dm/!examples}/dailymotion-javascript.html +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/dm/examples → plugins/players/dm/!examples}/dailymotion-playlist.html +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/dm/examples → plugins/players/dm/!examples}/global-parameters.html +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/dm/examples → plugins/players/dm/!examples}/simple.html +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/dm/examples → plugins/players/dm/!examples}/switch.html +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins → plugins}/players/dm/LICENSE +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/dm/doc → plugins/players/dm}/README.md +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins → plugins}/players/dm/api/LICENSE +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/dm/api/doc → plugins/players/dm/api}/README.md +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/dm/api → plugins/players/dm/api/js}/dailymotion.sdk.js +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/dm/api → plugins/players/dm/api/js}/dailymotion.sdk.min.js +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins → plugins}/players/dm/icon/scalable/dailymotion.svg +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/dm → plugins/players/dm/js}/dailymotion.min.js +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/vm/examples → plugins/players/vm/!examples}/index.html +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/vm/examples → plugins/players/vm/!examples}/player/index.html +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins → plugins}/players/vm/LICENSE +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/vm/doc → plugins/players/vm}/README.md +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/vm/api/doc → plugins/players/vm/api}/README.md +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins → plugins}/players/vm/api/css/embed.player.css +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins → plugins}/players/vm/api/css/embed.player.uno.css +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins → plugins}/players/vm/api/css/player.css +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/wt/doc → plugins/players/wt}/README.md +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/wt/api/doc/Readme.txt → plugins/players/wt/api/README.md} +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/wt/api → plugins/players/wt/api/js}/wistia.min.js +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/wt → plugins/players/wt/js}/wistia.js +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/wt → plugins/players/wt/js}/wistia.min.js +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/yt/examples → plugins/players/yt/!examples}/global-parameters.html +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/yt/examples → plugins/players/yt/!examples}/simple.html +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/yt/examples → plugins/players/yt/!examples}/switch.html +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/yt/examples → plugins/players/yt/!examples}/youtube-controls.html +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/yt/examples → plugins/players/yt/!examples}/youtube-javascript.html +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/yt/examples → plugins/players/yt/!examples}/youtube-list.html +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/yt/examples → plugins/players/yt/!examples}/youtube-playlist.html +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/yt/v3.0.0 → plugins/players/yt/!v3.0.0}/youtube.js +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/yt/v3.0.0 → plugins/players/yt/!v3.0.0}/youtube.min.js +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins → plugins}/players/yt/LICENSE +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/yt/doc → plugins/players/yt}/README.md +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/yt/api → plugins/players/yt/api/js}/youtube.min.js +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/yt → plugins/players/yt/js}/youtube.js +0 -0
- /data/assets/theme/j1/modules/videojs/{js/plugins/players/yt → plugins/players/yt/js}/youtube.min.js +0 -0
@@ -0,0 +1,999 @@
|
|
1
|
+
/*
|
2
|
+
# -----------------------------------------------------------------------------
|
3
|
+
# ~/assets/theme/j1/modules/lightGallery/js/plugins/lg-zoom.js
|
4
|
+
# Provides lightGallery JS code for the plugin lgZoom
|
5
|
+
#
|
6
|
+
# Product/Info:
|
7
|
+
# https://jekyll.one
|
8
|
+
#
|
9
|
+
# Copyright (C) 2025 Sachin Neravath
|
10
|
+
# Copyright (C) 2023-2025 Juergen Adams
|
11
|
+
#
|
12
|
+
# J1 Template is licensed under the MIT License.
|
13
|
+
# See: https://github.com/jekyll-one-org/j1-template/blob/main/LICENSE
|
14
|
+
# lightGallery is licensed under the GPLv3 license
|
15
|
+
# See: https://github.com/sachinchoolur/lightGallery/blob/master/LICENSE
|
16
|
+
# -----------------------------------------------------------------------------
|
17
|
+
*/
|
18
|
+
|
19
|
+
/*!
|
20
|
+
* lightgallery | 2.7.2 | September 20th 2023
|
21
|
+
* http://www.lightgalleryjs.com/
|
22
|
+
* Copyright (c) 2020 Sachin Neravath;
|
23
|
+
* @license GPLv3
|
24
|
+
*/
|
25
|
+
|
26
|
+
(function (global, factory) {
|
27
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
28
|
+
typeof define === 'function' && define.amd ? define(factory) :
|
29
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.lgZoom = factory());
|
30
|
+
}(this, (function () { 'use strict';
|
31
|
+
|
32
|
+
/*! *****************************************************************************
|
33
|
+
Copyright (c) Microsoft Corporation.
|
34
|
+
|
35
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
36
|
+
purpose with or without fee is hereby granted.
|
37
|
+
|
38
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
39
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
40
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
41
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
42
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
43
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
44
|
+
PERFORMANCE OF THIS SOFTWARE.
|
45
|
+
***************************************************************************** */
|
46
|
+
|
47
|
+
var __assign = function() {
|
48
|
+
__assign = Object.assign || function __assign(t) {
|
49
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
50
|
+
s = arguments[i];
|
51
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
52
|
+
}
|
53
|
+
return t;
|
54
|
+
};
|
55
|
+
return __assign.apply(this, arguments);
|
56
|
+
};
|
57
|
+
|
58
|
+
var zoomSettings = {
|
59
|
+
scale: 1,
|
60
|
+
zoom: true,
|
61
|
+
infiniteZoom: true,
|
62
|
+
actualSize: true,
|
63
|
+
showZoomInOutIcons: false,
|
64
|
+
actualSizeIcons: {
|
65
|
+
zoomIn: 'lg-zoom-in',
|
66
|
+
zoomOut: 'lg-zoom-out',
|
67
|
+
},
|
68
|
+
enableZoomAfter: 300,
|
69
|
+
zoomPluginStrings: {
|
70
|
+
zoomIn: 'Zoom in',
|
71
|
+
zoomOut: 'Zoom out',
|
72
|
+
viewActualSize: 'View actual size',
|
73
|
+
},
|
74
|
+
};
|
75
|
+
|
76
|
+
/**
|
77
|
+
* List of lightGallery events
|
78
|
+
* All events should be documented here
|
79
|
+
* Below interfaces are used to build the website documentations
|
80
|
+
* */
|
81
|
+
var lGEvents = {
|
82
|
+
afterAppendSlide: 'lgAfterAppendSlide',
|
83
|
+
init: 'lgInit',
|
84
|
+
hasVideo: 'lgHasVideo',
|
85
|
+
containerResize: 'lgContainerResize',
|
86
|
+
updateSlides: 'lgUpdateSlides',
|
87
|
+
afterAppendSubHtml: 'lgAfterAppendSubHtml',
|
88
|
+
beforeOpen: 'lgBeforeOpen',
|
89
|
+
afterOpen: 'lgAfterOpen',
|
90
|
+
slideItemLoad: 'lgSlideItemLoad',
|
91
|
+
beforeSlide: 'lgBeforeSlide',
|
92
|
+
afterSlide: 'lgAfterSlide',
|
93
|
+
posterClick: 'lgPosterClick',
|
94
|
+
dragStart: 'lgDragStart',
|
95
|
+
dragMove: 'lgDragMove',
|
96
|
+
dragEnd: 'lgDragEnd',
|
97
|
+
beforeNextSlide: 'lgBeforeNextSlide',
|
98
|
+
beforePrevSlide: 'lgBeforePrevSlide',
|
99
|
+
beforeClose: 'lgBeforeClose',
|
100
|
+
afterClose: 'lgAfterClose',
|
101
|
+
rotateLeft: 'lgRotateLeft',
|
102
|
+
rotateRight: 'lgRotateRight',
|
103
|
+
flipHorizontal: 'lgFlipHorizontal',
|
104
|
+
flipVertical: 'lgFlipVertical',
|
105
|
+
autoplay: 'lgAutoplay',
|
106
|
+
autoplayStart: 'lgAutoplayStart',
|
107
|
+
autoplayStop: 'lgAutoplayStop',
|
108
|
+
};
|
109
|
+
|
110
|
+
var ZOOM_TRANSITION_DURATION = 500;
|
111
|
+
var Zoom = /** @class */ (function () {
|
112
|
+
function Zoom(instance, $LG) {
|
113
|
+
// get lightGallery core plugin instance
|
114
|
+
this.core = instance;
|
115
|
+
this.$LG = $LG;
|
116
|
+
this.settings = __assign(__assign({}, zoomSettings), this.core.settings);
|
117
|
+
return this;
|
118
|
+
}
|
119
|
+
// Append Zoom controls. Actual size, Zoom-in, Zoom-out
|
120
|
+
Zoom.prototype.buildTemplates = function () {
|
121
|
+
var zoomIcons = this.settings.showZoomInOutIcons
|
122
|
+
? "<button id=\"" + this.core.getIdName('lg-zoom-in') + "\" type=\"button\" aria-label=\"" + this.settings.zoomPluginStrings['zoomIn'] + "\" class=\"lg-zoom-in lg-icon\"></button><button id=\"" + this.core.getIdName('lg-zoom-out') + "\" type=\"button\" aria-label=\"" + this.settings.zoomPluginStrings['zoomIn'] + "\" class=\"lg-zoom-out lg-icon\"></button>"
|
123
|
+
: '';
|
124
|
+
if (this.settings.actualSize) {
|
125
|
+
zoomIcons += "<button id=\"" + this.core.getIdName('lg-actual-size') + "\" type=\"button\" aria-label=\"" + this.settings.zoomPluginStrings['viewActualSize'] + "\" class=\"" + this.settings.actualSizeIcons.zoomIn + " lg-icon\"></button>";
|
126
|
+
}
|
127
|
+
this.core.outer.addClass('lg-use-transition-for-zoom');
|
128
|
+
this.core.$toolbar.first().append(zoomIcons);
|
129
|
+
};
|
130
|
+
/**
|
131
|
+
* @desc Enable zoom option only once the image is completely loaded
|
132
|
+
* If zoomFromOrigin is true, Zoom is enabled once the dummy image has been inserted
|
133
|
+
*
|
134
|
+
* Zoom styles are defined under lg-zoomable CSS class.
|
135
|
+
*/
|
136
|
+
Zoom.prototype.enableZoom = function (event) {
|
137
|
+
var _this = this;
|
138
|
+
// delay will be 0 except first time
|
139
|
+
var _speed = this.settings.enableZoomAfter + event.detail.delay;
|
140
|
+
// set _speed value 0 if gallery opened from direct url and if it is first slide
|
141
|
+
if (this.$LG('body').first().hasClass('lg-from-hash') &&
|
142
|
+
event.detail.delay) {
|
143
|
+
// will execute only once
|
144
|
+
_speed = 0;
|
145
|
+
}
|
146
|
+
else {
|
147
|
+
// Remove lg-from-hash to enable starting animation.
|
148
|
+
this.$LG('body').first().removeClass('lg-from-hash');
|
149
|
+
}
|
150
|
+
this.zoomableTimeout = setTimeout(function () {
|
151
|
+
if (!_this.isImageSlide(_this.core.index)) {
|
152
|
+
return;
|
153
|
+
}
|
154
|
+
_this.core.getSlideItem(event.detail.index).addClass('lg-zoomable');
|
155
|
+
if (event.detail.index === _this.core.index) {
|
156
|
+
_this.setZoomEssentials();
|
157
|
+
}
|
158
|
+
}, _speed + 30);
|
159
|
+
};
|
160
|
+
Zoom.prototype.enableZoomOnSlideItemLoad = function () {
|
161
|
+
// Add zoomable class
|
162
|
+
this.core.LGel.on(lGEvents.slideItemLoad + ".zoom", this.enableZoom.bind(this));
|
163
|
+
};
|
164
|
+
Zoom.prototype.getDragCords = function (e) {
|
165
|
+
return {
|
166
|
+
x: e.pageX,
|
167
|
+
y: e.pageY,
|
168
|
+
};
|
169
|
+
};
|
170
|
+
Zoom.prototype.getSwipeCords = function (e) {
|
171
|
+
var x = e.touches[0].pageX;
|
172
|
+
var y = e.touches[0].pageY;
|
173
|
+
return {
|
174
|
+
x: x,
|
175
|
+
y: y,
|
176
|
+
};
|
177
|
+
};
|
178
|
+
Zoom.prototype.getDragAllowedAxises = function (scale, scaleDiff) {
|
179
|
+
var $image = this.core
|
180
|
+
.getSlideItem(this.core.index)
|
181
|
+
.find('.lg-image')
|
182
|
+
.first()
|
183
|
+
.get();
|
184
|
+
var height = 0;
|
185
|
+
var width = 0;
|
186
|
+
var rect = $image.getBoundingClientRect();
|
187
|
+
if (scale) {
|
188
|
+
height = $image.offsetHeight * scale;
|
189
|
+
width = $image.offsetWidth * scale;
|
190
|
+
}
|
191
|
+
else if (scaleDiff) {
|
192
|
+
height = rect.height + scaleDiff * rect.height;
|
193
|
+
width = rect.width + scaleDiff * rect.width;
|
194
|
+
}
|
195
|
+
else {
|
196
|
+
height = rect.height;
|
197
|
+
width = rect.width;
|
198
|
+
}
|
199
|
+
var allowY = height > this.containerRect.height;
|
200
|
+
var allowX = width > this.containerRect.width;
|
201
|
+
return {
|
202
|
+
allowX: allowX,
|
203
|
+
allowY: allowY,
|
204
|
+
};
|
205
|
+
};
|
206
|
+
Zoom.prototype.setZoomEssentials = function () {
|
207
|
+
this.containerRect = this.core.$content.get().getBoundingClientRect();
|
208
|
+
};
|
209
|
+
/**
|
210
|
+
* @desc Image zoom
|
211
|
+
* Translate the wrap and scale the image to get better user experience
|
212
|
+
*
|
213
|
+
* @param {String} scale - Zoom decrement/increment value
|
214
|
+
*/
|
215
|
+
Zoom.prototype.zoomImage = function (scale, scaleDiff, reposition, resetToMax) {
|
216
|
+
if (Math.abs(scaleDiff) <= 0)
|
217
|
+
return;
|
218
|
+
var offsetX = this.containerRect.width / 2 + this.containerRect.left;
|
219
|
+
var offsetY = this.containerRect.height / 2 +
|
220
|
+
this.containerRect.top +
|
221
|
+
this.scrollTop;
|
222
|
+
var originalX;
|
223
|
+
var originalY;
|
224
|
+
if (scale === 1) {
|
225
|
+
this.positionChanged = false;
|
226
|
+
}
|
227
|
+
var dragAllowedAxises = this.getDragAllowedAxises(0, scaleDiff);
|
228
|
+
var allowY = dragAllowedAxises.allowY, allowX = dragAllowedAxises.allowX;
|
229
|
+
if (this.positionChanged) {
|
230
|
+
originalX = this.left / (this.scale - scaleDiff);
|
231
|
+
originalY = this.top / (this.scale - scaleDiff);
|
232
|
+
this.pageX = offsetX - originalX;
|
233
|
+
this.pageY = offsetY - originalY;
|
234
|
+
this.positionChanged = false;
|
235
|
+
}
|
236
|
+
var possibleSwipeCords = this.getPossibleSwipeDragCords(scaleDiff);
|
237
|
+
var x;
|
238
|
+
var y;
|
239
|
+
var _x = offsetX - this.pageX;
|
240
|
+
var _y = offsetY - this.pageY;
|
241
|
+
if (scale - scaleDiff > 1) {
|
242
|
+
var scaleVal = (scale - scaleDiff) / Math.abs(scaleDiff);
|
243
|
+
_x =
|
244
|
+
(scaleDiff < 0 ? -_x : _x) +
|
245
|
+
this.left * (scaleVal + (scaleDiff < 0 ? -1 : 1));
|
246
|
+
_y =
|
247
|
+
(scaleDiff < 0 ? -_y : _y) +
|
248
|
+
this.top * (scaleVal + (scaleDiff < 0 ? -1 : 1));
|
249
|
+
x = _x / scaleVal;
|
250
|
+
y = _y / scaleVal;
|
251
|
+
}
|
252
|
+
else {
|
253
|
+
var scaleVal = (scale - scaleDiff) * scaleDiff;
|
254
|
+
x = _x * scaleVal;
|
255
|
+
y = _y * scaleVal;
|
256
|
+
}
|
257
|
+
if (reposition) {
|
258
|
+
if (allowX) {
|
259
|
+
if (this.isBeyondPossibleLeft(x, possibleSwipeCords.minX)) {
|
260
|
+
x = possibleSwipeCords.minX;
|
261
|
+
}
|
262
|
+
else if (this.isBeyondPossibleRight(x, possibleSwipeCords.maxX)) {
|
263
|
+
x = possibleSwipeCords.maxX;
|
264
|
+
}
|
265
|
+
}
|
266
|
+
else {
|
267
|
+
if (scale > 1) {
|
268
|
+
if (x < possibleSwipeCords.minX) {
|
269
|
+
x = possibleSwipeCords.minX;
|
270
|
+
}
|
271
|
+
else if (x > possibleSwipeCords.maxX) {
|
272
|
+
x = possibleSwipeCords.maxX;
|
273
|
+
}
|
274
|
+
}
|
275
|
+
}
|
276
|
+
// @todo fix this
|
277
|
+
if (allowY) {
|
278
|
+
if (this.isBeyondPossibleTop(y, possibleSwipeCords.minY)) {
|
279
|
+
y = possibleSwipeCords.minY;
|
280
|
+
}
|
281
|
+
else if (this.isBeyondPossibleBottom(y, possibleSwipeCords.maxY)) {
|
282
|
+
y = possibleSwipeCords.maxY;
|
283
|
+
}
|
284
|
+
}
|
285
|
+
else {
|
286
|
+
// If the translate value based on index of beyond the viewport, utilize the available space to prevent image being cut out
|
287
|
+
if (scale > 1) {
|
288
|
+
//If image goes beyond viewport top, use the minim possible translate value
|
289
|
+
if (y < possibleSwipeCords.minY) {
|
290
|
+
y = possibleSwipeCords.minY;
|
291
|
+
}
|
292
|
+
else if (y > possibleSwipeCords.maxY) {
|
293
|
+
y = possibleSwipeCords.maxY;
|
294
|
+
}
|
295
|
+
}
|
296
|
+
}
|
297
|
+
}
|
298
|
+
this.setZoomStyles({
|
299
|
+
x: x,
|
300
|
+
y: y,
|
301
|
+
scale: scale,
|
302
|
+
});
|
303
|
+
this.left = x;
|
304
|
+
this.top = y;
|
305
|
+
if (resetToMax) {
|
306
|
+
this.setZoomImageSize();
|
307
|
+
}
|
308
|
+
};
|
309
|
+
Zoom.prototype.resetImageTranslate = function (index) {
|
310
|
+
if (!this.isImageSlide(index)) {
|
311
|
+
return;
|
312
|
+
}
|
313
|
+
var $image = this.core.getSlideItem(index).find('.lg-image').first();
|
314
|
+
this.imageReset = false;
|
315
|
+
$image.removeClass('reset-transition reset-transition-y reset-transition-x');
|
316
|
+
this.core.outer.removeClass('lg-actual-size');
|
317
|
+
$image.css('width', 'auto').css('height', 'auto');
|
318
|
+
setTimeout(function () {
|
319
|
+
$image.removeClass('no-transition');
|
320
|
+
}, 10);
|
321
|
+
};
|
322
|
+
Zoom.prototype.setZoomImageSize = function () {
|
323
|
+
var _this = this;
|
324
|
+
var $image = this.core
|
325
|
+
.getSlideItem(this.core.index)
|
326
|
+
.find('.lg-image')
|
327
|
+
.first();
|
328
|
+
setTimeout(function () {
|
329
|
+
var actualSizeScale = _this.getCurrentImageActualSizeScale();
|
330
|
+
if (_this.scale >= actualSizeScale) {
|
331
|
+
$image.addClass('no-transition');
|
332
|
+
_this.imageReset = true;
|
333
|
+
}
|
334
|
+
}, ZOOM_TRANSITION_DURATION);
|
335
|
+
setTimeout(function () {
|
336
|
+
var actualSizeScale = _this.getCurrentImageActualSizeScale();
|
337
|
+
if (_this.scale >= actualSizeScale) {
|
338
|
+
var dragAllowedAxises = _this.getDragAllowedAxises(_this.scale);
|
339
|
+
$image
|
340
|
+
.css('width', $image.get().naturalWidth + 'px')
|
341
|
+
.css('height', $image.get().naturalHeight + 'px');
|
342
|
+
_this.core.outer.addClass('lg-actual-size');
|
343
|
+
if (dragAllowedAxises.allowX && dragAllowedAxises.allowY) {
|
344
|
+
$image.addClass('reset-transition');
|
345
|
+
}
|
346
|
+
else if (dragAllowedAxises.allowX &&
|
347
|
+
!dragAllowedAxises.allowY) {
|
348
|
+
$image.addClass('reset-transition-x');
|
349
|
+
}
|
350
|
+
else if (!dragAllowedAxises.allowX &&
|
351
|
+
dragAllowedAxises.allowY) {
|
352
|
+
$image.addClass('reset-transition-y');
|
353
|
+
}
|
354
|
+
}
|
355
|
+
}, ZOOM_TRANSITION_DURATION + 50);
|
356
|
+
};
|
357
|
+
/**
|
358
|
+
* @desc apply scale3d to image and translate to image wrap
|
359
|
+
* @param {style} X,Y and scale
|
360
|
+
*/
|
361
|
+
Zoom.prototype.setZoomStyles = function (style) {
|
362
|
+
var $imageWrap = this.core
|
363
|
+
.getSlideItem(this.core.index)
|
364
|
+
.find('.lg-img-wrap')
|
365
|
+
.first();
|
366
|
+
var $image = this.core
|
367
|
+
.getSlideItem(this.core.index)
|
368
|
+
.find('.lg-image')
|
369
|
+
.first();
|
370
|
+
var $dummyImage = this.core.outer
|
371
|
+
.find('.lg-current .lg-dummy-img')
|
372
|
+
.first();
|
373
|
+
this.scale = style.scale;
|
374
|
+
$image.css('transform', 'scale3d(' + style.scale + ', ' + style.scale + ', 1)');
|
375
|
+
$dummyImage.css('transform', 'scale3d(' + style.scale + ', ' + style.scale + ', 1)');
|
376
|
+
var transform = 'translate3d(' + style.x + 'px, ' + style.y + 'px, 0)';
|
377
|
+
$imageWrap.css('transform', transform);
|
378
|
+
};
|
379
|
+
/**
|
380
|
+
* @param index - Index of the current slide
|
381
|
+
* @param event - event will be available only if the function is called on clicking/taping the imags
|
382
|
+
*/
|
383
|
+
Zoom.prototype.setActualSize = function (index, event) {
|
384
|
+
var _this = this;
|
385
|
+
if (this.zoomInProgress) {
|
386
|
+
return;
|
387
|
+
}
|
388
|
+
this.zoomInProgress = true;
|
389
|
+
var currentItem = this.core.galleryItems[this.core.index];
|
390
|
+
this.resetImageTranslate(index);
|
391
|
+
setTimeout(function () {
|
392
|
+
// Allow zoom only on image
|
393
|
+
if (!currentItem.src ||
|
394
|
+
_this.core.outer.hasClass('lg-first-slide-loading')) {
|
395
|
+
return;
|
396
|
+
}
|
397
|
+
var scale = _this.getCurrentImageActualSizeScale();
|
398
|
+
var prevScale = _this.scale;
|
399
|
+
if (_this.core.outer.hasClass('lg-zoomed')) {
|
400
|
+
_this.scale = 1;
|
401
|
+
}
|
402
|
+
else {
|
403
|
+
_this.scale = _this.getScale(scale);
|
404
|
+
}
|
405
|
+
_this.setPageCords(event);
|
406
|
+
_this.beginZoom(_this.scale);
|
407
|
+
_this.zoomImage(_this.scale, _this.scale - prevScale, true, true);
|
408
|
+
}, 50);
|
409
|
+
setTimeout(function () {
|
410
|
+
_this.core.outer.removeClass('lg-grabbing').addClass('lg-grab');
|
411
|
+
}, 60);
|
412
|
+
setTimeout(function () {
|
413
|
+
_this.zoomInProgress = false;
|
414
|
+
}, ZOOM_TRANSITION_DURATION + 110);
|
415
|
+
};
|
416
|
+
Zoom.prototype.getNaturalWidth = function (index) {
|
417
|
+
var $image = this.core.getSlideItem(index).find('.lg-image').first();
|
418
|
+
var naturalWidth = this.core.galleryItems[index].width;
|
419
|
+
return naturalWidth
|
420
|
+
? parseFloat(naturalWidth)
|
421
|
+
: $image.get().naturalWidth;
|
422
|
+
};
|
423
|
+
Zoom.prototype.getActualSizeScale = function (naturalWidth, width) {
|
424
|
+
var _scale;
|
425
|
+
var scale;
|
426
|
+
if (naturalWidth >= width) {
|
427
|
+
_scale = naturalWidth / width;
|
428
|
+
scale = _scale || 2;
|
429
|
+
}
|
430
|
+
else {
|
431
|
+
scale = 1;
|
432
|
+
}
|
433
|
+
return scale;
|
434
|
+
};
|
435
|
+
Zoom.prototype.getCurrentImageActualSizeScale = function () {
|
436
|
+
var $image = this.core
|
437
|
+
.getSlideItem(this.core.index)
|
438
|
+
.find('.lg-image')
|
439
|
+
.first();
|
440
|
+
var width = $image.get().offsetWidth;
|
441
|
+
var naturalWidth = this.getNaturalWidth(this.core.index) || width;
|
442
|
+
return this.getActualSizeScale(naturalWidth, width);
|
443
|
+
};
|
444
|
+
Zoom.prototype.getPageCords = function (event) {
|
445
|
+
var cords = {};
|
446
|
+
if (event) {
|
447
|
+
cords.x = event.pageX || event.touches[0].pageX;
|
448
|
+
cords.y = event.pageY || event.touches[0].pageY;
|
449
|
+
}
|
450
|
+
else {
|
451
|
+
var containerRect = this.core.$content
|
452
|
+
.get()
|
453
|
+
.getBoundingClientRect();
|
454
|
+
cords.x = containerRect.width / 2 + containerRect.left;
|
455
|
+
cords.y =
|
456
|
+
containerRect.height / 2 + this.scrollTop + containerRect.top;
|
457
|
+
}
|
458
|
+
return cords;
|
459
|
+
};
|
460
|
+
Zoom.prototype.setPageCords = function (event) {
|
461
|
+
var pageCords = this.getPageCords(event);
|
462
|
+
this.pageX = pageCords.x;
|
463
|
+
this.pageY = pageCords.y;
|
464
|
+
};
|
465
|
+
Zoom.prototype.manageActualPixelClassNames = function () {
|
466
|
+
var $actualSize = this.core.getElementById('lg-actual-size');
|
467
|
+
$actualSize
|
468
|
+
.removeClass(this.settings.actualSizeIcons.zoomIn)
|
469
|
+
.addClass(this.settings.actualSizeIcons.zoomOut);
|
470
|
+
};
|
471
|
+
// If true, zoomed - in else zoomed out
|
472
|
+
Zoom.prototype.beginZoom = function (scale) {
|
473
|
+
this.core.outer.removeClass('lg-zoom-drag-transition lg-zoom-dragging');
|
474
|
+
if (scale > 1) {
|
475
|
+
this.core.outer.addClass('lg-zoomed');
|
476
|
+
this.manageActualPixelClassNames();
|
477
|
+
}
|
478
|
+
else {
|
479
|
+
this.resetZoom();
|
480
|
+
}
|
481
|
+
return scale > 1;
|
482
|
+
};
|
483
|
+
Zoom.prototype.getScale = function (scale) {
|
484
|
+
var actualSizeScale = this.getCurrentImageActualSizeScale();
|
485
|
+
if (scale < 1) {
|
486
|
+
scale = 1;
|
487
|
+
}
|
488
|
+
else if (scale > actualSizeScale) {
|
489
|
+
scale = actualSizeScale;
|
490
|
+
}
|
491
|
+
return scale;
|
492
|
+
};
|
493
|
+
Zoom.prototype.init = function () {
|
494
|
+
var _this = this;
|
495
|
+
if (!this.settings.zoom) {
|
496
|
+
return;
|
497
|
+
}
|
498
|
+
this.buildTemplates();
|
499
|
+
this.enableZoomOnSlideItemLoad();
|
500
|
+
var tapped = null;
|
501
|
+
this.core.outer.on('dblclick.lg', function (event) {
|
502
|
+
if (!_this.$LG(event.target).hasClass('lg-image')) {
|
503
|
+
return;
|
504
|
+
}
|
505
|
+
_this.setActualSize(_this.core.index, event);
|
506
|
+
});
|
507
|
+
this.core.outer.on('touchstart.lg', function (event) {
|
508
|
+
var $target = _this.$LG(event.target);
|
509
|
+
if (event.touches.length === 1 && $target.hasClass('lg-image')) {
|
510
|
+
if (!tapped) {
|
511
|
+
tapped = setTimeout(function () {
|
512
|
+
tapped = null;
|
513
|
+
}, 300);
|
514
|
+
}
|
515
|
+
else {
|
516
|
+
clearTimeout(tapped);
|
517
|
+
tapped = null;
|
518
|
+
event.preventDefault();
|
519
|
+
_this.setActualSize(_this.core.index, event);
|
520
|
+
}
|
521
|
+
}
|
522
|
+
});
|
523
|
+
this.core.LGel.on(lGEvents.containerResize + ".zoom " + lGEvents.rotateRight + ".zoom " + lGEvents.rotateLeft + ".zoom " + lGEvents.flipHorizontal + ".zoom " + lGEvents.flipVertical + ".zoom", function () {
|
524
|
+
if (!_this.core.lgOpened ||
|
525
|
+
!_this.isImageSlide(_this.core.index) ||
|
526
|
+
_this.core.touchAction) {
|
527
|
+
return;
|
528
|
+
}
|
529
|
+
var _LGel = _this.core
|
530
|
+
.getSlideItem(_this.core.index)
|
531
|
+
.find('.lg-img-wrap')
|
532
|
+
.first();
|
533
|
+
_this.top = 0;
|
534
|
+
_this.left = 0;
|
535
|
+
_this.setZoomEssentials();
|
536
|
+
_this.setZoomSwipeStyles(_LGel, { x: 0, y: 0 });
|
537
|
+
_this.positionChanged = true;
|
538
|
+
});
|
539
|
+
// Update zoom on resize and orientationchange
|
540
|
+
this.$LG(window).on("scroll.lg.zoom.global" + this.core.lgId, function () {
|
541
|
+
if (!_this.core.lgOpened)
|
542
|
+
return;
|
543
|
+
_this.scrollTop = _this.$LG(window).scrollTop();
|
544
|
+
});
|
545
|
+
this.core.getElementById('lg-zoom-out').on('click.lg', function () {
|
546
|
+
// Allow zoom only on image
|
547
|
+
if (!_this.isImageSlide(_this.core.index)) {
|
548
|
+
return;
|
549
|
+
}
|
550
|
+
var timeout = 0;
|
551
|
+
if (_this.imageReset) {
|
552
|
+
_this.resetImageTranslate(_this.core.index);
|
553
|
+
timeout = 50;
|
554
|
+
}
|
555
|
+
setTimeout(function () {
|
556
|
+
var scale = _this.scale - _this.settings.scale;
|
557
|
+
if (scale < 1) {
|
558
|
+
scale = 1;
|
559
|
+
}
|
560
|
+
_this.beginZoom(scale);
|
561
|
+
_this.zoomImage(scale, -_this.settings.scale, true, !_this.settings.infiniteZoom);
|
562
|
+
}, timeout);
|
563
|
+
});
|
564
|
+
this.core.getElementById('lg-zoom-in').on('click.lg', function () {
|
565
|
+
_this.zoomIn();
|
566
|
+
});
|
567
|
+
this.core.getElementById('lg-actual-size').on('click.lg', function () {
|
568
|
+
_this.setActualSize(_this.core.index);
|
569
|
+
});
|
570
|
+
this.core.LGel.on(lGEvents.beforeOpen + ".zoom", function () {
|
571
|
+
_this.core.outer.find('.lg-item').removeClass('lg-zoomable');
|
572
|
+
});
|
573
|
+
this.core.LGel.on(lGEvents.afterOpen + ".zoom", function () {
|
574
|
+
_this.scrollTop = _this.$LG(window).scrollTop();
|
575
|
+
// Set the initial value center
|
576
|
+
_this.pageX = _this.core.outer.width() / 2;
|
577
|
+
_this.pageY = _this.core.outer.height() / 2 + _this.scrollTop;
|
578
|
+
_this.scale = 1;
|
579
|
+
});
|
580
|
+
// Reset zoom on slide change
|
581
|
+
this.core.LGel.on(lGEvents.afterSlide + ".zoom", function (event) {
|
582
|
+
var prevIndex = event.detail.prevIndex;
|
583
|
+
_this.scale = 1;
|
584
|
+
_this.positionChanged = false;
|
585
|
+
_this.zoomInProgress = false;
|
586
|
+
_this.resetZoom(prevIndex);
|
587
|
+
_this.resetImageTranslate(prevIndex);
|
588
|
+
if (_this.isImageSlide(_this.core.index)) {
|
589
|
+
_this.setZoomEssentials();
|
590
|
+
}
|
591
|
+
});
|
592
|
+
// Drag option after zoom
|
593
|
+
this.zoomDrag();
|
594
|
+
this.pinchZoom();
|
595
|
+
this.zoomSwipe();
|
596
|
+
// Store the zoomable timeout value just to clear it while closing
|
597
|
+
this.zoomableTimeout = false;
|
598
|
+
this.positionChanged = false;
|
599
|
+
this.zoomInProgress = false;
|
600
|
+
};
|
601
|
+
Zoom.prototype.zoomIn = function () {
|
602
|
+
// Allow zoom only on image
|
603
|
+
if (!this.isImageSlide(this.core.index)) {
|
604
|
+
return;
|
605
|
+
}
|
606
|
+
var scale = this.scale + this.settings.scale;
|
607
|
+
if (!this.settings.infiniteZoom) {
|
608
|
+
scale = this.getScale(scale);
|
609
|
+
}
|
610
|
+
this.beginZoom(scale);
|
611
|
+
this.zoomImage(scale, Math.min(this.settings.scale, scale - this.scale), true, !this.settings.infiniteZoom);
|
612
|
+
};
|
613
|
+
// Reset zoom effect
|
614
|
+
Zoom.prototype.resetZoom = function (index) {
|
615
|
+
this.core.outer.removeClass('lg-zoomed lg-zoom-drag-transition');
|
616
|
+
var $actualSize = this.core.getElementById('lg-actual-size');
|
617
|
+
var $item = this.core.getSlideItem(index !== undefined ? index : this.core.index);
|
618
|
+
$actualSize
|
619
|
+
.removeClass(this.settings.actualSizeIcons.zoomOut)
|
620
|
+
.addClass(this.settings.actualSizeIcons.zoomIn);
|
621
|
+
$item.find('.lg-img-wrap').first().removeAttr('style');
|
622
|
+
$item.find('.lg-image').first().removeAttr('style');
|
623
|
+
this.scale = 1;
|
624
|
+
this.left = 0;
|
625
|
+
this.top = 0;
|
626
|
+
// Reset pagx pagy values to center
|
627
|
+
this.setPageCords();
|
628
|
+
};
|
629
|
+
Zoom.prototype.getTouchDistance = function (e) {
|
630
|
+
return Math.sqrt((e.touches[0].pageX - e.touches[1].pageX) *
|
631
|
+
(e.touches[0].pageX - e.touches[1].pageX) +
|
632
|
+
(e.touches[0].pageY - e.touches[1].pageY) *
|
633
|
+
(e.touches[0].pageY - e.touches[1].pageY));
|
634
|
+
};
|
635
|
+
Zoom.prototype.pinchZoom = function () {
|
636
|
+
var _this = this;
|
637
|
+
var startDist = 0;
|
638
|
+
var pinchStarted = false;
|
639
|
+
var initScale = 1;
|
640
|
+
var prevScale = 0;
|
641
|
+
var $item = this.core.getSlideItem(this.core.index);
|
642
|
+
this.core.outer.on('touchstart.lg', function (e) {
|
643
|
+
$item = _this.core.getSlideItem(_this.core.index);
|
644
|
+
if (!_this.isImageSlide(_this.core.index)) {
|
645
|
+
return;
|
646
|
+
}
|
647
|
+
if (e.touches.length === 2) {
|
648
|
+
e.preventDefault();
|
649
|
+
if (_this.core.outer.hasClass('lg-first-slide-loading')) {
|
650
|
+
return;
|
651
|
+
}
|
652
|
+
initScale = _this.scale || 1;
|
653
|
+
_this.core.outer.removeClass('lg-zoom-drag-transition lg-zoom-dragging');
|
654
|
+
_this.setPageCords(e);
|
655
|
+
_this.resetImageTranslate(_this.core.index);
|
656
|
+
_this.core.touchAction = 'pinch';
|
657
|
+
startDist = _this.getTouchDistance(e);
|
658
|
+
}
|
659
|
+
});
|
660
|
+
this.core.$inner.on('touchmove.lg', function (e) {
|
661
|
+
if (e.touches.length === 2 &&
|
662
|
+
_this.core.touchAction === 'pinch' &&
|
663
|
+
(_this.$LG(e.target).hasClass('lg-item') ||
|
664
|
+
$item.get().contains(e.target))) {
|
665
|
+
e.preventDefault();
|
666
|
+
var endDist = _this.getTouchDistance(e);
|
667
|
+
var distance = startDist - endDist;
|
668
|
+
if (!pinchStarted && Math.abs(distance) > 5) {
|
669
|
+
pinchStarted = true;
|
670
|
+
}
|
671
|
+
if (pinchStarted) {
|
672
|
+
prevScale = _this.scale;
|
673
|
+
var _scale = Math.max(1, initScale + -distance * 0.02);
|
674
|
+
_this.scale =
|
675
|
+
Math.round((_scale + Number.EPSILON) * 100) / 100;
|
676
|
+
var diff = _this.scale - prevScale;
|
677
|
+
_this.zoomImage(_this.scale, Math.round((diff + Number.EPSILON) * 100) / 100, false, false);
|
678
|
+
}
|
679
|
+
}
|
680
|
+
});
|
681
|
+
this.core.$inner.on('touchend.lg', function (e) {
|
682
|
+
if (_this.core.touchAction === 'pinch' &&
|
683
|
+
(_this.$LG(e.target).hasClass('lg-item') ||
|
684
|
+
$item.get().contains(e.target))) {
|
685
|
+
pinchStarted = false;
|
686
|
+
startDist = 0;
|
687
|
+
if (_this.scale <= 1) {
|
688
|
+
_this.resetZoom();
|
689
|
+
}
|
690
|
+
else {
|
691
|
+
var actualSizeScale = _this.getCurrentImageActualSizeScale();
|
692
|
+
if (_this.scale >= actualSizeScale) {
|
693
|
+
var scaleDiff = actualSizeScale - _this.scale;
|
694
|
+
if (scaleDiff === 0) {
|
695
|
+
scaleDiff = 0.01;
|
696
|
+
}
|
697
|
+
_this.zoomImage(actualSizeScale, scaleDiff, false, true);
|
698
|
+
}
|
699
|
+
_this.manageActualPixelClassNames();
|
700
|
+
_this.core.outer.addClass('lg-zoomed');
|
701
|
+
}
|
702
|
+
_this.core.touchAction = undefined;
|
703
|
+
}
|
704
|
+
});
|
705
|
+
};
|
706
|
+
Zoom.prototype.touchendZoom = function (startCoords, endCoords, allowX, allowY, touchDuration) {
|
707
|
+
var distanceXnew = endCoords.x - startCoords.x;
|
708
|
+
var distanceYnew = endCoords.y - startCoords.y;
|
709
|
+
var speedX = Math.abs(distanceXnew) / touchDuration + 1;
|
710
|
+
var speedY = Math.abs(distanceYnew) / touchDuration + 1;
|
711
|
+
if (speedX > 2) {
|
712
|
+
speedX += 1;
|
713
|
+
}
|
714
|
+
if (speedY > 2) {
|
715
|
+
speedY += 1;
|
716
|
+
}
|
717
|
+
distanceXnew = distanceXnew * speedX;
|
718
|
+
distanceYnew = distanceYnew * speedY;
|
719
|
+
var _LGel = this.core
|
720
|
+
.getSlideItem(this.core.index)
|
721
|
+
.find('.lg-img-wrap')
|
722
|
+
.first();
|
723
|
+
var distance = {};
|
724
|
+
distance.x = this.left + distanceXnew;
|
725
|
+
distance.y = this.top + distanceYnew;
|
726
|
+
var possibleSwipeCords = this.getPossibleSwipeDragCords();
|
727
|
+
if (Math.abs(distanceXnew) > 15 || Math.abs(distanceYnew) > 15) {
|
728
|
+
if (allowY) {
|
729
|
+
if (this.isBeyondPossibleTop(distance.y, possibleSwipeCords.minY)) {
|
730
|
+
distance.y = possibleSwipeCords.minY;
|
731
|
+
}
|
732
|
+
else if (this.isBeyondPossibleBottom(distance.y, possibleSwipeCords.maxY)) {
|
733
|
+
distance.y = possibleSwipeCords.maxY;
|
734
|
+
}
|
735
|
+
}
|
736
|
+
if (allowX) {
|
737
|
+
if (this.isBeyondPossibleLeft(distance.x, possibleSwipeCords.minX)) {
|
738
|
+
distance.x = possibleSwipeCords.minX;
|
739
|
+
}
|
740
|
+
else if (this.isBeyondPossibleRight(distance.x, possibleSwipeCords.maxX)) {
|
741
|
+
distance.x = possibleSwipeCords.maxX;
|
742
|
+
}
|
743
|
+
}
|
744
|
+
if (allowY) {
|
745
|
+
this.top = distance.y;
|
746
|
+
}
|
747
|
+
else {
|
748
|
+
distance.y = this.top;
|
749
|
+
}
|
750
|
+
if (allowX) {
|
751
|
+
this.left = distance.x;
|
752
|
+
}
|
753
|
+
else {
|
754
|
+
distance.x = this.left;
|
755
|
+
}
|
756
|
+
this.setZoomSwipeStyles(_LGel, distance);
|
757
|
+
this.positionChanged = true;
|
758
|
+
}
|
759
|
+
};
|
760
|
+
Zoom.prototype.getZoomSwipeCords = function (startCoords, endCoords, allowX, allowY, possibleSwipeCords) {
|
761
|
+
var distance = {};
|
762
|
+
if (allowY) {
|
763
|
+
distance.y = this.top + (endCoords.y - startCoords.y);
|
764
|
+
if (this.isBeyondPossibleTop(distance.y, possibleSwipeCords.minY)) {
|
765
|
+
var diffMinY = possibleSwipeCords.minY - distance.y;
|
766
|
+
distance.y = possibleSwipeCords.minY - diffMinY / 6;
|
767
|
+
}
|
768
|
+
else if (this.isBeyondPossibleBottom(distance.y, possibleSwipeCords.maxY)) {
|
769
|
+
var diffMaxY = distance.y - possibleSwipeCords.maxY;
|
770
|
+
distance.y = possibleSwipeCords.maxY + diffMaxY / 6;
|
771
|
+
}
|
772
|
+
}
|
773
|
+
else {
|
774
|
+
distance.y = this.top;
|
775
|
+
}
|
776
|
+
if (allowX) {
|
777
|
+
distance.x = this.left + (endCoords.x - startCoords.x);
|
778
|
+
if (this.isBeyondPossibleLeft(distance.x, possibleSwipeCords.minX)) {
|
779
|
+
var diffMinX = possibleSwipeCords.minX - distance.x;
|
780
|
+
distance.x = possibleSwipeCords.minX - diffMinX / 6;
|
781
|
+
}
|
782
|
+
else if (this.isBeyondPossibleRight(distance.x, possibleSwipeCords.maxX)) {
|
783
|
+
var difMaxX = distance.x - possibleSwipeCords.maxX;
|
784
|
+
distance.x = possibleSwipeCords.maxX + difMaxX / 6;
|
785
|
+
}
|
786
|
+
}
|
787
|
+
else {
|
788
|
+
distance.x = this.left;
|
789
|
+
}
|
790
|
+
return distance;
|
791
|
+
};
|
792
|
+
Zoom.prototype.isBeyondPossibleLeft = function (x, minX) {
|
793
|
+
return x >= minX;
|
794
|
+
};
|
795
|
+
Zoom.prototype.isBeyondPossibleRight = function (x, maxX) {
|
796
|
+
return x <= maxX;
|
797
|
+
};
|
798
|
+
Zoom.prototype.isBeyondPossibleTop = function (y, minY) {
|
799
|
+
return y >= minY;
|
800
|
+
};
|
801
|
+
Zoom.prototype.isBeyondPossibleBottom = function (y, maxY) {
|
802
|
+
return y <= maxY;
|
803
|
+
};
|
804
|
+
Zoom.prototype.isImageSlide = function (index) {
|
805
|
+
var currentItem = this.core.galleryItems[index];
|
806
|
+
return this.core.getSlideType(currentItem) === 'image';
|
807
|
+
};
|
808
|
+
Zoom.prototype.getPossibleSwipeDragCords = function (scale) {
|
809
|
+
var $image = this.core
|
810
|
+
.getSlideItem(this.core.index)
|
811
|
+
.find('.lg-image')
|
812
|
+
.first();
|
813
|
+
var bottom = this.core.mediaContainerPosition.bottom;
|
814
|
+
var imgRect = $image.get().getBoundingClientRect();
|
815
|
+
var imageHeight = imgRect.height;
|
816
|
+
var imageWidth = imgRect.width;
|
817
|
+
if (scale) {
|
818
|
+
imageHeight = imageHeight + scale * imageHeight;
|
819
|
+
imageWidth = imageWidth + scale * imageWidth;
|
820
|
+
}
|
821
|
+
var minY = (imageHeight - this.containerRect.height) / 2;
|
822
|
+
var maxY = (this.containerRect.height - imageHeight) / 2 + bottom;
|
823
|
+
var minX = (imageWidth - this.containerRect.width) / 2;
|
824
|
+
var maxX = (this.containerRect.width - imageWidth) / 2;
|
825
|
+
var possibleSwipeCords = {
|
826
|
+
minY: minY,
|
827
|
+
maxY: maxY,
|
828
|
+
minX: minX,
|
829
|
+
maxX: maxX,
|
830
|
+
};
|
831
|
+
return possibleSwipeCords;
|
832
|
+
};
|
833
|
+
Zoom.prototype.setZoomSwipeStyles = function (LGel, distance) {
|
834
|
+
LGel.css('transform', 'translate3d(' + distance.x + 'px, ' + distance.y + 'px, 0)');
|
835
|
+
};
|
836
|
+
Zoom.prototype.zoomSwipe = function () {
|
837
|
+
var _this = this;
|
838
|
+
var startCoords = {};
|
839
|
+
var endCoords = {};
|
840
|
+
var isMoved = false;
|
841
|
+
// Allow x direction drag
|
842
|
+
var allowX = false;
|
843
|
+
// Allow Y direction drag
|
844
|
+
var allowY = false;
|
845
|
+
var startTime = new Date();
|
846
|
+
var endTime = new Date();
|
847
|
+
var possibleSwipeCords;
|
848
|
+
var _LGel;
|
849
|
+
var $item = this.core.getSlideItem(this.core.index);
|
850
|
+
this.core.$inner.on('touchstart.lg', function (e) {
|
851
|
+
// Allow zoom only on image
|
852
|
+
if (!_this.isImageSlide(_this.core.index)) {
|
853
|
+
return;
|
854
|
+
}
|
855
|
+
$item = _this.core.getSlideItem(_this.core.index);
|
856
|
+
if ((_this.$LG(e.target).hasClass('lg-item') ||
|
857
|
+
$item.get().contains(e.target)) &&
|
858
|
+
e.touches.length === 1 &&
|
859
|
+
_this.core.outer.hasClass('lg-zoomed')) {
|
860
|
+
e.preventDefault();
|
861
|
+
startTime = new Date();
|
862
|
+
_this.core.touchAction = 'zoomSwipe';
|
863
|
+
_LGel = _this.core
|
864
|
+
.getSlideItem(_this.core.index)
|
865
|
+
.find('.lg-img-wrap')
|
866
|
+
.first();
|
867
|
+
var dragAllowedAxises = _this.getDragAllowedAxises(0);
|
868
|
+
allowY = dragAllowedAxises.allowY;
|
869
|
+
allowX = dragAllowedAxises.allowX;
|
870
|
+
if (allowX || allowY) {
|
871
|
+
startCoords = _this.getSwipeCords(e);
|
872
|
+
}
|
873
|
+
possibleSwipeCords = _this.getPossibleSwipeDragCords();
|
874
|
+
// reset opacity and transition duration
|
875
|
+
_this.core.outer.addClass('lg-zoom-dragging lg-zoom-drag-transition');
|
876
|
+
}
|
877
|
+
});
|
878
|
+
this.core.$inner.on('touchmove.lg', function (e) {
|
879
|
+
if (e.touches.length === 1 &&
|
880
|
+
_this.core.touchAction === 'zoomSwipe' &&
|
881
|
+
(_this.$LG(e.target).hasClass('lg-item') ||
|
882
|
+
$item.get().contains(e.target))) {
|
883
|
+
e.preventDefault();
|
884
|
+
_this.core.touchAction = 'zoomSwipe';
|
885
|
+
endCoords = _this.getSwipeCords(e);
|
886
|
+
var distance = _this.getZoomSwipeCords(startCoords, endCoords, allowX, allowY, possibleSwipeCords);
|
887
|
+
if (Math.abs(endCoords.x - startCoords.x) > 15 ||
|
888
|
+
Math.abs(endCoords.y - startCoords.y) > 15) {
|
889
|
+
isMoved = true;
|
890
|
+
_this.setZoomSwipeStyles(_LGel, distance);
|
891
|
+
}
|
892
|
+
}
|
893
|
+
});
|
894
|
+
this.core.$inner.on('touchend.lg', function (e) {
|
895
|
+
if (_this.core.touchAction === 'zoomSwipe' &&
|
896
|
+
(_this.$LG(e.target).hasClass('lg-item') ||
|
897
|
+
$item.get().contains(e.target))) {
|
898
|
+
e.preventDefault();
|
899
|
+
_this.core.touchAction = undefined;
|
900
|
+
_this.core.outer.removeClass('lg-zoom-dragging');
|
901
|
+
if (!isMoved) {
|
902
|
+
return;
|
903
|
+
}
|
904
|
+
isMoved = false;
|
905
|
+
endTime = new Date();
|
906
|
+
var touchDuration = endTime.valueOf() - startTime.valueOf();
|
907
|
+
_this.touchendZoom(startCoords, endCoords, allowX, allowY, touchDuration);
|
908
|
+
}
|
909
|
+
});
|
910
|
+
};
|
911
|
+
Zoom.prototype.zoomDrag = function () {
|
912
|
+
var _this = this;
|
913
|
+
var startCoords = {};
|
914
|
+
var endCoords = {};
|
915
|
+
var isDragging = false;
|
916
|
+
var isMoved = false;
|
917
|
+
// Allow x direction drag
|
918
|
+
var allowX = false;
|
919
|
+
// Allow Y direction drag
|
920
|
+
var allowY = false;
|
921
|
+
var startTime;
|
922
|
+
var endTime;
|
923
|
+
var possibleSwipeCords;
|
924
|
+
var _LGel;
|
925
|
+
this.core.outer.on('mousedown.lg.zoom', function (e) {
|
926
|
+
// Allow zoom only on image
|
927
|
+
if (!_this.isImageSlide(_this.core.index)) {
|
928
|
+
return;
|
929
|
+
}
|
930
|
+
var $item = _this.core.getSlideItem(_this.core.index);
|
931
|
+
if (_this.$LG(e.target).hasClass('lg-item') ||
|
932
|
+
$item.get().contains(e.target)) {
|
933
|
+
startTime = new Date();
|
934
|
+
_LGel = _this.core
|
935
|
+
.getSlideItem(_this.core.index)
|
936
|
+
.find('.lg-img-wrap')
|
937
|
+
.first();
|
938
|
+
var dragAllowedAxises = _this.getDragAllowedAxises(0);
|
939
|
+
allowY = dragAllowedAxises.allowY;
|
940
|
+
allowX = dragAllowedAxises.allowX;
|
941
|
+
if (_this.core.outer.hasClass('lg-zoomed')) {
|
942
|
+
if (_this.$LG(e.target).hasClass('lg-object') &&
|
943
|
+
(allowX || allowY)) {
|
944
|
+
e.preventDefault();
|
945
|
+
startCoords = _this.getDragCords(e);
|
946
|
+
possibleSwipeCords = _this.getPossibleSwipeDragCords();
|
947
|
+
isDragging = true;
|
948
|
+
_this.core.outer
|
949
|
+
.removeClass('lg-grab')
|
950
|
+
.addClass('lg-grabbing lg-zoom-drag-transition lg-zoom-dragging');
|
951
|
+
// reset opacity and transition duration
|
952
|
+
}
|
953
|
+
}
|
954
|
+
}
|
955
|
+
});
|
956
|
+
this.$LG(window).on("mousemove.lg.zoom.global" + this.core.lgId, function (e) {
|
957
|
+
if (isDragging) {
|
958
|
+
isMoved = true;
|
959
|
+
endCoords = _this.getDragCords(e);
|
960
|
+
var distance = _this.getZoomSwipeCords(startCoords, endCoords, allowX, allowY, possibleSwipeCords);
|
961
|
+
_this.setZoomSwipeStyles(_LGel, distance);
|
962
|
+
}
|
963
|
+
});
|
964
|
+
this.$LG(window).on("mouseup.lg.zoom.global" + this.core.lgId, function (e) {
|
965
|
+
if (isDragging) {
|
966
|
+
endTime = new Date();
|
967
|
+
isDragging = false;
|
968
|
+
_this.core.outer.removeClass('lg-zoom-dragging');
|
969
|
+
// Fix for chrome mouse move on click
|
970
|
+
if (isMoved &&
|
971
|
+
(startCoords.x !== endCoords.x ||
|
972
|
+
startCoords.y !== endCoords.y)) {
|
973
|
+
endCoords = _this.getDragCords(e);
|
974
|
+
var touchDuration = endTime.valueOf() - startTime.valueOf();
|
975
|
+
_this.touchendZoom(startCoords, endCoords, allowX, allowY, touchDuration);
|
976
|
+
}
|
977
|
+
isMoved = false;
|
978
|
+
}
|
979
|
+
_this.core.outer.removeClass('lg-grabbing').addClass('lg-grab');
|
980
|
+
});
|
981
|
+
};
|
982
|
+
Zoom.prototype.closeGallery = function () {
|
983
|
+
this.resetZoom();
|
984
|
+
this.zoomInProgress = false;
|
985
|
+
};
|
986
|
+
Zoom.prototype.destroy = function () {
|
987
|
+
// Unbind all events added by lightGallery zoom plugin
|
988
|
+
this.$LG(window).off(".lg.zoom.global" + this.core.lgId);
|
989
|
+
this.core.LGel.off('.lg.zoom');
|
990
|
+
this.core.LGel.off('.zoom');
|
991
|
+
clearTimeout(this.zoomableTimeout);
|
992
|
+
this.zoomableTimeout = false;
|
993
|
+
};
|
994
|
+
return Zoom;
|
995
|
+
}());
|
996
|
+
|
997
|
+
return Zoom;
|
998
|
+
|
999
|
+
})));
|