j1-template 2024.3.16 → 2024.3.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_includes/themes/j1/layouts/content_generator_collection.html +1 -1
- data/_includes/themes/j1/layouts/content_generator_news_panel_posts.html +1 -1
- data/_includes/themes/j1/layouts/content_generator_page.html +1 -1
- data/_includes/themes/j1/layouts/content_generator_post.html +1 -1
- data/_includes/themes/j1/layouts/content_generator_raw.html +1 -1
- data/_includes/themes/j1/layouts/layout_metadata_generator.html +1 -1
- data/_includes/themes/j1/layouts/layout_module_generator.html +1 -1
- data/_includes/themes/j1/layouts/layout_resource_generator.html +1 -1
- data/_includes/themes/j1/modules/attics/generator.html +1 -1
- data/_includes/themes/j1/modules/navigator/generator.html +1 -1
- data/_includes/themes/j1/modules/searcher/generator.html +1 -1
- data/_includes/themes/j1/modules/searcher/procedures/topsearch.proc +1 -1
- data/_includes/themes/j1/procedures/blocks/footer/boxes/about_box.proc +1 -1
- data/_includes/themes/j1/procedures/blocks/footer/boxes/contacts_box.proc +1 -1
- data/_includes/themes/j1/procedures/blocks/footer/boxes/issue.proc +1 -1
- data/_includes/themes/j1/procedures/blocks/footer/boxes/legal_statements.proc +1 -1
- data/_includes/themes/j1/procedures/blocks/footer/boxes/links_box.proc +1 -1
- data/_includes/themes/j1/procedures/blocks/footer/boxes/news_box.proc +1 -1
- data/_includes/themes/j1/procedures/blocks/footer/boxes/social_media_icons.proc +1 -1
- data/_includes/themes/j1/procedures/blocks/get_wave.proc +1 -1
- data/_includes/themes/j1/procedures/collections/create_collection_article_preview.proc +1 -1
- data/_includes/themes/j1/procedures/collections/pager.proc +1 -1
- data/_includes/themes/j1/procedures/global/attributes_loader.proc +1 -1
- data/_includes/themes/j1/procedures/global/collect_frontmatter_options.proc +1 -1
- data/_includes/themes/j1/procedures/global/collect_page_options.proc +1 -1
- data/_includes/themes/j1/procedures/global/create_bs_button.proc +1 -1
- data/_includes/themes/j1/procedures/global/create_word_cloud.proc +1 -1
- data/_includes/themes/j1/procedures/global/date-german.proc +1 -1
- data/_includes/themes/j1/procedures/global/get_category.proc +1 -1
- data/_includes/themes/j1/procedures/global/get_category_item.proc +1 -1
- data/_includes/themes/j1/procedures/global/get_documents_dir.proc +1 -1
- data/_includes/themes/j1/procedures/global/get_page_path.proc +1 -1
- data/_includes/themes/j1/procedures/global/get_page_url.proc +1 -1
- data/_includes/themes/j1/procedures/global/select_color.proc +1 -1
- data/_includes/themes/j1/procedures/global/select_font_size.proc +1 -1
- data/_includes/themes/j1/procedures/global/select_icon_size.proc +1 -1
- data/_includes/themes/j1/procedures/global/select_location.proc +1 -1
- data/_includes/themes/j1/procedures/global/set_base_vars_folders.proc +1 -1
- data/_includes/themes/j1/procedures/global/set_env_entry_document.proc +1 -1
- data/_includes/themes/j1/procedures/global/set_image_block.proc +1 -1
- data/_includes/themes/j1/procedures/global/setup.proc +1 -1
- data/_includes/themes/j1/procedures/layouts/content_writer.proc +1 -1
- data/_includes/themes/j1/procedures/layouts/default_writer.proc +1 -1
- data/_includes/themes/j1/procedures/layouts/module_writer.proc +1 -1
- data/_includes/themes/j1/procedures/layouts/resource_writer.proc +1 -1
- data/_includes/themes/j1/procedures/posts/collate_calendar.proc +1 -1
- data/_includes/themes/j1/procedures/posts/collate_list.proc +1 -1
- data/_includes/themes/j1/procedures/posts/collate_timeline.proc +1 -1
- data/_includes/themes/j1/procedures/posts/create_ad_block.proc +1 -1
- data/_includes/themes/j1/procedures/posts/create_series_header.proc +1 -1
- data/_includes/themes/j1/procedures/posts/pager.proc +1 -1
- data/_layouts/autopage_category.html +1 -1
- data/_layouts/autopage_collection.html +1 -1
- data/_layouts/autopage_collections_tags.html +1 -1
- data/_layouts/autopage_tags.html +1 -1
- data/_layouts/collection.html +1 -1
- data/_layouts/compress.html +1 -1
- data/_layouts/default.html +1 -1
- data/_layouts/home.html +1 -1
- data/_layouts/news_panel_posts.html +1 -1
- data/_layouts/page.html +1 -1
- data/_layouts/post.html +1 -1
- data/_layouts/raw.html +1 -1
- data/apps/public/cc/cc.yml +1 -1
- data/assets/data/amplitude.html +137 -66
- data/assets/data/authclient.html +1 -1
- data/assets/data/banner.html +2 -2
- data/assets/data/carousel.json +1 -1
- data/assets/data/cookieconsent.html +2 -2
- data/assets/data/docsearch.html +2 -2
- data/assets/data/fab.html +2 -2
- data/assets/data/footer.html +2 -2
- data/assets/data/galeries.html +2 -2
- data/assets/data/gallery_customizer.html +2 -2
- data/assets/data/gemini-ui.html +2 -2
- data/assets/data/iframes.html +2 -2
- data/assets/data/iso-3166-country-codes.json +1 -1
- data/assets/data/iso-639-language-codes.json +1 -1
- data/assets/data/j1_config.json +1 -1
- data/assets/data/masonry.html +2 -2
- data/assets/data/masterslider.html +2 -2
- data/assets/data/mdi_icons.json +1 -1
- data/assets/data/mdil_icons.json +1 -1
- data/assets/data/menu.html +2 -2
- data/assets/data/mmenu.html +2 -2
- data/assets/data/mmenu_sidebar.html +2 -2
- data/assets/data/mmenu_toc.html +2 -2
- data/assets/data/panel.html +2 -2
- data/assets/data/particles.yml +1 -1
- data/assets/data/private.json +1 -1
- data/assets/data/quicklinks.html +2 -2
- data/assets/data/rtext_resizer.html +2 -2
- data/assets/data/slick.html +2 -2
- data/assets/data/speak2me.html +2 -2
- data/assets/data/swiper.html +244 -0
- data/assets/data/swiper.json +84 -0
- data/assets/data/themes.bootswatch.json +1 -1
- data/assets/data/themes.json +1 -1
- data/assets/data/translator.html +1 -1
- data/assets/error_pages/HTTP204.html +1 -1
- data/assets/error_pages/HTTP400.html +1 -1
- data/assets/error_pages/HTTP401.html +1 -1
- data/assets/error_pages/HTTP403.html +1 -1
- data/assets/error_pages/HTTP404.html +1 -1
- data/assets/error_pages/HTTP444.html +1 -1
- data/assets/error_pages/HTTP445.html +1 -1
- data/assets/error_pages/HTTP446.html +1 -1
- data/assets/error_pages/HTTP447.html +1 -1
- data/assets/error_pages/HTTP448.html +1 -1
- data/assets/error_pages/HTTP500.html +1 -1
- data/assets/error_pages/HTTP501.html +1 -1
- data/assets/error_pages/HTTP502.html +1 -1
- data/assets/error_pages/HTTP503.html +1 -1
- data/assets/theme/j1/adapter/js/advertising.js +2 -2
- data/assets/theme/j1/adapter/js/algolia.js +2 -2
- data/assets/theme/j1/adapter/js/amplitude.30.js +1177 -0
- data/assets/theme/j1/adapter/js/amplitude.js +165 -132
- data/assets/theme/j1/adapter/js/analytics.js +2 -2
- data/assets/theme/j1/adapter/js/asciidoctor.js +2 -2
- data/assets/theme/j1/adapter/js/attic.js +2 -2
- data/assets/theme/j1/adapter/js/bmd.js +2 -2
- data/assets/theme/j1/adapter/js/carousel.js +2 -2
- data/assets/theme/j1/adapter/js/chatbot.js +2 -2
- data/assets/theme/j1/adapter/js/clipboard.js +2 -2
- data/assets/theme/j1/adapter/js/comments.js +2 -2
- data/assets/theme/j1/adapter/js/cookieConsent.js +2 -2
- data/assets/theme/j1/adapter/js/customFunctions.js +2 -2
- data/assets/theme/j1/adapter/js/customModule.js +2 -2
- data/assets/theme/j1/adapter/js/docsearch.js +2 -2
- data/assets/theme/j1/adapter/js/dropdowns.js +2 -2
- data/assets/theme/j1/adapter/js/fab.js +2 -2
- data/assets/theme/j1/adapter/js/gallery.js +2 -2
- data/assets/theme/j1/adapter/js/gemini.js +2 -2
- data/assets/theme/j1/adapter/js/iconPicker.js +2 -2
- data/assets/theme/j1/adapter/js/iconPickerPage.js +2 -2
- data/assets/theme/j1/adapter/js/iframer.js +2 -2
- data/assets/theme/j1/adapter/js/j1.js +5 -5
- data/assets/theme/j1/adapter/js/lazyLoader.js +2 -2
- data/assets/theme/j1/adapter/js/lightbox.js +2 -2
- data/assets/theme/j1/adapter/js/logger.js +2 -2
- data/assets/theme/j1/adapter/js/lunr.js +2 -2
- data/assets/theme/j1/adapter/js/masonry.js +2 -2
- data/assets/theme/j1/adapter/js/masterslider.js +4 -3
- data/assets/theme/j1/adapter/js/mmenu.js +2 -2
- data/assets/theme/j1/adapter/js/navigator.js +2 -2
- data/assets/theme/j1/adapter/js/particles.js +2 -2
- data/assets/theme/j1/adapter/js/rangeSlider.js +2 -2
- data/assets/theme/j1/adapter/js/rouge.js +2 -2
- data/assets/theme/j1/adapter/js/rtable.js +2 -2
- data/assets/theme/j1/adapter/js/rtextResizer.js +2 -2
- data/assets/theme/j1/adapter/js/scroller.js +2 -2
- data/assets/theme/j1/adapter/js/slick.js +2 -2
- data/assets/theme/j1/adapter/js/slimSelect.js +2 -2
- data/assets/theme/j1/adapter/js/speak2me.js +2 -2
- data/assets/theme/j1/adapter/js/swiper.js +503 -0
- data/assets/theme/j1/adapter/js/themeToggler.js +2 -2
- data/assets/theme/j1/adapter/js/themes.js +2 -2
- data/assets/theme/j1/adapter/js/toccer.js +2 -2
- data/assets/theme/j1/adapter/js/translator.js +2 -2
- data/assets/theme/j1/adapter/js/videojs.js +2 -2
- data/assets/theme/j1/adapter/js/waves.js +2 -2
- data/assets/theme/j1/core/country-flags/css/theme/uno.css +1 -1
- data/assets/theme/j1/core/country-flags/css/theme/uno.min.css +1 -1
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/amplitude.css +14 -4
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/amplitude.min.css +2 -2
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/compact.css +1 -1
- 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 +54 -7
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/large.min.css +3 -2
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/mini.css +1 -1
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/mini.min.css +1 -1
- data/assets/theme/j1/modules/amplitudejs/js/amplitude.js +1 -1
- data/assets/theme/j1/modules/amplitudejs/js/amplitude.map +1 -1
- data/assets/theme/j1/modules/amplitudejs/js/amplitude.min.js +1 -1
- data/assets/theme/j1/modules/amplitudejs/js/tech/ytp.js +1621 -90
- data/assets/theme/j1/modules/amplitudejs/js/tech/ytp.min.js +14 -0
- data/assets/theme/j1/modules/amplitudejs/js/visualizations/bar.js +2 -2
- data/assets/theme/j1/modules/amplitudejs/js/visualizations/bar.min.js +1 -1
- data/assets/theme/j1/modules/amplitudejs/js/visualizations/circular-equalizer.js +32 -2
- data/assets/theme/j1/modules/amplitudejs/js/visualizations/circular-equalizer.min.js +1 -1
- data/assets/theme/j1/modules/amplitudejs/js/visualizations/frequency-analyzer.js +2 -2
- data/assets/theme/j1/modules/amplitudejs/js/visualizations/frequency-analyzer.min.js +1 -1
- data/assets/theme/j1/modules/amplitudejs/js/visualizations/michael-bromley.js +2 -2
- data/assets/theme/j1/modules/amplitudejs/js/visualizations/michael-bromley.min.js +1 -1
- data/assets/theme/j1/modules/amplitudejs/js/visualizations/template.js +2 -2
- data/assets/theme/j1/modules/amplitudejs/js/visualizations/template.min.js +1 -1
- data/assets/theme/j1/modules/amplitudejs/scss/theme/uno/dark/amplitude.scss +1 -1
- data/assets/theme/j1/modules/amplitudejs/scss/theme/uno/dark/player/compact.scss +1 -1
- data/assets/theme/j1/modules/amplitudejs/scss/theme/uno/dark/player/large.scss +1 -1
- data/assets/theme/j1/modules/amplitudejs/scss/theme/uno/dark/player/mini.scss +1 -1
- data/assets/theme/j1/modules/backstretch/js/backstretch.js +1 -1
- data/assets/theme/j1/modules/backstretch/js/backstretch.min.js +1 -1
- data/assets/theme/j1/modules/bmd/js/bmd.js +1 -1
- data/assets/theme/j1/modules/bmd/js/bmd.min.js +1 -1
- data/assets/theme/j1/modules/carousel/css/carousel.css +1 -1
- data/assets/theme/j1/modules/carousel/css/carousel.min.css +1 -1
- data/assets/theme/j1/modules/carousel/css/carousel_transitions.css +1 -1
- data/assets/theme/j1/modules/carousel/css/carousel_transitions.min.css +1 -1
- data/assets/theme/j1/modules/carousel/css/theme/uno.css +1 -1
- data/assets/theme/j1/modules/carousel/css/theme/uno.min.css +1 -1
- data/assets/theme/j1/modules/chatbot/css/theme/uno.css +1 -1
- data/assets/theme/j1/modules/chatbot/css/theme/uno.min.css +1 -1
- data/assets/theme/j1/modules/clipboard/css/theme/uno.css +1 -1
- data/assets/theme/j1/modules/clipboard/css/theme/uno.min.css +1 -1
- data/assets/theme/j1/modules/cookieConsent/js/cookieConsent.js +1 -1
- data/assets/theme/j1/modules/cookieConsent/js/cookieConsent.min.js +1 -1
- data/assets/theme/j1/modules/dropdowns/css/theme/uno/dropdowns.css +1 -1
- data/assets/theme/j1/modules/dropdowns/css/theme/uno/dropdowns.min.css +1 -1
- data/assets/theme/j1/modules/dropdowns/js/cash.js +1 -1
- data/assets/theme/j1/modules/dropdowns/js/cash.min.js +1 -1
- data/assets/theme/j1/modules/dropdowns/js/dropdowns.js +1 -1
- data/assets/theme/j1/modules/dropdowns/js/dropdowns.min.js +1 -1
- data/assets/theme/j1/modules/fab/js/cash.js +1 -1
- data/assets/theme/j1/modules/fab/js/cash.min.js +1 -1
- data/assets/theme/j1/modules/fab/js/fab.js +1 -1
- data/assets/theme/j1/modules/fab/js/fab.min.js +1 -1
- data/assets/theme/j1/modules/gemini/css/theme/uno.css +1 -1
- data/assets/theme/j1/modules/gemini/css/theme/uno.min.css +1 -1
- data/assets/theme/j1/modules/gemini/js/gemini.js +1 -1
- data/assets/theme/j1/modules/gemini/js/gemini.min.js +1 -1
- data/assets/theme/j1/modules/iconPicker/css/theme/uno.css +1 -1
- data/assets/theme/j1/modules/iconPicker/css/theme/uno.min.css +1 -1
- data/assets/theme/j1/modules/iconPicker/css/universal-icon-picker.css +1 -1
- data/assets/theme/j1/modules/iconPicker/css/universal-icon-picker.min.css +1 -1
- data/assets/theme/j1/modules/iconPicker/js/universal-icon-picker.js +1 -1
- data/assets/theme/j1/modules/iconPicker/js/universal-icon-picker.min.js +1 -1
- data/assets/theme/j1/modules/j1LazyLoader/LICENSE +1 -1
- data/assets/theme/j1/modules/jquery/js/extensions/hasClass.js +1 -1
- data/assets/theme/j1/modules/jquery/js/extensions/hasClass.min.js +1 -1
- data/assets/theme/j1/modules/jquery/js/extensions/removeClass.js +1 -1
- data/assets/theme/j1/modules/jquery/js/extensions/removeClass.min.js +1 -1
- data/assets/theme/j1/modules/justifiedGallery/css/justifiedGallery.css +1 -1
- data/assets/theme/j1/modules/justifiedGallery/css/justifiedGallery.min.css +1 -1
- data/assets/theme/j1/modules/justifiedGallery/css/theme/uno.css +1 -1
- data/assets/theme/j1/modules/justifiedGallery/css/theme/uno.min.css +1 -1
- data/assets/theme/j1/modules/lazyCssLoader/js/main.0.js +1 -1
- data/assets/theme/j1/modules/lazyCssLoader/js/main.1.js +1 -1
- data/assets/theme/j1/modules/lazyCssLoader/js/main.js +1 -1
- data/assets/theme/j1/modules/lightGallery/css/lg-transitions.css +1 -1
- data/assets/theme/j1/modules/lightGallery/css/lg-transitions.min.css +1 -1
- data/assets/theme/j1/modules/lightGallery/css/lightgallery-bundle.css +1 -1
- data/assets/theme/j1/modules/lightGallery/css/lightgallery-bundle.min.css +1 -1
- data/assets/theme/j1/modules/lightGallery/css/themes/uno/uno.css +1 -1
- data/assets/theme/j1/modules/lightGallery/css/themes/uno/uno.min.css +1 -1
- data/assets/theme/j1/modules/lightGallery/js/lightgallery.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/lightgallery.min.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/j1/j1-video.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/j1/j1-video.min.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/j1/lg-video.1.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-autoplay.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-autoplay.min.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-comment.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-comment.min.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-fullscreen.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-fullscreen.min.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-hash.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-hash.min.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-medium-zoom.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-medium-zoom.min.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-pager.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-pager.min.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-rotate.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-rotate.min.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-share.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-share.min.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-thumbnail.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-thumbnail.min.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.min.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-vimeo-thumbnail.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-vimeo-thumbnail.min.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-zoom.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-zoom.min.js +1 -1
- data/assets/theme/j1/modules/lightbox/css/lightbox.css +1 -1
- data/assets/theme/j1/modules/lightbox/css/lightbox.min.css +1 -1
- data/assets/theme/j1/modules/lightbox/css/theme/uno.css +1 -1
- data/assets/theme/j1/modules/lightbox/css/theme/uno.min.css +1 -1
- data/assets/theme/j1/modules/lightbox/js/lightbox.js +1 -1
- data/assets/theme/j1/modules/lightbox/js/lightbox.min.js +1 -1
- data/assets/theme/j1/modules/lunr/css/theme/uno.css +1 -1
- data/assets/theme/j1/modules/lunr/css/theme/uno.min.css +1 -1
- data/assets/theme/j1/modules/lunr/js/j1.js +1 -1
- data/assets/theme/j1/modules/lunr/js/j1.min.js +1 -1
- data/assets/theme/j1/modules/masterslider/css/theme/uno.css +1 -1
- data/assets/theme/j1/modules/masterslider/css/theme/uno.min.css +1 -1
- data/assets/theme/j1/modules/mmenuLight/css/mmenu-light.css +1 -1
- data/assets/theme/j1/modules/mmenuLight/css/mmenu-light.min.css +1 -1
- data/assets/theme/j1/modules/mmenuLight/css/theme/uno/mmenu.css +1 -1
- data/assets/theme/j1/modules/mmenuLight/css/theme/uno/mmenu.min.css +1 -1
- data/assets/theme/j1/modules/mmenuLight/js/mmenu.js +1 -1
- data/assets/theme/j1/modules/mmenuLight/js/mmenu.min.js +1 -1
- data/assets/theme/j1/modules/msDropdown/css/flags.css +1 -1
- data/assets/theme/j1/modules/msDropdown/css/flags.min.css +1 -1
- data/assets/theme/j1/modules/msDropdown/css/msDropdown.css +1 -1
- data/assets/theme/j1/modules/msDropdown/css/msDropdown.min.css +1 -1
- data/assets/theme/j1/modules/msDropdown/css/themes/uno/msDropdown.css +1 -1
- data/assets/theme/j1/modules/msDropdown/css/themes/uno/msDropdown.min.css +1 -1
- data/assets/theme/j1/modules/msDropdown/js/msDropdown.js +1 -1
- data/assets/theme/j1/modules/msDropdown/js/msDropdown.min.js +1 -1
- 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/_info/.version_5.4.4 +6 -0
- data/assets/theme/j1/modules/photoswipe/_info/example/photoswipe-caption-plugin.html +237 -0
- data/assets/theme/j1/modules/photoswipe/_info/example/test-gallery.html +36 -0
- data/assets/theme/j1/modules/photoswipe/css/photoswipe-caption-plugin.css +69 -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/js/_info/README.md +43 -0
- data/assets/theme/j1/modules/photoswipe/js/photoswipe-caption-plugin.js +428 -0
- data/assets/theme/j1/modules/photoswipe/js/photoswipe-caption-plugin.min.js +18 -0
- data/assets/theme/j1/modules/photoswipe/js/photoswipe-core.js +7102 -0
- data/assets/theme/j1/modules/photoswipe/js/photoswipe-core.min.js +18 -0
- data/assets/theme/j1/modules/photoswipe/js/photoswipe-lightbox.1.js +1990 -0
- data/assets/theme/j1/modules/photoswipe/js/photoswipe-lightbox.js +1981 -0
- data/assets/theme/j1/modules/photoswipe/js/photoswipe-lightbox.min.js +18 -0
- data/assets/theme/j1/modules/rangeSlider/css/theme/uno/nouislider.css +1 -1
- data/assets/theme/j1/modules/rangeSlider/css/theme/uno/nouislider.min.css +1 -1
- data/assets/theme/j1/modules/rouge/css/base16/theme.css +1 -1
- data/assets/theme/j1/modules/rouge/css/base16/theme.min.css +1 -1
- data/assets/theme/j1/modules/rouge/css/base16.dark/theme.css +1 -1
- data/assets/theme/j1/modules/rouge/css/base16.dark/theme.min.css +1 -1
- data/assets/theme/j1/modules/rouge/css/base16.light/theme.css +1 -1
- data/assets/theme/j1/modules/rouge/css/base16.light/theme.min.css +1 -1
- data/assets/theme/j1/modules/rouge/css/base16.monokai/theme.css +1 -1
- data/assets/theme/j1/modules/rouge/css/base16.monokai/theme.min.css +1 -1
- data/assets/theme/j1/modules/rouge/css/base16.monokai.dark/theme.css +1 -1
- data/assets/theme/j1/modules/rouge/css/base16.monokai.dark/theme.min.css +1 -1
- data/assets/theme/j1/modules/rouge/css/base16.monokai.light/theme.css +1 -1
- data/assets/theme/j1/modules/rouge/css/base16.monokai.light/theme.min.css +1 -1
- data/assets/theme/j1/modules/rouge/css/base16.solarized/theme.css +1 -1
- data/assets/theme/j1/modules/rouge/css/base16.solarized/theme.min.css +1 -1
- data/assets/theme/j1/modules/rouge/css/base16.solarized.dark/theme.css +1 -1
- data/assets/theme/j1/modules/rouge/css/base16.solarized.dark/theme.min.css +1 -1
- data/assets/theme/j1/modules/rouge/css/base16.solarized.light/theme.css +1 -1
- data/assets/theme/j1/modules/rouge/css/base16.solarized.light/theme.min.css +1 -1
- data/assets/theme/j1/modules/rouge/css/colorful/theme.css +1 -1
- data/assets/theme/j1/modules/rouge/css/colorful/theme.min.css +1 -1
- data/assets/theme/j1/modules/rouge/css/github/theme.css +1 -1
- data/assets/theme/j1/modules/rouge/css/github/theme.min.css +1 -1
- data/assets/theme/j1/modules/rouge/css/gruvbox/theme.css +1 -1
- data/assets/theme/j1/modules/rouge/css/gruvbox/theme.min.css +1 -1
- data/assets/theme/j1/modules/rouge/css/gruvbox.dark/theme.css +1 -1
- data/assets/theme/j1/modules/rouge/css/gruvbox.dark/theme.min.css +1 -1
- data/assets/theme/j1/modules/rouge/css/gruvbox.light/theme.css +1 -1
- data/assets/theme/j1/modules/rouge/css/gruvbox.light/theme.min.css +1 -1
- data/assets/theme/j1/modules/rouge/css/igorpro/theme.css +1 -1
- data/assets/theme/j1/modules/rouge/css/igorpro/theme.min.css +1 -1
- data/assets/theme/j1/modules/rouge/css/molokai/theme.css +1 -1
- data/assets/theme/j1/modules/rouge/css/molokai/theme.min.css +1 -1
- data/assets/theme/j1/modules/rouge/css/monokai/theme.css +1 -1
- data/assets/theme/j1/modules/rouge/css/monokai/theme.min.css +1 -1
- data/assets/theme/j1/modules/rouge/css/monokai.sublime/theme.css +1 -1
- data/assets/theme/j1/modules/rouge/css/monokai.sublime/theme.min.css +1 -1
- data/assets/theme/j1/modules/rouge/css/pastie/theme.css +1 -1
- data/assets/theme/j1/modules/rouge/css/pastie/theme.min.css +1 -1
- data/assets/theme/j1/modules/rouge/css/thankful_eyes/theme.css +1 -1
- data/assets/theme/j1/modules/rouge/css/thankful_eyes/theme.min.css +1 -1
- data/assets/theme/j1/modules/rouge/css/themes.txt +1 -1
- data/assets/theme/j1/modules/rouge/css/tulip/theme.css +1 -1
- data/assets/theme/j1/modules/rouge/css/tulip/theme.min.css +1 -1
- data/assets/theme/j1/modules/rouge/css/uno.dark/theme.css +1 -1
- data/assets/theme/j1/modules/rouge/css/uno.dark/theme.min.css +1 -1
- data/assets/theme/j1/modules/rouge/css/uno.light/theme.css +1 -1
- data/assets/theme/j1/modules/rouge/css/uno.light/theme.min.css +1 -1
- data/assets/theme/j1/modules/rouge/js/select.js +1 -1
- data/assets/theme/j1/modules/rtable/css/theme/uno/rtable.css +1 -1
- data/assets/theme/j1/modules/rtable/css/theme/uno/rtable.min.css +1 -1
- data/assets/theme/j1/modules/rtable/js/rtable.js +1 -1
- data/assets/theme/j1/modules/rtable/js/rtable.min.js +1 -1
- data/assets/theme/j1/modules/scroller/css/theme/uno.css +1 -1
- data/assets/theme/j1/modules/scroller/css/theme/uno.min.css +1 -1
- data/assets/theme/j1/modules/scroller/js/scroller.min.js +1 -1
- data/assets/theme/j1/modules/slick/lightbox/css/theme/uno.css +1 -1
- data/assets/theme/j1/modules/slick/lightbox/css/theme/uno.min.css +1 -1
- data/assets/theme/j1/modules/slick/slider/css/theme/uno.css +1 -1
- data/assets/theme/j1/modules/slick/slider/css/theme/uno.min.css +1 -1
- data/assets/theme/j1/modules/spinner/css/spin.css +1 -1
- data/assets/theme/j1/modules/spinner/css/spin.min.css +1 -1
- data/assets/theme/j1/modules/spinner/js/spin.js +1 -1
- data/assets/theme/j1/modules/spinner/js/spin.min.js +1 -1
- 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/_info/.version_1.2.0 +15 -0
- data/assets/theme/j1/modules/swiper/_info/swiperjs.com-demos.url +2 -0
- data/assets/theme/j1/modules/swiper/css/modules/effectNeighbor.css +53 -0
- data/assets/theme/j1/modules/swiper/css/modules/effectNeighbor.min.css +17 -0
- data/assets/theme/j1/modules/swiper/css/modules/effectPanorama.css +26 -0
- data/assets/theme/j1/modules/swiper/css/modules/effectPanorama.min.css +17 -0
- data/assets/theme/j1/modules/swiper/css/modules/effectThumbs.css +44 -0
- data/assets/theme/j1/modules/swiper/css/modules/effectThumbs.min.css +44 -0
- data/assets/theme/j1/modules/swiper/css/swiper-bundle.css +746 -0
- data/assets/theme/j1/modules/swiper/css/swiper-bundle.min..css +23 -0
- data/assets/theme/j1/modules/swiper/css/theme/uno.css +229 -0
- data/assets/theme/j1/modules/swiper/css/theme/uno.min.css +144 -0
- data/assets/theme/j1/modules/swiper/js/modules/!readme +3 -0
- data/assets/theme/j1/modules/swiper/js/modules/effectNeighbor.js +33 -0
- data/assets/theme/j1/modules/swiper/js/modules/effectNeighbor.min.js +33 -0
- data/assets/theme/j1/modules/swiper/js/modules/effectPanorama.js +93 -0
- data/assets/theme/j1/modules/swiper/js/modules/effectPanorama.min.js +17 -0
- data/assets/theme/j1/modules/swiper/js/modules/effectThumbs.js +113 -0
- data/assets/theme/j1/modules/swiper/js/modules/effectThumbs.min.js +33 -0
- data/assets/theme/j1/modules/swiper/js/swiper-bundle.js +9791 -0
- data/assets/theme/j1/modules/swiper/js/swiper-bundle.min.js +23 -0
- data/assets/theme/j1/modules/themeSwitcher/js/switcher.js +1 -1
- data/assets/theme/j1/modules/themeSwitcher/js/switcher.min.js +1 -1
- data/assets/theme/j1/modules/translator/css/translator.css +1 -1
- data/assets/theme/j1/modules/translator/css/translator.min.css +1 -1
- data/assets/theme/j1/modules/translator/js/translator.js +1 -1
- data/assets/theme/j1/modules/translator/js/translator.min.js +1 -1
- data/assets/theme/j1/modules/videoPlayer/vimeo/js/player.min.js +1 -1
- data/assets/theme/j1/modules/videojs/css/plugins/controls/skipbuttons.0.css +1 -1
- data/assets/theme/j1/modules/videojs/css/plugins/controls/skipbuttons.1.css +1 -1
- data/assets/theme/j1/modules/videojs/css/plugins/controls/skipbuttons.css +1 -1
- data/assets/theme/j1/modules/videojs/css/plugins/controls/skipbuttons.min.css +1 -1
- data/assets/theme/j1/modules/videojs/css/plugins/controls/zoom.css +1 -1
- data/assets/theme/j1/modules/videojs/css/plugins/controls/zoom.min.css +1 -1
- data/assets/theme/j1/modules/videojs/css/themes/uno.css +1 -1
- data/assets/theme/j1/modules/videojs/css/themes/uno.min.css +1 -1
- data/assets/theme/j1/modules/videojs/js/plugins/controls/autocaption/autocaption.js +1 -1
- data/assets/theme/j1/modules/videojs/js/plugins/controls/autocaption/autocaption.min.js +1 -1
- data/assets/theme/j1/modules/videojs/js/plugins/controls/hotkeys/hotkeys.js +1 -1
- 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/skipbuttons.js +1 -1
- data/assets/theme/j1/modules/videojs/js/plugins/controls/skipbuttons/skipbuttons.min.js +1 -1
- data/assets/theme/j1/modules/videojs/js/plugins/controls/zoom/zoom.js +1 -1
- data/assets/theme/j1/modules/videojs/js/plugins/controls/zoom/zoom.min.js +1 -1
- data/assets/theme/j1/modules/videojs/js/plugins/players/dm/api/dailymotion.sdk.js +1 -1
- data/assets/theme/j1/modules/videojs/js/plugins/players/dm/api/dailymotion.sdk.min.js +1 -1
- data/assets/theme/j1/modules/videojs/js/plugins/players/dm/dailymotion.js +1 -1
- data/assets/theme/j1/modules/videojs/js/plugins/players/dm/dailymotion.min.js +1 -1
- data/assets/theme/j1/modules/videojs/js/plugins/players/vm/api/vimeo.js +1 -1
- data/assets/theme/j1/modules/videojs/js/plugins/players/vm/api/vimeo.min.js +1 -1
- data/assets/theme/j1/modules/videojs/js/plugins/players/vm/vimeo.js +1 -1
- data/assets/theme/j1/modules/videojs/js/plugins/players/vm/vimeo.min.js +1 -1
- data/assets/theme/j1/modules/videojs/js/plugins/players/wt/wistia.js +1 -1
- data/assets/theme/j1/modules/videojs/js/plugins/players/wt/wistia.min.js +1 -1
- data/assets/theme/j1/modules/videojs/js/plugins/players/yt/api/youtube.min.js +1 -1
- data/assets/theme/j1/modules/videojs/js/plugins/players/yt/v3.0.0/youtube.js +1 -1
- data/assets/theme/j1/modules/videojs/js/plugins/players/yt/v3.0.0/youtube.min.js +1 -1
- data/assets/theme/j1/modules/videojs/js/plugins/players/yt/youtube.js +1 -1
- data/assets/theme/j1/modules/videojs/js/plugins/players/yt/youtube.min.js +1 -1
- data/lib/j1/version.rb +1 -1
- data/lib/starter_web/Gemfile +1 -1
- data/lib/starter_web/README.md +5 -5
- data/lib/starter_web/_config.yml +2 -2
- data/lib/starter_web/_data/j1_config.yml +1 -1
- data/lib/starter_web/_data/modules/amplitude_players.yml +352 -0
- data/lib/starter_web/_data/modules/{amplitude.yml → amplitude_playlists.yml} +257 -239
- data/lib/starter_web/_data/modules/authentication.yml +1 -1
- data/lib/starter_web/_data/modules/defaults/amplitude.yml +60 -35
- data/lib/starter_web/_data/modules/defaults/slick.yml +1 -1
- data/lib/starter_web/_data/modules/defaults/swiper.yml +175 -0
- data/lib/starter_web/_data/modules/log4javascript.yml +1 -1
- data/lib/starter_web/_data/modules/navigator.yml +1 -1
- data/lib/starter_web/_data/modules/navigator_menu.yml +1 -1
- data/lib/starter_web/_data/modules/swiper.yml +655 -0
- data/lib/starter_web/_data/modules/swiper_playlists.yml +480 -0
- data/lib/starter_web/_data/private.yml +1 -1
- data/lib/starter_web/_data/resources.yml +272 -158
- data/lib/starter_web/_data/templates/feed.xml +1 -1
- data/lib/starter_web/_includes/custom/static/bs5_accordion.html +1 -1
- data/lib/starter_web/_includes/custom/templates/bs5_accordion.html +1 -1
- data/lib/starter_web/_includes/custom/templates/collection_panel.html +1 -1
- data/lib/starter_web/_includes/custom/templates/custom_header.html +1 -1
- data/lib/starter_web/_includes/custom/templates/people_panel.html +1 -1
- data/lib/starter_web/_includes/google/static/google_ad__your-slot-id.html +1 -1
- data/lib/starter_web/_includes/google/templates/google_ads.html +1 -1
- data/lib/starter_web/_plugins/asciidoctor/admonition-block-answer.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/admonition-block-question.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/amplitude-block.rb +2 -1
- data/lib/starter_web/_plugins/asciidoctor/banner.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/callout.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/carousel-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/conum.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/dailymotion-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/fab-icon-inline.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/fas-icon-inline.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/flag-icon-inline.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/gallery-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/gemini-ui-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/gist-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/google-ad-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/iconify-icon-inline.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/iframe-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/lightbox-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/lorem_inline.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/masonry-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/masterslider-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/mdi-icon-inline.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/mdib-icon-inline.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/mdil-icon-inline.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/panel.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/placeholder-inline.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/range-slider-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/shout-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/slick-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/slim-select-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/swiper-block.rb +55 -0
- data/lib/starter_web/_plugins/asciidoctor/textbook-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/twitter-emoji-inline.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/videojs-block.rb +1 -5
- data/lib/starter_web/_plugins/asciidoctor/vimeo-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/wistia-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/youtube-block.rb +1 -1
- data/lib/starter_web/_plugins/filter/debug.rb +1 -1
- data/lib/starter_web/_plugins/filter/encodeBase64.rb +1 -1
- data/lib/starter_web/_plugins/filter/encryptAES.rb +1 -1
- data/lib/starter_web/_plugins/filter/filters.rb +32 -1
- data/lib/starter_web/_plugins/filter/liquify.rb +1 -1
- data/lib/starter_web/_plugins/filter/minifyJS.rb +1 -1
- data/lib/starter_web/_plugins/filter/minifyJSON.rb +1 -1
- data/lib/starter_web/_plugins/filter/prettify.rb +1 -1
- data/lib/starter_web/_plugins/filter/xml_prettify.rb +1 -1
- data/lib/starter_web/_plugins/helper/symlink_watcher.rb +1 -1
- data/lib/starter_web/_plugins/i18n/date.rb +1 -1
- data/lib/starter_web/_plugins/index/lunr.rb +2 -2
- data/lib/starter_web/_plugins/seo/j1-feed.rb +1 -1
- data/lib/starter_web/_plugins/seo/j1-seo-tags.rb +1 -1
- data/lib/starter_web/_plugins/seo/j1-sitemap.rb +1 -1
- data/lib/starter_web/assets/image/icons/tv/Index of -tv-logos-.url +2 -0
- data/lib/starter_web/assets/image/icons/tv/TV from Germany - LyngSat Logo.url +2 -0
- data/lib/starter_web/assets/image/icons/tv/Zeichnung.svg +47 -0
- data/lib/starter_web/assets/image/icons/tv/ard-icon-16x16.ico +0 -0
- data/lib/starter_web/assets/image/icons/tv/ard-icon-24x24.png +0 -0
- data/lib/starter_web/assets/image/icons/tv/ard-icon-512x512.png +0 -0
- data/lib/starter_web/assets/image/icons/tv/ard-icon.jpg +0 -0
- data/lib/starter_web/assets/image/icons/tv/ard-icon.jpg (353/303/227353).url" +2 -0
- data/lib/starter_web/assets/image/icons/tv/ard-icon.png +0 -0
- data/lib/starter_web/assets/image/icons/tv/ard-logo-png_seeklogo-428343.png +0 -0
- data/lib/starter_web/assets/image/icons/tv/cytec-tvlogos- collection of mostly german tv channel logos.url +2 -0
- data/lib/starter_web/assets/image/icons/tv/output_image.jpg +0 -0
- data/lib/starter_web/assets/image/icons/tv/pang.ping +0 -0
- data/lib/starter_web/assets/image/icons/tv/tv-logos-countries-germany-0_all_logos_mosaic.md at main /302/267 tv-logo-tv-logos.url" +2 -0
- data/lib/starter_web/assets/image/modules/attics/1920x1280/tiny_desk.jpg +0 -0
- data/lib/starter_web/assets/image/modules/attics/alice-donovan-rouse-2.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/free_animals/free-animals-1.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/free_animals/free-animals-2.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/free_animals/free-animals-3.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/free_animals/free-animals-4.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/free_animals/free-animals-5.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/free_animals/free-animals-6.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/mega_cities/295683517.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/mega_cities/chicago-us.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/mega_cities/denys-nevozhai-1_b.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/mega_cities/denys-nevozhai-1_c.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/mega_cities/denys-nevozhai-3_b.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/mega_cities/emmad-mazhari_c.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/mega_cities/federico-rizzarelli_b.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/mega_cities/federico-rizzarelli_c.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/mega_cities/jakarta_indonesia.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/mega_cities/jakarta_indonesia_2.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/mega_cities/melbourne_australia.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/mega_cities/melbourne_australia.webp +0 -0
- data/lib/starter_web/assets/image/modules/gallery/mega_cities/queen_bees_at_eureka_tower.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/mega_cities/shanghai_china.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/mega_cities/thomas-tucker_b.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/mega_cities/tokyo_japan.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/neighbor_slider/guardians-of-the-galaxy.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/neighbor_slider/justice-league.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/neighbor_slider/spider-man.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/neighbor_slider/suicide-squad.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/neighbor_slider/thor-ragnarok.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/panorama/1.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/panorama/10.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/panorama/11.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/panorama/12.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/panorama/2.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/panorama/3.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/panorama/4.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/panorama/5.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/panorama/6.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/panorama/7.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/panorama/8.jpg +0 -0
- data/lib/starter_web/assets/image/modules/gallery/panorama/9.jpg +0 -0
- 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/config.ru +1 -1
- data/lib/starter_web/dot.gitattributes +1 -1
- data/lib/starter_web/dot.nojekyll +1 -1
- data/lib/starter_web/package.json +1 -1
- data/lib/starter_web/pages/public/{manuals/integrations/google/gemini/_includes → _includes}/attributes.asciidoc +5 -7
- data/lib/starter_web/pages/public/_includes/documents/photoswipe/200_photoswipe_parameters.asciidoc +529 -0
- data/lib/starter_web/pages/public/_includes/documents/photoswipe/210_photoswipe_lightbox_parameters.asciidoc +105 -0
- data/lib/starter_web/pages/public/_includes/documents/photoswipe/300_caption_plugin_for_photoSwipe.asciidoc +324 -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 +118 -0
- data/lib/starter_web/pages/public/_includes/documents/swiper/200_swiper_parameters_a_k.asciidoc +1094 -0
- data/lib/starter_web/pages/public/_includes/documents/swiper/200_swiper_parameters_l_o.asciidoc +537 -0
- data/lib/starter_web/pages/public/_includes/documents/swiper/200_swiper_parameters_p_s.asciidoc +757 -0
- data/lib/starter_web/pages/public/_includes/documents/swiper/200_swiper_parameters_t_z.asciidoc +451 -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 +3445 -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 → tools/tester/amplitude_yt_tester.adoc} +81 -67
- data/lib/starter_web/pages/public/tools/tester/swiper_tester.adoc +796 -0
- data/lib/starter_web/pages/public/tour/modal_extentions.adoc +12 -5
- data/lib/starter_web/pages/public/tour/play_audio.adoc +60 -5
- data/lib/starter_web/pages/public/tour/play_video.adoc +30 -0
- data/lib/starter_web/pages/public/tour/present_images.adoc +24 -22
- metadata +128 -20
- data/assets/theme/j1/modules/amplitudejs/js/tech/youtube_example.js +0 -211
- data/lib/starter_web/assets/image/modules/gallery/mega_cities/thomas-tucker-bw.jpg +0 -0
- data/lib/starter_web/pages/public/lazy_loader_tester.adoc +0 -402
- data/lib/starter_web/pages/public/manuals/integrations/amplitudejs/_includes/attributes.asciidoc +0 -69
- data/lib/starter_web/pages/public/manuals/integrations/amplitudejs/_includes/documents/readme +0 -0
- data/lib/starter_web/pages/public/manuals/integrations/amplitudejs/amplitudejs-api.adoc +0 -2260
- data/lib/starter_web/pages/public/manuals/integrations/google/gemini/_includes/documents/preview_google_adsense.asciidoc +0 -448
- data/lib/starter_web/pages/public/manuals/integrations/google/gemini/_includes/documents/readme +0 -0
- data/lib/starter_web/pages/public/manuals/integrations/google/gemini/_includes/tables/readme +0 -0
- data/lib/starter_web/pages/public/manuals/integrations/google/gemini/gemini.adoc +0 -525
- data/lib/starter_web/pages/public/manuals/integrations/google/gemini/security.asccidoc +0 -274
- data/lib/starter_web/pages/public/manuals/integrations/google/gemini/security.hrml +0 -560
- data/lib/starter_web/pages/public/manuals/integrations/videojs/youtube-api.adoc +0 -1638
- data/lib/starter_web/pages/public/manuals/ytdl/man.adoc +0 -3020
- data/lib/starter_web/pages/public/manuals/ytdl/man.md +0 -2378
@@ -0,0 +1,1981 @@
|
|
1
|
+
/*
|
2
|
+
# -----------------------------------------------------------------------------
|
3
|
+
# ~/assets/theme/j1/modules/photoswipe/js/photoswipe-lightbox.js
|
4
|
+
# PhotoSwipe v5.4.4 Lightbox JS by Dmytro Semenov
|
5
|
+
# Provides PhotoSwipe Lightbox (UMD version to be used with webbrowsers)
|
6
|
+
# -----------------------------------------------------------------------------
|
7
|
+
#
|
8
|
+
# Product/Info:
|
9
|
+
# https://photoswipe.com
|
10
|
+
|
11
|
+
# Copyright (C) 2014 - 2024 Dmitry Semenov
|
12
|
+
#
|
13
|
+
# PhotoSwipe is licensed under the MIT License.
|
14
|
+
# See: https://github.com/dimsemenov/PhotoSwipe/blob/master/LICENSE
|
15
|
+
# -----------------------------------------------------------------------------
|
16
|
+
*/
|
17
|
+
|
18
|
+
(function (global, factory) {
|
19
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
20
|
+
typeof define === 'function' && define.amd ? define(factory) :
|
21
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.PhotoSwipeLightbox = factory());
|
22
|
+
})(this, (function () { 'use strict';
|
23
|
+
|
24
|
+
/** @typedef {import('../photoswipe.js').Point} Point */
|
25
|
+
|
26
|
+
/**
|
27
|
+
* @template {keyof HTMLElementTagNameMap} T
|
28
|
+
* @param {string} className
|
29
|
+
* @param {T} tagName
|
30
|
+
* @param {Node} [appendToEl]
|
31
|
+
* @returns {HTMLElementTagNameMap[T]}
|
32
|
+
*/
|
33
|
+
function createElement(className, tagName, appendToEl) {
|
34
|
+
const el = document.createElement(tagName);
|
35
|
+
|
36
|
+
if (className) {
|
37
|
+
el.className = className;
|
38
|
+
}
|
39
|
+
|
40
|
+
if (appendToEl) {
|
41
|
+
appendToEl.appendChild(el);
|
42
|
+
}
|
43
|
+
|
44
|
+
return el;
|
45
|
+
}
|
46
|
+
/**
|
47
|
+
* Get transform string
|
48
|
+
*
|
49
|
+
* @param {number} x
|
50
|
+
* @param {number} [y]
|
51
|
+
* @param {number} [scale]
|
52
|
+
* @returns {string}
|
53
|
+
*/
|
54
|
+
|
55
|
+
function toTransformString(x, y, scale) {
|
56
|
+
let propValue = `translate3d(${x}px,${y || 0}px,0)`;
|
57
|
+
|
58
|
+
if (scale !== undefined) {
|
59
|
+
propValue += ` scale3d(${scale},${scale},1)`;
|
60
|
+
}
|
61
|
+
|
62
|
+
return propValue;
|
63
|
+
}
|
64
|
+
/**
|
65
|
+
* Apply width and height CSS properties to element
|
66
|
+
*
|
67
|
+
* @param {HTMLElement} el
|
68
|
+
* @param {string | number} w
|
69
|
+
* @param {string | number} h
|
70
|
+
*/
|
71
|
+
|
72
|
+
function setWidthHeight(el, w, h) {
|
73
|
+
el.style.width = typeof w === 'number' ? `${w}px` : w;
|
74
|
+
el.style.height = typeof h === 'number' ? `${h}px` : h;
|
75
|
+
}
|
76
|
+
/** @typedef {LOAD_STATE[keyof LOAD_STATE]} LoadState */
|
77
|
+
|
78
|
+
/** @type {{ IDLE: 'idle'; LOADING: 'loading'; LOADED: 'loaded'; ERROR: 'error' }} */
|
79
|
+
|
80
|
+
const LOAD_STATE = {
|
81
|
+
IDLE: 'idle',
|
82
|
+
LOADING: 'loading',
|
83
|
+
LOADED: 'loaded',
|
84
|
+
ERROR: 'error'
|
85
|
+
};
|
86
|
+
/**
|
87
|
+
* Check if click or keydown event was dispatched
|
88
|
+
* with a special key or via mouse wheel.
|
89
|
+
*
|
90
|
+
* @param {MouseEvent | KeyboardEvent} e
|
91
|
+
* @returns {boolean}
|
92
|
+
*/
|
93
|
+
|
94
|
+
function specialKeyUsed(e) {
|
95
|
+
return 'button' in e && e.button === 1 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey;
|
96
|
+
}
|
97
|
+
/**
|
98
|
+
* Parse `gallery` or `children` options.
|
99
|
+
*
|
100
|
+
* @param {import('../photoswipe.js').ElementProvider} [option]
|
101
|
+
* @param {string} [legacySelector]
|
102
|
+
* @param {HTMLElement | Document} [parent]
|
103
|
+
* @returns HTMLElement[]
|
104
|
+
*/
|
105
|
+
|
106
|
+
function getElementsFromOption(option, legacySelector, parent = document) {
|
107
|
+
/** @type {HTMLElement[]} */
|
108
|
+
let elements = [];
|
109
|
+
|
110
|
+
if (option instanceof Element) {
|
111
|
+
elements = [option];
|
112
|
+
} else if (option instanceof NodeList || Array.isArray(option)) {
|
113
|
+
elements = Array.from(option);
|
114
|
+
} else {
|
115
|
+
const selector = typeof option === 'string' ? option : legacySelector;
|
116
|
+
|
117
|
+
if (selector) {
|
118
|
+
elements = Array.from(parent.querySelectorAll(selector));
|
119
|
+
}
|
120
|
+
}
|
121
|
+
|
122
|
+
return elements;
|
123
|
+
}
|
124
|
+
/**
|
125
|
+
* Check if variable is PhotoSwipe class
|
126
|
+
*
|
127
|
+
* @param {any} fn
|
128
|
+
* @returns {boolean}
|
129
|
+
*/
|
130
|
+
|
131
|
+
function isPswpClass(fn) {
|
132
|
+
return typeof fn === 'function' && fn.prototype && fn.prototype.goTo;
|
133
|
+
}
|
134
|
+
/**
|
135
|
+
* Check if browser is Safari
|
136
|
+
*
|
137
|
+
* @returns {boolean}
|
138
|
+
*/
|
139
|
+
|
140
|
+
function isSafari() {
|
141
|
+
return !!(navigator.vendor && navigator.vendor.match(/apple/i));
|
142
|
+
}
|
143
|
+
|
144
|
+
/** @typedef {import('../lightbox/lightbox.js').default} PhotoSwipeLightbox */
|
145
|
+
|
146
|
+
/** @typedef {import('../photoswipe.js').default} PhotoSwipe */
|
147
|
+
|
148
|
+
/** @typedef {import('../photoswipe.js').PhotoSwipeOptions} PhotoSwipeOptions */
|
149
|
+
|
150
|
+
/** @typedef {import('../photoswipe.js').DataSource} DataSource */
|
151
|
+
|
152
|
+
/** @typedef {import('../ui/ui-element.js').UIElementData} UIElementData */
|
153
|
+
|
154
|
+
/** @typedef {import('../slide/content.js').default} ContentDefault */
|
155
|
+
|
156
|
+
/** @typedef {import('../slide/slide.js').default} Slide */
|
157
|
+
|
158
|
+
/** @typedef {import('../slide/slide.js').SlideData} SlideData */
|
159
|
+
|
160
|
+
/** @typedef {import('../slide/zoom-level.js').default} ZoomLevel */
|
161
|
+
|
162
|
+
/** @typedef {import('../slide/get-thumb-bounds.js').Bounds} Bounds */
|
163
|
+
|
164
|
+
/**
|
165
|
+
* Allow adding an arbitrary props to the Content
|
166
|
+
* https://photoswipe.com/custom-content/#using-webp-image-format
|
167
|
+
* @typedef {ContentDefault & Record<string, any>} Content
|
168
|
+
*/
|
169
|
+
|
170
|
+
/** @typedef {{ x?: number; y?: number }} Point */
|
171
|
+
|
172
|
+
/**
|
173
|
+
* @typedef {Object} PhotoSwipeEventsMap https://photoswipe.com/events/
|
174
|
+
*
|
175
|
+
*
|
176
|
+
* https://photoswipe.com/adding-ui-elements/
|
177
|
+
*
|
178
|
+
* @prop {undefined} uiRegister
|
179
|
+
* @prop {{ data: UIElementData }} uiElementCreate
|
180
|
+
*
|
181
|
+
*
|
182
|
+
* https://photoswipe.com/events/#initialization-events
|
183
|
+
*
|
184
|
+
* @prop {undefined} beforeOpen
|
185
|
+
* @prop {undefined} firstUpdate
|
186
|
+
* @prop {undefined} initialLayout
|
187
|
+
* @prop {undefined} change
|
188
|
+
* @prop {undefined} afterInit
|
189
|
+
* @prop {undefined} bindEvents
|
190
|
+
*
|
191
|
+
*
|
192
|
+
* https://photoswipe.com/events/#opening-or-closing-transition-events
|
193
|
+
*
|
194
|
+
* @prop {undefined} openingAnimationStart
|
195
|
+
* @prop {undefined} openingAnimationEnd
|
196
|
+
* @prop {undefined} closingAnimationStart
|
197
|
+
* @prop {undefined} closingAnimationEnd
|
198
|
+
*
|
199
|
+
*
|
200
|
+
* https://photoswipe.com/events/#closing-events
|
201
|
+
*
|
202
|
+
* @prop {undefined} close
|
203
|
+
* @prop {undefined} destroy
|
204
|
+
*
|
205
|
+
*
|
206
|
+
* https://photoswipe.com/events/#pointer-and-gesture-events
|
207
|
+
*
|
208
|
+
* @prop {{ originalEvent: PointerEvent }} pointerDown
|
209
|
+
* @prop {{ originalEvent: PointerEvent }} pointerMove
|
210
|
+
* @prop {{ originalEvent: PointerEvent }} pointerUp
|
211
|
+
* @prop {{ bgOpacity: number }} pinchClose can be default prevented
|
212
|
+
* @prop {{ panY: number }} verticalDrag can be default prevented
|
213
|
+
*
|
214
|
+
*
|
215
|
+
* https://photoswipe.com/events/#slide-content-events
|
216
|
+
*
|
217
|
+
* @prop {{ content: Content }} contentInit
|
218
|
+
* @prop {{ content: Content; isLazy: boolean }} contentLoad can be default prevented
|
219
|
+
* @prop {{ content: Content; isLazy: boolean }} contentLoadImage can be default prevented
|
220
|
+
* @prop {{ content: Content; slide: Slide; isError?: boolean }} loadComplete
|
221
|
+
* @prop {{ content: Content; slide: Slide }} loadError
|
222
|
+
* @prop {{ content: Content; width: number; height: number }} contentResize can be default prevented
|
223
|
+
* @prop {{ content: Content; width: number; height: number; slide: Slide }} imageSizeChange
|
224
|
+
* @prop {{ content: Content }} contentLazyLoad can be default prevented
|
225
|
+
* @prop {{ content: Content }} contentAppend can be default prevented
|
226
|
+
* @prop {{ content: Content }} contentActivate can be default prevented
|
227
|
+
* @prop {{ content: Content }} contentDeactivate can be default prevented
|
228
|
+
* @prop {{ content: Content }} contentRemove can be default prevented
|
229
|
+
* @prop {{ content: Content }} contentDestroy can be default prevented
|
230
|
+
*
|
231
|
+
*
|
232
|
+
* undocumented
|
233
|
+
*
|
234
|
+
* @prop {{ point: Point; originalEvent: PointerEvent }} imageClickAction can be default prevented
|
235
|
+
* @prop {{ point: Point; originalEvent: PointerEvent }} bgClickAction can be default prevented
|
236
|
+
* @prop {{ point: Point; originalEvent: PointerEvent }} tapAction can be default prevented
|
237
|
+
* @prop {{ point: Point; originalEvent: PointerEvent }} doubleTapAction can be default prevented
|
238
|
+
*
|
239
|
+
* @prop {{ originalEvent: KeyboardEvent }} keydown can be default prevented
|
240
|
+
* @prop {{ x: number; dragging: boolean }} moveMainScroll
|
241
|
+
* @prop {{ slide: Slide }} firstZoomPan
|
242
|
+
* @prop {{ slide: Slide | undefined, data: SlideData, index: number }} gettingData
|
243
|
+
* @prop {undefined} beforeResize
|
244
|
+
* @prop {undefined} resize
|
245
|
+
* @prop {undefined} viewportSize
|
246
|
+
* @prop {undefined} updateScrollOffset
|
247
|
+
* @prop {{ slide: Slide }} slideInit
|
248
|
+
* @prop {{ slide: Slide }} afterSetContent
|
249
|
+
* @prop {{ slide: Slide }} slideLoad
|
250
|
+
* @prop {{ slide: Slide }} appendHeavy can be default prevented
|
251
|
+
* @prop {{ slide: Slide }} appendHeavyContent
|
252
|
+
* @prop {{ slide: Slide }} slideActivate
|
253
|
+
* @prop {{ slide: Slide }} slideDeactivate
|
254
|
+
* @prop {{ slide: Slide }} slideDestroy
|
255
|
+
* @prop {{ destZoomLevel: number, centerPoint: Point | undefined, transitionDuration: number | false | undefined }} beforeZoomTo
|
256
|
+
* @prop {{ slide: Slide }} zoomPanUpdate
|
257
|
+
* @prop {{ slide: Slide }} initialZoomPan
|
258
|
+
* @prop {{ slide: Slide }} calcSlideSize
|
259
|
+
* @prop {undefined} resolutionChanged
|
260
|
+
* @prop {{ originalEvent: WheelEvent }} wheel can be default prevented
|
261
|
+
* @prop {{ content: Content }} contentAppendImage can be default prevented
|
262
|
+
* @prop {{ index: number; itemData: SlideData }} lazyLoadSlide can be default prevented
|
263
|
+
* @prop {undefined} lazyLoad
|
264
|
+
* @prop {{ slide: Slide }} calcBounds
|
265
|
+
* @prop {{ zoomLevels: ZoomLevel, slideData: SlideData }} zoomLevelsUpdate
|
266
|
+
*
|
267
|
+
*
|
268
|
+
* legacy
|
269
|
+
*
|
270
|
+
* @prop {undefined} init
|
271
|
+
* @prop {undefined} initialZoomIn
|
272
|
+
* @prop {undefined} initialZoomOut
|
273
|
+
* @prop {undefined} initialZoomInEnd
|
274
|
+
* @prop {undefined} initialZoomOutEnd
|
275
|
+
* @prop {{ dataSource: DataSource | undefined, numItems: number }} numItems
|
276
|
+
* @prop {{ itemData: SlideData; index: number }} itemData
|
277
|
+
* @prop {{ index: number, itemData: SlideData, instance: PhotoSwipe }} thumbBounds
|
278
|
+
*/
|
279
|
+
|
280
|
+
/**
|
281
|
+
* @typedef {Object} PhotoSwipeFiltersMap https://photoswipe.com/filters/
|
282
|
+
*
|
283
|
+
* @prop {(numItems: number, dataSource: DataSource | undefined) => number} numItems
|
284
|
+
* Modify the total amount of slides. Example on Data sources page.
|
285
|
+
* https://photoswipe.com/filters/#numitems
|
286
|
+
*
|
287
|
+
* @prop {(itemData: SlideData, index: number) => SlideData} itemData
|
288
|
+
* Modify slide item data. Example on Data sources page.
|
289
|
+
* https://photoswipe.com/filters/#itemdata
|
290
|
+
*
|
291
|
+
* @prop {(itemData: SlideData, element: HTMLElement, linkEl: HTMLAnchorElement) => SlideData} domItemData
|
292
|
+
* Modify item data when it's parsed from DOM element. Example on Data sources page.
|
293
|
+
* https://photoswipe.com/filters/#domitemdata
|
294
|
+
*
|
295
|
+
* @prop {(clickedIndex: number, e: MouseEvent, instance: PhotoSwipeLightbox) => number} clickedIndex
|
296
|
+
* Modify clicked gallery item index.
|
297
|
+
* https://photoswipe.com/filters/#clickedindex
|
298
|
+
*
|
299
|
+
* @prop {(placeholderSrc: string | false, content: Content) => string | false} placeholderSrc
|
300
|
+
* Modify placeholder image source.
|
301
|
+
* https://photoswipe.com/filters/#placeholdersrc
|
302
|
+
*
|
303
|
+
* @prop {(isContentLoading: boolean, content: Content) => boolean} isContentLoading
|
304
|
+
* Modify if the content is currently loading.
|
305
|
+
* https://photoswipe.com/filters/#iscontentloading
|
306
|
+
*
|
307
|
+
* @prop {(isContentZoomable: boolean, content: Content) => boolean} isContentZoomable
|
308
|
+
* Modify if the content can be zoomed.
|
309
|
+
* https://photoswipe.com/filters/#iscontentzoomable
|
310
|
+
*
|
311
|
+
* @prop {(useContentPlaceholder: boolean, content: Content) => boolean} useContentPlaceholder
|
312
|
+
* Modify if the placeholder should be used for the content.
|
313
|
+
* https://photoswipe.com/filters/#usecontentplaceholder
|
314
|
+
*
|
315
|
+
* @prop {(isKeepingPlaceholder: boolean, content: Content) => boolean} isKeepingPlaceholder
|
316
|
+
* Modify if the placeholder should be kept after the content is loaded.
|
317
|
+
* https://photoswipe.com/filters/#iskeepingplaceholder
|
318
|
+
*
|
319
|
+
*
|
320
|
+
* @prop {(contentErrorElement: HTMLElement, content: Content) => HTMLElement} contentErrorElement
|
321
|
+
* Modify an element when the content has error state (for example, if image cannot be loaded).
|
322
|
+
* https://photoswipe.com/filters/#contenterrorelement
|
323
|
+
*
|
324
|
+
* @prop {(element: HTMLElement, data: UIElementData) => HTMLElement} uiElement
|
325
|
+
* Modify a UI element that's being created.
|
326
|
+
* https://photoswipe.com/filters/#uielement
|
327
|
+
*
|
328
|
+
* @prop {(thumbnail: HTMLElement | null | undefined, itemData: SlideData, index: number) => HTMLElement} thumbEl
|
329
|
+
* Modify the thumbnail element from which opening zoom animation starts or ends.
|
330
|
+
* https://photoswipe.com/filters/#thumbel
|
331
|
+
*
|
332
|
+
* @prop {(thumbBounds: Bounds | undefined, itemData: SlideData, index: number) => Bounds} thumbBounds
|
333
|
+
* Modify the thumbnail bounds from which opening zoom animation starts or ends.
|
334
|
+
* https://photoswipe.com/filters/#thumbbounds
|
335
|
+
*
|
336
|
+
* @prop {(srcsetSizesWidth: number, content: Content) => number} srcsetSizesWidth
|
337
|
+
*
|
338
|
+
* @prop {(preventPointerEvent: boolean, event: PointerEvent, pointerType: string) => boolean} preventPointerEvent
|
339
|
+
*
|
340
|
+
*/
|
341
|
+
|
342
|
+
/**
|
343
|
+
* @template {keyof PhotoSwipeFiltersMap} T
|
344
|
+
* @typedef {{ fn: PhotoSwipeFiltersMap[T], priority: number }} Filter
|
345
|
+
*/
|
346
|
+
|
347
|
+
/**
|
348
|
+
* @template {keyof PhotoSwipeEventsMap} T
|
349
|
+
* @typedef {PhotoSwipeEventsMap[T] extends undefined ? PhotoSwipeEvent<T> : PhotoSwipeEvent<T> & PhotoSwipeEventsMap[T]} AugmentedEvent
|
350
|
+
*/
|
351
|
+
|
352
|
+
/**
|
353
|
+
* @template {keyof PhotoSwipeEventsMap} T
|
354
|
+
* @typedef {(event: AugmentedEvent<T>) => void} EventCallback
|
355
|
+
*/
|
356
|
+
|
357
|
+
/**
|
358
|
+
* Base PhotoSwipe event object
|
359
|
+
*
|
360
|
+
* @template {keyof PhotoSwipeEventsMap} T
|
361
|
+
*/
|
362
|
+
class PhotoSwipeEvent {
|
363
|
+
/**
|
364
|
+
* @param {T} type
|
365
|
+
* @param {PhotoSwipeEventsMap[T]} [details]
|
366
|
+
*/
|
367
|
+
constructor(type, details) {
|
368
|
+
this.type = type;
|
369
|
+
this.defaultPrevented = false;
|
370
|
+
|
371
|
+
if (details) {
|
372
|
+
Object.assign(this, details);
|
373
|
+
}
|
374
|
+
}
|
375
|
+
|
376
|
+
preventDefault() {
|
377
|
+
this.defaultPrevented = true;
|
378
|
+
}
|
379
|
+
|
380
|
+
}
|
381
|
+
/**
|
382
|
+
* PhotoSwipe base class that can listen and dispatch for events.
|
383
|
+
* Shared by PhotoSwipe Core and PhotoSwipe Lightbox, extended by base.js
|
384
|
+
*/
|
385
|
+
|
386
|
+
|
387
|
+
class Eventable {
|
388
|
+
constructor() {
|
389
|
+
/**
|
390
|
+
* @type {{ [T in keyof PhotoSwipeEventsMap]?: ((event: AugmentedEvent<T>) => void)[] }}
|
391
|
+
*/
|
392
|
+
this._listeners = {};
|
393
|
+
/**
|
394
|
+
* @type {{ [T in keyof PhotoSwipeFiltersMap]?: Filter<T>[] }}
|
395
|
+
*/
|
396
|
+
|
397
|
+
this._filters = {};
|
398
|
+
/** @type {PhotoSwipe | undefined} */
|
399
|
+
|
400
|
+
this.pswp = undefined;
|
401
|
+
/** @type {PhotoSwipeOptions | undefined} */
|
402
|
+
|
403
|
+
this.options = undefined;
|
404
|
+
}
|
405
|
+
/**
|
406
|
+
* @template {keyof PhotoSwipeFiltersMap} T
|
407
|
+
* @param {T} name
|
408
|
+
* @param {PhotoSwipeFiltersMap[T]} fn
|
409
|
+
* @param {number} priority
|
410
|
+
*/
|
411
|
+
|
412
|
+
|
413
|
+
addFilter(name, fn, priority = 100) {
|
414
|
+
var _this$_filters$name, _this$_filters$name2, _this$pswp;
|
415
|
+
|
416
|
+
if (!this._filters[name]) {
|
417
|
+
this._filters[name] = [];
|
418
|
+
}
|
419
|
+
|
420
|
+
(_this$_filters$name = this._filters[name]) === null || _this$_filters$name === void 0 || _this$_filters$name.push({
|
421
|
+
fn,
|
422
|
+
priority
|
423
|
+
});
|
424
|
+
(_this$_filters$name2 = this._filters[name]) === null || _this$_filters$name2 === void 0 || _this$_filters$name2.sort((f1, f2) => f1.priority - f2.priority);
|
425
|
+
(_this$pswp = this.pswp) === null || _this$pswp === void 0 || _this$pswp.addFilter(name, fn, priority);
|
426
|
+
}
|
427
|
+
/**
|
428
|
+
* @template {keyof PhotoSwipeFiltersMap} T
|
429
|
+
* @param {T} name
|
430
|
+
* @param {PhotoSwipeFiltersMap[T]} fn
|
431
|
+
*/
|
432
|
+
|
433
|
+
|
434
|
+
removeFilter(name, fn) {
|
435
|
+
if (this._filters[name]) {
|
436
|
+
// @ts-expect-error
|
437
|
+
this._filters[name] = this._filters[name].filter(filter => filter.fn !== fn);
|
438
|
+
}
|
439
|
+
|
440
|
+
if (this.pswp) {
|
441
|
+
this.pswp.removeFilter(name, fn);
|
442
|
+
}
|
443
|
+
}
|
444
|
+
/**
|
445
|
+
* @template {keyof PhotoSwipeFiltersMap} T
|
446
|
+
* @param {T} name
|
447
|
+
* @param {Parameters<PhotoSwipeFiltersMap[T]>} args
|
448
|
+
* @returns {Parameters<PhotoSwipeFiltersMap[T]>[0]}
|
449
|
+
*/
|
450
|
+
|
451
|
+
|
452
|
+
applyFilters(name, ...args) {
|
453
|
+
var _this$_filters$name3;
|
454
|
+
|
455
|
+
(_this$_filters$name3 = this._filters[name]) === null || _this$_filters$name3 === void 0 || _this$_filters$name3.forEach(filter => {
|
456
|
+
// @ts-expect-error
|
457
|
+
args[0] = filter.fn.apply(this, args);
|
458
|
+
});
|
459
|
+
return args[0];
|
460
|
+
}
|
461
|
+
/**
|
462
|
+
* @template {keyof PhotoSwipeEventsMap} T
|
463
|
+
* @param {T} name
|
464
|
+
* @param {EventCallback<T>} fn
|
465
|
+
*/
|
466
|
+
|
467
|
+
|
468
|
+
on(name, fn) {
|
469
|
+
var _this$_listeners$name, _this$pswp2;
|
470
|
+
|
471
|
+
if (!this._listeners[name]) {
|
472
|
+
this._listeners[name] = [];
|
473
|
+
}
|
474
|
+
|
475
|
+
(_this$_listeners$name = this._listeners[name]) === null || _this$_listeners$name === void 0 || _this$_listeners$name.push(fn); // When binding events to lightbox,
|
476
|
+
// also bind events to PhotoSwipe Core,
|
477
|
+
// if it's open.
|
478
|
+
|
479
|
+
(_this$pswp2 = this.pswp) === null || _this$pswp2 === void 0 || _this$pswp2.on(name, fn);
|
480
|
+
}
|
481
|
+
/**
|
482
|
+
* @template {keyof PhotoSwipeEventsMap} T
|
483
|
+
* @param {T} name
|
484
|
+
* @param {EventCallback<T>} fn
|
485
|
+
*/
|
486
|
+
|
487
|
+
|
488
|
+
off(name, fn) {
|
489
|
+
var _this$pswp3;
|
490
|
+
|
491
|
+
if (this._listeners[name]) {
|
492
|
+
// @ts-expect-error
|
493
|
+
this._listeners[name] = this._listeners[name].filter(listener => fn !== listener);
|
494
|
+
}
|
495
|
+
|
496
|
+
(_this$pswp3 = this.pswp) === null || _this$pswp3 === void 0 || _this$pswp3.off(name, fn);
|
497
|
+
}
|
498
|
+
/**
|
499
|
+
* @template {keyof PhotoSwipeEventsMap} T
|
500
|
+
* @param {T} name
|
501
|
+
* @param {PhotoSwipeEventsMap[T]} [details]
|
502
|
+
* @returns {AugmentedEvent<T>}
|
503
|
+
*/
|
504
|
+
|
505
|
+
|
506
|
+
dispatch(name, details) {
|
507
|
+
var _this$_listeners$name2;
|
508
|
+
|
509
|
+
if (this.pswp) {
|
510
|
+
return this.pswp.dispatch(name, details);
|
511
|
+
}
|
512
|
+
|
513
|
+
const event =
|
514
|
+
/** @type {AugmentedEvent<T>} */
|
515
|
+
new PhotoSwipeEvent(name, details);
|
516
|
+
(_this$_listeners$name2 = this._listeners[name]) === null || _this$_listeners$name2 === void 0 || _this$_listeners$name2.forEach(listener => {
|
517
|
+
listener.call(this, event);
|
518
|
+
});
|
519
|
+
return event;
|
520
|
+
}
|
521
|
+
|
522
|
+
}
|
523
|
+
|
524
|
+
class Placeholder {
|
525
|
+
/**
|
526
|
+
* @param {string | false} imageSrc
|
527
|
+
* @param {HTMLElement} container
|
528
|
+
*/
|
529
|
+
constructor(imageSrc, container) {
|
530
|
+
// Create placeholder
|
531
|
+
// (stretched thumbnail or simple div behind the main image)
|
532
|
+
|
533
|
+
/** @type {HTMLImageElement | HTMLDivElement | null} */
|
534
|
+
this.element = createElement('pswp__img pswp__img--placeholder', imageSrc ? 'img' : 'div', container);
|
535
|
+
|
536
|
+
if (imageSrc) {
|
537
|
+
const imgEl =
|
538
|
+
/** @type {HTMLImageElement} */
|
539
|
+
this.element;
|
540
|
+
imgEl.decoding = 'async';
|
541
|
+
imgEl.alt = '';
|
542
|
+
imgEl.src = imageSrc;
|
543
|
+
imgEl.setAttribute('role', 'presentation');
|
544
|
+
}
|
545
|
+
|
546
|
+
this.element.setAttribute('aria-hidden', 'true');
|
547
|
+
}
|
548
|
+
/**
|
549
|
+
* @param {number} width
|
550
|
+
* @param {number} height
|
551
|
+
*/
|
552
|
+
|
553
|
+
|
554
|
+
setDisplayedSize(width, height) {
|
555
|
+
if (!this.element) {
|
556
|
+
return;
|
557
|
+
}
|
558
|
+
|
559
|
+
if (this.element.tagName === 'IMG') {
|
560
|
+
// Use transform scale() to modify img placeholder size
|
561
|
+
// (instead of changing width/height directly).
|
562
|
+
// This helps with performance, specifically in iOS15 Safari.
|
563
|
+
setWidthHeight(this.element, 250, 'auto');
|
564
|
+
this.element.style.transformOrigin = '0 0';
|
565
|
+
this.element.style.transform = toTransformString(0, 0, width / 250);
|
566
|
+
} else {
|
567
|
+
setWidthHeight(this.element, width, height);
|
568
|
+
}
|
569
|
+
}
|
570
|
+
|
571
|
+
destroy() {
|
572
|
+
var _this$element;
|
573
|
+
|
574
|
+
if ((_this$element = this.element) !== null && _this$element !== void 0 && _this$element.parentNode) {
|
575
|
+
this.element.remove();
|
576
|
+
}
|
577
|
+
|
578
|
+
this.element = null;
|
579
|
+
}
|
580
|
+
|
581
|
+
}
|
582
|
+
|
583
|
+
/** @typedef {import('./slide.js').default} Slide */
|
584
|
+
|
585
|
+
/** @typedef {import('./slide.js').SlideData} SlideData */
|
586
|
+
|
587
|
+
/** @typedef {import('../core/base.js').default} PhotoSwipeBase */
|
588
|
+
|
589
|
+
/** @typedef {import('../util/util.js').LoadState} LoadState */
|
590
|
+
|
591
|
+
class Content {
|
592
|
+
/**
|
593
|
+
* @param {SlideData} itemData Slide data
|
594
|
+
* @param {PhotoSwipeBase} instance PhotoSwipe or PhotoSwipeLightbox instance
|
595
|
+
* @param {number} index
|
596
|
+
*/
|
597
|
+
constructor(itemData, instance, index) {
|
598
|
+
this.instance = instance;
|
599
|
+
this.data = itemData;
|
600
|
+
this.index = index;
|
601
|
+
/** @type {HTMLImageElement | HTMLDivElement | undefined} */
|
602
|
+
|
603
|
+
this.element = undefined;
|
604
|
+
/** @type {Placeholder | undefined} */
|
605
|
+
|
606
|
+
this.placeholder = undefined;
|
607
|
+
/** @type {Slide | undefined} */
|
608
|
+
|
609
|
+
this.slide = undefined;
|
610
|
+
this.displayedImageWidth = 0;
|
611
|
+
this.displayedImageHeight = 0;
|
612
|
+
this.width = Number(this.data.w) || Number(this.data.width) || 0;
|
613
|
+
this.height = Number(this.data.h) || Number(this.data.height) || 0;
|
614
|
+
this.isAttached = false;
|
615
|
+
this.hasSlide = false;
|
616
|
+
this.isDecoding = false;
|
617
|
+
/** @type {LoadState} */
|
618
|
+
|
619
|
+
this.state = LOAD_STATE.IDLE;
|
620
|
+
|
621
|
+
if (this.data.type) {
|
622
|
+
this.type = this.data.type;
|
623
|
+
} else if (this.data.src) {
|
624
|
+
this.type = 'image';
|
625
|
+
} else {
|
626
|
+
this.type = 'html';
|
627
|
+
}
|
628
|
+
|
629
|
+
this.instance.dispatch('contentInit', {
|
630
|
+
content: this
|
631
|
+
});
|
632
|
+
}
|
633
|
+
|
634
|
+
removePlaceholder() {
|
635
|
+
if (this.placeholder && !this.keepPlaceholder()) {
|
636
|
+
// With delay, as image might be loaded, but not rendered
|
637
|
+
setTimeout(() => {
|
638
|
+
if (this.placeholder) {
|
639
|
+
this.placeholder.destroy();
|
640
|
+
this.placeholder = undefined;
|
641
|
+
}
|
642
|
+
}, 1000);
|
643
|
+
}
|
644
|
+
}
|
645
|
+
/**
|
646
|
+
* Preload content
|
647
|
+
*
|
648
|
+
* @param {boolean} isLazy
|
649
|
+
* @param {boolean} [reload]
|
650
|
+
*/
|
651
|
+
|
652
|
+
|
653
|
+
load(isLazy, reload) {
|
654
|
+
if (this.slide && this.usePlaceholder()) {
|
655
|
+
if (!this.placeholder) {
|
656
|
+
const placeholderSrc = this.instance.applyFilters('placeholderSrc', // use image-based placeholder only for the first slide,
|
657
|
+
// as rendering (even small stretched thumbnail) is an expensive operation
|
658
|
+
this.data.msrc && this.slide.isFirstSlide ? this.data.msrc : false, this);
|
659
|
+
this.placeholder = new Placeholder(placeholderSrc, this.slide.container);
|
660
|
+
} else {
|
661
|
+
const placeholderEl = this.placeholder.element; // Add placeholder to DOM if it was already created
|
662
|
+
|
663
|
+
if (placeholderEl && !placeholderEl.parentElement) {
|
664
|
+
this.slide.container.prepend(placeholderEl);
|
665
|
+
}
|
666
|
+
}
|
667
|
+
}
|
668
|
+
|
669
|
+
if (this.element && !reload) {
|
670
|
+
return;
|
671
|
+
}
|
672
|
+
|
673
|
+
if (this.instance.dispatch('contentLoad', {
|
674
|
+
content: this,
|
675
|
+
isLazy
|
676
|
+
}).defaultPrevented) {
|
677
|
+
return;
|
678
|
+
}
|
679
|
+
|
680
|
+
if (this.isImageContent()) {
|
681
|
+
this.element = createElement('pswp__img', 'img'); // Start loading only after width is defined, as sizes might depend on it.
|
682
|
+
// Due to Safari feature, we must define sizes before srcset.
|
683
|
+
|
684
|
+
if (this.displayedImageWidth) {
|
685
|
+
this.loadImage(isLazy);
|
686
|
+
}
|
687
|
+
} else {
|
688
|
+
this.element = createElement('pswp__content', 'div');
|
689
|
+
this.element.innerHTML = this.data.html || '';
|
690
|
+
}
|
691
|
+
|
692
|
+
if (reload && this.slide) {
|
693
|
+
this.slide.updateContentSize(true);
|
694
|
+
}
|
695
|
+
}
|
696
|
+
/**
|
697
|
+
* Preload image
|
698
|
+
*
|
699
|
+
* @param {boolean} isLazy
|
700
|
+
*/
|
701
|
+
|
702
|
+
|
703
|
+
loadImage(isLazy) {
|
704
|
+
var _this$data$src, _this$data$alt;
|
705
|
+
|
706
|
+
if (!this.isImageContent() || !this.element || this.instance.dispatch('contentLoadImage', {
|
707
|
+
content: this,
|
708
|
+
isLazy
|
709
|
+
}).defaultPrevented) {
|
710
|
+
return;
|
711
|
+
}
|
712
|
+
|
713
|
+
const imageElement =
|
714
|
+
/** @type HTMLImageElement */
|
715
|
+
this.element;
|
716
|
+
this.updateSrcsetSizes();
|
717
|
+
|
718
|
+
if (this.data.srcset) {
|
719
|
+
imageElement.srcset = this.data.srcset;
|
720
|
+
}
|
721
|
+
|
722
|
+
imageElement.src = (_this$data$src = this.data.src) !== null && _this$data$src !== void 0 ? _this$data$src : '';
|
723
|
+
imageElement.alt = (_this$data$alt = this.data.alt) !== null && _this$data$alt !== void 0 ? _this$data$alt : '';
|
724
|
+
this.state = LOAD_STATE.LOADING;
|
725
|
+
|
726
|
+
if (imageElement.complete) {
|
727
|
+
this.onLoaded();
|
728
|
+
} else {
|
729
|
+
imageElement.onload = () => {
|
730
|
+
this.onLoaded();
|
731
|
+
};
|
732
|
+
|
733
|
+
imageElement.onerror = () => {
|
734
|
+
this.onError();
|
735
|
+
};
|
736
|
+
}
|
737
|
+
}
|
738
|
+
/**
|
739
|
+
* Assign slide to content
|
740
|
+
*
|
741
|
+
* @param {Slide} slide
|
742
|
+
*/
|
743
|
+
|
744
|
+
|
745
|
+
setSlide(slide) {
|
746
|
+
this.slide = slide;
|
747
|
+
this.hasSlide = true;
|
748
|
+
this.instance = slide.pswp; // todo: do we need to unset slide?
|
749
|
+
}
|
750
|
+
/**
|
751
|
+
* Content load success handler
|
752
|
+
*/
|
753
|
+
|
754
|
+
|
755
|
+
onLoaded() {
|
756
|
+
this.state = LOAD_STATE.LOADED;
|
757
|
+
|
758
|
+
if (this.slide && this.element) {
|
759
|
+
this.instance.dispatch('loadComplete', {
|
760
|
+
slide: this.slide,
|
761
|
+
content: this
|
762
|
+
}); // if content is reloaded
|
763
|
+
|
764
|
+
if (this.slide.isActive && this.slide.heavyAppended && !this.element.parentNode) {
|
765
|
+
this.append();
|
766
|
+
this.slide.updateContentSize(true);
|
767
|
+
}
|
768
|
+
|
769
|
+
if (this.state === LOAD_STATE.LOADED || this.state === LOAD_STATE.ERROR) {
|
770
|
+
this.removePlaceholder();
|
771
|
+
}
|
772
|
+
}
|
773
|
+
}
|
774
|
+
/**
|
775
|
+
* Content load error handler
|
776
|
+
*/
|
777
|
+
|
778
|
+
|
779
|
+
onError() {
|
780
|
+
this.state = LOAD_STATE.ERROR;
|
781
|
+
|
782
|
+
if (this.slide) {
|
783
|
+
this.displayError();
|
784
|
+
this.instance.dispatch('loadComplete', {
|
785
|
+
slide: this.slide,
|
786
|
+
isError: true,
|
787
|
+
content: this
|
788
|
+
});
|
789
|
+
this.instance.dispatch('loadError', {
|
790
|
+
slide: this.slide,
|
791
|
+
content: this
|
792
|
+
});
|
793
|
+
}
|
794
|
+
}
|
795
|
+
/**
|
796
|
+
* @returns {Boolean} If the content is currently loading
|
797
|
+
*/
|
798
|
+
|
799
|
+
|
800
|
+
isLoading() {
|
801
|
+
return this.instance.applyFilters('isContentLoading', this.state === LOAD_STATE.LOADING, this);
|
802
|
+
}
|
803
|
+
/**
|
804
|
+
* @returns {Boolean} If the content is in error state
|
805
|
+
*/
|
806
|
+
|
807
|
+
|
808
|
+
isError() {
|
809
|
+
return this.state === LOAD_STATE.ERROR;
|
810
|
+
}
|
811
|
+
/**
|
812
|
+
* @returns {boolean} If the content is image
|
813
|
+
*/
|
814
|
+
|
815
|
+
|
816
|
+
isImageContent() {
|
817
|
+
return this.type === 'image';
|
818
|
+
}
|
819
|
+
/**
|
820
|
+
* Update content size
|
821
|
+
*
|
822
|
+
* @param {Number} width
|
823
|
+
* @param {Number} height
|
824
|
+
*/
|
825
|
+
|
826
|
+
|
827
|
+
setDisplayedSize(width, height) {
|
828
|
+
if (!this.element) {
|
829
|
+
return;
|
830
|
+
}
|
831
|
+
|
832
|
+
if (this.placeholder) {
|
833
|
+
this.placeholder.setDisplayedSize(width, height);
|
834
|
+
}
|
835
|
+
|
836
|
+
if (this.instance.dispatch('contentResize', {
|
837
|
+
content: this,
|
838
|
+
width,
|
839
|
+
height
|
840
|
+
}).defaultPrevented) {
|
841
|
+
return;
|
842
|
+
}
|
843
|
+
|
844
|
+
setWidthHeight(this.element, width, height);
|
845
|
+
|
846
|
+
if (this.isImageContent() && !this.isError()) {
|
847
|
+
const isInitialSizeUpdate = !this.displayedImageWidth && width;
|
848
|
+
this.displayedImageWidth = width;
|
849
|
+
this.displayedImageHeight = height;
|
850
|
+
|
851
|
+
if (isInitialSizeUpdate) {
|
852
|
+
this.loadImage(false);
|
853
|
+
} else {
|
854
|
+
this.updateSrcsetSizes();
|
855
|
+
}
|
856
|
+
|
857
|
+
if (this.slide) {
|
858
|
+
this.instance.dispatch('imageSizeChange', {
|
859
|
+
slide: this.slide,
|
860
|
+
width,
|
861
|
+
height,
|
862
|
+
content: this
|
863
|
+
});
|
864
|
+
}
|
865
|
+
}
|
866
|
+
}
|
867
|
+
/**
|
868
|
+
* @returns {boolean} If the content can be zoomed
|
869
|
+
*/
|
870
|
+
|
871
|
+
|
872
|
+
isZoomable() {
|
873
|
+
return this.instance.applyFilters('isContentZoomable', this.isImageContent() && this.state !== LOAD_STATE.ERROR, this);
|
874
|
+
}
|
875
|
+
/**
|
876
|
+
* Update image srcset sizes attribute based on width and height
|
877
|
+
*/
|
878
|
+
|
879
|
+
|
880
|
+
updateSrcsetSizes() {
|
881
|
+
// Handle srcset sizes attribute.
|
882
|
+
//
|
883
|
+
// Never lower quality, if it was increased previously.
|
884
|
+
// Chrome does this automatically, Firefox and Safari do not,
|
885
|
+
// so we store largest used size in dataset.
|
886
|
+
if (!this.isImageContent() || !this.element || !this.data.srcset) {
|
887
|
+
return;
|
888
|
+
}
|
889
|
+
|
890
|
+
const image =
|
891
|
+
/** @type HTMLImageElement */
|
892
|
+
this.element;
|
893
|
+
const sizesWidth = this.instance.applyFilters('srcsetSizesWidth', this.displayedImageWidth, this);
|
894
|
+
|
895
|
+
if (!image.dataset.largestUsedSize || sizesWidth > parseInt(image.dataset.largestUsedSize, 10)) {
|
896
|
+
image.sizes = sizesWidth + 'px';
|
897
|
+
image.dataset.largestUsedSize = String(sizesWidth);
|
898
|
+
}
|
899
|
+
}
|
900
|
+
/**
|
901
|
+
* @returns {boolean} If content should use a placeholder (from msrc by default)
|
902
|
+
*/
|
903
|
+
|
904
|
+
|
905
|
+
usePlaceholder() {
|
906
|
+
return this.instance.applyFilters('useContentPlaceholder', this.isImageContent(), this);
|
907
|
+
}
|
908
|
+
/**
|
909
|
+
* Preload content with lazy-loading param
|
910
|
+
*/
|
911
|
+
|
912
|
+
|
913
|
+
lazyLoad() {
|
914
|
+
if (this.instance.dispatch('contentLazyLoad', {
|
915
|
+
content: this
|
916
|
+
}).defaultPrevented) {
|
917
|
+
return;
|
918
|
+
}
|
919
|
+
|
920
|
+
this.load(true);
|
921
|
+
}
|
922
|
+
/**
|
923
|
+
* @returns {boolean} If placeholder should be kept after content is loaded
|
924
|
+
*/
|
925
|
+
|
926
|
+
|
927
|
+
keepPlaceholder() {
|
928
|
+
return this.instance.applyFilters('isKeepingPlaceholder', this.isLoading(), this);
|
929
|
+
}
|
930
|
+
/**
|
931
|
+
* Destroy the content
|
932
|
+
*/
|
933
|
+
|
934
|
+
|
935
|
+
destroy() {
|
936
|
+
this.hasSlide = false;
|
937
|
+
this.slide = undefined;
|
938
|
+
|
939
|
+
if (this.instance.dispatch('contentDestroy', {
|
940
|
+
content: this
|
941
|
+
}).defaultPrevented) {
|
942
|
+
return;
|
943
|
+
}
|
944
|
+
|
945
|
+
this.remove();
|
946
|
+
|
947
|
+
if (this.placeholder) {
|
948
|
+
this.placeholder.destroy();
|
949
|
+
this.placeholder = undefined;
|
950
|
+
}
|
951
|
+
|
952
|
+
if (this.isImageContent() && this.element) {
|
953
|
+
this.element.onload = null;
|
954
|
+
this.element.onerror = null;
|
955
|
+
this.element = undefined;
|
956
|
+
}
|
957
|
+
}
|
958
|
+
/**
|
959
|
+
* Display error message
|
960
|
+
*/
|
961
|
+
|
962
|
+
|
963
|
+
displayError() {
|
964
|
+
if (this.slide) {
|
965
|
+
var _this$instance$option, _this$instance$option2;
|
966
|
+
|
967
|
+
let errorMsgEl = createElement('pswp__error-msg', 'div');
|
968
|
+
errorMsgEl.innerText = (_this$instance$option = (_this$instance$option2 = this.instance.options) === null || _this$instance$option2 === void 0 ? void 0 : _this$instance$option2.errorMsg) !== null && _this$instance$option !== void 0 ? _this$instance$option : '';
|
969
|
+
errorMsgEl =
|
970
|
+
/** @type {HTMLDivElement} */
|
971
|
+
this.instance.applyFilters('contentErrorElement', errorMsgEl, this);
|
972
|
+
this.element = createElement('pswp__content pswp__error-msg-container', 'div');
|
973
|
+
this.element.appendChild(errorMsgEl);
|
974
|
+
this.slide.container.innerText = '';
|
975
|
+
this.slide.container.appendChild(this.element);
|
976
|
+
this.slide.updateContentSize(true);
|
977
|
+
this.removePlaceholder();
|
978
|
+
}
|
979
|
+
}
|
980
|
+
/**
|
981
|
+
* Append the content
|
982
|
+
*/
|
983
|
+
|
984
|
+
|
985
|
+
append() {
|
986
|
+
if (this.isAttached || !this.element) {
|
987
|
+
return;
|
988
|
+
}
|
989
|
+
|
990
|
+
this.isAttached = true;
|
991
|
+
|
992
|
+
if (this.state === LOAD_STATE.ERROR) {
|
993
|
+
this.displayError();
|
994
|
+
return;
|
995
|
+
}
|
996
|
+
|
997
|
+
if (this.instance.dispatch('contentAppend', {
|
998
|
+
content: this
|
999
|
+
}).defaultPrevented) {
|
1000
|
+
return;
|
1001
|
+
}
|
1002
|
+
|
1003
|
+
const supportsDecode = ('decode' in this.element);
|
1004
|
+
|
1005
|
+
if (this.isImageContent()) {
|
1006
|
+
// Use decode() on nearby slides
|
1007
|
+
//
|
1008
|
+
// Nearby slide images are in DOM and not hidden via display:none.
|
1009
|
+
// However, they are placed offscreen (to the left and right side).
|
1010
|
+
//
|
1011
|
+
// Some browsers do not composite the image until it's actually visible,
|
1012
|
+
// using decode() helps.
|
1013
|
+
//
|
1014
|
+
// You might ask "why dont you just decode() and then append all images",
|
1015
|
+
// that's because I want to show image before it's fully loaded,
|
1016
|
+
// as browser can render parts of image while it is loading.
|
1017
|
+
// We do not do this in Safari due to partial loading bug.
|
1018
|
+
if (supportsDecode && this.slide && (!this.slide.isActive || isSafari())) {
|
1019
|
+
this.isDecoding = true; // purposefully using finally instead of then,
|
1020
|
+
// as if srcset sizes changes dynamically - it may cause decode error
|
1021
|
+
|
1022
|
+
/** @type {HTMLImageElement} */
|
1023
|
+
|
1024
|
+
this.element.decode().catch(() => {}).finally(() => {
|
1025
|
+
this.isDecoding = false;
|
1026
|
+
this.appendImage();
|
1027
|
+
});
|
1028
|
+
} else {
|
1029
|
+
this.appendImage();
|
1030
|
+
}
|
1031
|
+
} else if (this.slide && !this.element.parentNode) {
|
1032
|
+
this.slide.container.appendChild(this.element);
|
1033
|
+
}
|
1034
|
+
}
|
1035
|
+
/**
|
1036
|
+
* Activate the slide,
|
1037
|
+
* active slide is generally the current one,
|
1038
|
+
* meaning the user can see it.
|
1039
|
+
*/
|
1040
|
+
|
1041
|
+
|
1042
|
+
activate() {
|
1043
|
+
if (this.instance.dispatch('contentActivate', {
|
1044
|
+
content: this
|
1045
|
+
}).defaultPrevented || !this.slide) {
|
1046
|
+
return;
|
1047
|
+
}
|
1048
|
+
|
1049
|
+
if (this.isImageContent() && this.isDecoding && !isSafari()) {
|
1050
|
+
// add image to slide when it becomes active,
|
1051
|
+
// even if it's not finished decoding
|
1052
|
+
this.appendImage();
|
1053
|
+
} else if (this.isError()) {
|
1054
|
+
this.load(false, true); // try to reload
|
1055
|
+
}
|
1056
|
+
|
1057
|
+
if (this.slide.holderElement) {
|
1058
|
+
this.slide.holderElement.setAttribute('aria-hidden', 'false');
|
1059
|
+
}
|
1060
|
+
}
|
1061
|
+
/**
|
1062
|
+
* Deactivate the content
|
1063
|
+
*/
|
1064
|
+
|
1065
|
+
|
1066
|
+
deactivate() {
|
1067
|
+
this.instance.dispatch('contentDeactivate', {
|
1068
|
+
content: this
|
1069
|
+
});
|
1070
|
+
|
1071
|
+
if (this.slide && this.slide.holderElement) {
|
1072
|
+
this.slide.holderElement.setAttribute('aria-hidden', 'true');
|
1073
|
+
}
|
1074
|
+
}
|
1075
|
+
/**
|
1076
|
+
* Remove the content from DOM
|
1077
|
+
*/
|
1078
|
+
|
1079
|
+
|
1080
|
+
remove() {
|
1081
|
+
this.isAttached = false;
|
1082
|
+
|
1083
|
+
if (this.instance.dispatch('contentRemove', {
|
1084
|
+
content: this
|
1085
|
+
}).defaultPrevented) {
|
1086
|
+
return;
|
1087
|
+
}
|
1088
|
+
|
1089
|
+
if (this.element && this.element.parentNode) {
|
1090
|
+
this.element.remove();
|
1091
|
+
}
|
1092
|
+
|
1093
|
+
if (this.placeholder && this.placeholder.element) {
|
1094
|
+
this.placeholder.element.remove();
|
1095
|
+
}
|
1096
|
+
}
|
1097
|
+
/**
|
1098
|
+
* Append the image content to slide container
|
1099
|
+
*/
|
1100
|
+
|
1101
|
+
|
1102
|
+
appendImage() {
|
1103
|
+
if (!this.isAttached) {
|
1104
|
+
return;
|
1105
|
+
}
|
1106
|
+
|
1107
|
+
if (this.instance.dispatch('contentAppendImage', {
|
1108
|
+
content: this
|
1109
|
+
}).defaultPrevented) {
|
1110
|
+
return;
|
1111
|
+
} // ensure that element exists and is not already appended
|
1112
|
+
|
1113
|
+
|
1114
|
+
if (this.slide && this.element && !this.element.parentNode) {
|
1115
|
+
this.slide.container.appendChild(this.element);
|
1116
|
+
}
|
1117
|
+
|
1118
|
+
if (this.state === LOAD_STATE.LOADED || this.state === LOAD_STATE.ERROR) {
|
1119
|
+
this.removePlaceholder();
|
1120
|
+
}
|
1121
|
+
}
|
1122
|
+
|
1123
|
+
}
|
1124
|
+
|
1125
|
+
/** @typedef {import('../photoswipe.js').PhotoSwipeOptions} PhotoSwipeOptions */
|
1126
|
+
|
1127
|
+
/** @typedef {import('../core/base.js').default} PhotoSwipeBase */
|
1128
|
+
|
1129
|
+
/** @typedef {import('../photoswipe.js').Point} Point */
|
1130
|
+
|
1131
|
+
/** @typedef {import('../slide/slide.js').SlideData} SlideData */
|
1132
|
+
|
1133
|
+
/**
|
1134
|
+
* @param {PhotoSwipeOptions} options
|
1135
|
+
* @param {PhotoSwipeBase} pswp
|
1136
|
+
* @returns {Point}
|
1137
|
+
*/
|
1138
|
+
function getViewportSize(options, pswp) {
|
1139
|
+
if (options.getViewportSizeFn) {
|
1140
|
+
const newViewportSize = options.getViewportSizeFn(options, pswp);
|
1141
|
+
|
1142
|
+
if (newViewportSize) {
|
1143
|
+
return newViewportSize;
|
1144
|
+
}
|
1145
|
+
}
|
1146
|
+
|
1147
|
+
return {
|
1148
|
+
x: document.documentElement.clientWidth,
|
1149
|
+
// TODO: height on mobile is very incosistent due to toolbar
|
1150
|
+
// find a way to improve this
|
1151
|
+
//
|
1152
|
+
// document.documentElement.clientHeight - doesn't seem to work well
|
1153
|
+
y: window.innerHeight
|
1154
|
+
};
|
1155
|
+
}
|
1156
|
+
/**
|
1157
|
+
* Parses padding option.
|
1158
|
+
* Supported formats:
|
1159
|
+
*
|
1160
|
+
* // Object
|
1161
|
+
* padding: {
|
1162
|
+
* top: 0,
|
1163
|
+
* bottom: 0,
|
1164
|
+
* left: 0,
|
1165
|
+
* right: 0
|
1166
|
+
* }
|
1167
|
+
*
|
1168
|
+
* // A function that returns the object
|
1169
|
+
* paddingFn: (viewportSize, itemData, index) => {
|
1170
|
+
* return {
|
1171
|
+
* top: 0,
|
1172
|
+
* bottom: 0,
|
1173
|
+
* left: 0,
|
1174
|
+
* right: 0
|
1175
|
+
* };
|
1176
|
+
* }
|
1177
|
+
*
|
1178
|
+
* // Legacy variant
|
1179
|
+
* paddingLeft: 0,
|
1180
|
+
* paddingRight: 0,
|
1181
|
+
* paddingTop: 0,
|
1182
|
+
* paddingBottom: 0,
|
1183
|
+
*
|
1184
|
+
* @param {'left' | 'top' | 'bottom' | 'right'} prop
|
1185
|
+
* @param {PhotoSwipeOptions} options PhotoSwipe options
|
1186
|
+
* @param {Point} viewportSize PhotoSwipe viewport size, for example: { x:800, y:600 }
|
1187
|
+
* @param {SlideData} itemData Data about the slide
|
1188
|
+
* @param {number} index Slide index
|
1189
|
+
* @returns {number}
|
1190
|
+
*/
|
1191
|
+
|
1192
|
+
function parsePaddingOption(prop, options, viewportSize, itemData, index) {
|
1193
|
+
let paddingValue = 0;
|
1194
|
+
|
1195
|
+
if (options.paddingFn) {
|
1196
|
+
paddingValue = options.paddingFn(viewportSize, itemData, index)[prop];
|
1197
|
+
} else if (options.padding) {
|
1198
|
+
paddingValue = options.padding[prop];
|
1199
|
+
} else {
|
1200
|
+
const legacyPropName = 'padding' + prop[0].toUpperCase() + prop.slice(1); // @ts-expect-error
|
1201
|
+
|
1202
|
+
if (options[legacyPropName]) {
|
1203
|
+
// @ts-expect-error
|
1204
|
+
paddingValue = options[legacyPropName];
|
1205
|
+
}
|
1206
|
+
}
|
1207
|
+
|
1208
|
+
return Number(paddingValue) || 0;
|
1209
|
+
}
|
1210
|
+
/**
|
1211
|
+
* @param {PhotoSwipeOptions} options
|
1212
|
+
* @param {Point} viewportSize
|
1213
|
+
* @param {SlideData} itemData
|
1214
|
+
* @param {number} index
|
1215
|
+
* @returns {Point}
|
1216
|
+
*/
|
1217
|
+
|
1218
|
+
function getPanAreaSize(options, viewportSize, itemData, index) {
|
1219
|
+
return {
|
1220
|
+
x: viewportSize.x - parsePaddingOption('left', options, viewportSize, itemData, index) - parsePaddingOption('right', options, viewportSize, itemData, index),
|
1221
|
+
y: viewportSize.y - parsePaddingOption('top', options, viewportSize, itemData, index) - parsePaddingOption('bottom', options, viewportSize, itemData, index)
|
1222
|
+
};
|
1223
|
+
}
|
1224
|
+
|
1225
|
+
const MAX_IMAGE_WIDTH = 4000;
|
1226
|
+
/** @typedef {import('../photoswipe.js').default} PhotoSwipe */
|
1227
|
+
|
1228
|
+
/** @typedef {import('../photoswipe.js').PhotoSwipeOptions} PhotoSwipeOptions */
|
1229
|
+
|
1230
|
+
/** @typedef {import('../photoswipe.js').Point} Point */
|
1231
|
+
|
1232
|
+
/** @typedef {import('../slide/slide.js').SlideData} SlideData */
|
1233
|
+
|
1234
|
+
/** @typedef {'fit' | 'fill' | number | ((zoomLevelObject: ZoomLevel) => number)} ZoomLevelOption */
|
1235
|
+
|
1236
|
+
/**
|
1237
|
+
* Calculates zoom levels for specific slide.
|
1238
|
+
* Depends on viewport size and image size.
|
1239
|
+
*/
|
1240
|
+
|
1241
|
+
class ZoomLevel {
|
1242
|
+
/**
|
1243
|
+
* @param {PhotoSwipeOptions} options PhotoSwipe options
|
1244
|
+
* @param {SlideData} itemData Slide data
|
1245
|
+
* @param {number} index Slide index
|
1246
|
+
* @param {PhotoSwipe} [pswp] PhotoSwipe instance, can be undefined if not initialized yet
|
1247
|
+
*/
|
1248
|
+
constructor(options, itemData, index, pswp) {
|
1249
|
+
this.pswp = pswp;
|
1250
|
+
this.options = options;
|
1251
|
+
this.itemData = itemData;
|
1252
|
+
this.index = index;
|
1253
|
+
/** @type { Point | null } */
|
1254
|
+
|
1255
|
+
this.panAreaSize = null;
|
1256
|
+
/** @type { Point | null } */
|
1257
|
+
|
1258
|
+
this.elementSize = null;
|
1259
|
+
this.fit = 1;
|
1260
|
+
this.fill = 1;
|
1261
|
+
this.vFill = 1;
|
1262
|
+
this.initial = 1;
|
1263
|
+
this.secondary = 1;
|
1264
|
+
this.max = 1;
|
1265
|
+
this.min = 1;
|
1266
|
+
}
|
1267
|
+
/**
|
1268
|
+
* Calculate initial, secondary and maximum zoom level for the specified slide.
|
1269
|
+
*
|
1270
|
+
* It should be called when either image or viewport size changes.
|
1271
|
+
*
|
1272
|
+
* @param {number} maxWidth
|
1273
|
+
* @param {number} maxHeight
|
1274
|
+
* @param {Point} panAreaSize
|
1275
|
+
*/
|
1276
|
+
|
1277
|
+
|
1278
|
+
update(maxWidth, maxHeight, panAreaSize) {
|
1279
|
+
/** @type {Point} */
|
1280
|
+
const elementSize = {
|
1281
|
+
x: maxWidth,
|
1282
|
+
y: maxHeight
|
1283
|
+
};
|
1284
|
+
this.elementSize = elementSize;
|
1285
|
+
this.panAreaSize = panAreaSize;
|
1286
|
+
const hRatio = panAreaSize.x / elementSize.x;
|
1287
|
+
const vRatio = panAreaSize.y / elementSize.y;
|
1288
|
+
this.fit = Math.min(1, hRatio < vRatio ? hRatio : vRatio);
|
1289
|
+
this.fill = Math.min(1, hRatio > vRatio ? hRatio : vRatio); // zoom.vFill defines zoom level of the image
|
1290
|
+
// when it has 100% of viewport vertical space (height)
|
1291
|
+
|
1292
|
+
this.vFill = Math.min(1, vRatio);
|
1293
|
+
this.initial = this._getInitial();
|
1294
|
+
this.secondary = this._getSecondary();
|
1295
|
+
this.max = Math.max(this.initial, this.secondary, this._getMax());
|
1296
|
+
this.min = Math.min(this.fit, this.initial, this.secondary);
|
1297
|
+
|
1298
|
+
if (this.pswp) {
|
1299
|
+
this.pswp.dispatch('zoomLevelsUpdate', {
|
1300
|
+
zoomLevels: this,
|
1301
|
+
slideData: this.itemData
|
1302
|
+
});
|
1303
|
+
}
|
1304
|
+
}
|
1305
|
+
/**
|
1306
|
+
* Parses user-defined zoom option.
|
1307
|
+
*
|
1308
|
+
* @private
|
1309
|
+
* @param {'initial' | 'secondary' | 'max'} optionPrefix Zoom level option prefix (initial, secondary, max)
|
1310
|
+
* @returns { number | undefined }
|
1311
|
+
*/
|
1312
|
+
|
1313
|
+
|
1314
|
+
_parseZoomLevelOption(optionPrefix) {
|
1315
|
+
const optionName =
|
1316
|
+
/** @type {'initialZoomLevel' | 'secondaryZoomLevel' | 'maxZoomLevel'} */
|
1317
|
+
optionPrefix + 'ZoomLevel';
|
1318
|
+
const optionValue = this.options[optionName];
|
1319
|
+
|
1320
|
+
if (!optionValue) {
|
1321
|
+
return;
|
1322
|
+
}
|
1323
|
+
|
1324
|
+
if (typeof optionValue === 'function') {
|
1325
|
+
return optionValue(this);
|
1326
|
+
}
|
1327
|
+
|
1328
|
+
if (optionValue === 'fill') {
|
1329
|
+
return this.fill;
|
1330
|
+
}
|
1331
|
+
|
1332
|
+
if (optionValue === 'fit') {
|
1333
|
+
return this.fit;
|
1334
|
+
}
|
1335
|
+
|
1336
|
+
return Number(optionValue);
|
1337
|
+
}
|
1338
|
+
/**
|
1339
|
+
* Get zoom level to which image will be zoomed after double-tap gesture,
|
1340
|
+
* or when user clicks on zoom icon,
|
1341
|
+
* or mouse-click on image itself.
|
1342
|
+
* If you return 1 image will be zoomed to its original size.
|
1343
|
+
*
|
1344
|
+
* @private
|
1345
|
+
* @return {number}
|
1346
|
+
*/
|
1347
|
+
|
1348
|
+
|
1349
|
+
_getSecondary() {
|
1350
|
+
let currZoomLevel = this._parseZoomLevelOption('secondary');
|
1351
|
+
|
1352
|
+
if (currZoomLevel) {
|
1353
|
+
return currZoomLevel;
|
1354
|
+
} // 3x of "fit" state, but not larger than original
|
1355
|
+
|
1356
|
+
|
1357
|
+
currZoomLevel = Math.min(1, this.fit * 3);
|
1358
|
+
|
1359
|
+
if (this.elementSize && currZoomLevel * this.elementSize.x > MAX_IMAGE_WIDTH) {
|
1360
|
+
currZoomLevel = MAX_IMAGE_WIDTH / this.elementSize.x;
|
1361
|
+
}
|
1362
|
+
|
1363
|
+
return currZoomLevel;
|
1364
|
+
}
|
1365
|
+
/**
|
1366
|
+
* Get initial image zoom level.
|
1367
|
+
*
|
1368
|
+
* @private
|
1369
|
+
* @return {number}
|
1370
|
+
*/
|
1371
|
+
|
1372
|
+
|
1373
|
+
_getInitial() {
|
1374
|
+
return this._parseZoomLevelOption('initial') || this.fit;
|
1375
|
+
}
|
1376
|
+
/**
|
1377
|
+
* Maximum zoom level when user zooms
|
1378
|
+
* via zoom/pinch gesture,
|
1379
|
+
* via cmd/ctrl-wheel or via trackpad.
|
1380
|
+
*
|
1381
|
+
* @private
|
1382
|
+
* @return {number}
|
1383
|
+
*/
|
1384
|
+
|
1385
|
+
|
1386
|
+
_getMax() {
|
1387
|
+
// max zoom level is x4 from "fit state",
|
1388
|
+
// used for zoom gesture and ctrl/trackpad zoom
|
1389
|
+
return this._parseZoomLevelOption('max') || Math.max(1, this.fit * 4);
|
1390
|
+
}
|
1391
|
+
|
1392
|
+
}
|
1393
|
+
|
1394
|
+
/**
|
1395
|
+
* Lazy-load an image
|
1396
|
+
* This function is used both by Lightbox and PhotoSwipe core,
|
1397
|
+
* thus it can be called before dialog is opened.
|
1398
|
+
*
|
1399
|
+
* @param {SlideData} itemData Data about the slide
|
1400
|
+
* @param {PhotoSwipeBase} instance PhotoSwipe or PhotoSwipeLightbox instance
|
1401
|
+
* @param {number} index
|
1402
|
+
* @returns {Content} Image that is being decoded or false.
|
1403
|
+
*/
|
1404
|
+
|
1405
|
+
function lazyLoadData(itemData, instance, index) {
|
1406
|
+
const content = instance.createContentFromData(itemData, index);
|
1407
|
+
/** @type {ZoomLevel | undefined} */
|
1408
|
+
|
1409
|
+
let zoomLevel;
|
1410
|
+
const {
|
1411
|
+
options
|
1412
|
+
} = instance; // We need to know dimensions of the image to preload it,
|
1413
|
+
// as it might use srcset, and we need to define sizes
|
1414
|
+
|
1415
|
+
if (options) {
|
1416
|
+
zoomLevel = new ZoomLevel(options, itemData, -1);
|
1417
|
+
let viewportSize;
|
1418
|
+
|
1419
|
+
if (instance.pswp) {
|
1420
|
+
viewportSize = instance.pswp.viewportSize;
|
1421
|
+
} else {
|
1422
|
+
viewportSize = getViewportSize(options, instance);
|
1423
|
+
}
|
1424
|
+
|
1425
|
+
const panAreaSize = getPanAreaSize(options, viewportSize, itemData, index);
|
1426
|
+
zoomLevel.update(content.width, content.height, panAreaSize);
|
1427
|
+
}
|
1428
|
+
|
1429
|
+
content.lazyLoad();
|
1430
|
+
|
1431
|
+
if (zoomLevel) {
|
1432
|
+
content.setDisplayedSize(Math.ceil(content.width * zoomLevel.initial), Math.ceil(content.height * zoomLevel.initial));
|
1433
|
+
}
|
1434
|
+
|
1435
|
+
return content;
|
1436
|
+
}
|
1437
|
+
/**
|
1438
|
+
* Lazy-loads specific slide.
|
1439
|
+
* This function is used both by Lightbox and PhotoSwipe core,
|
1440
|
+
* thus it can be called before dialog is opened.
|
1441
|
+
*
|
1442
|
+
* By default, it loads image based on viewport size and initial zoom level.
|
1443
|
+
*
|
1444
|
+
* @param {number} index Slide index
|
1445
|
+
* @param {PhotoSwipeBase} instance PhotoSwipe or PhotoSwipeLightbox eventable instance
|
1446
|
+
* @returns {Content | undefined}
|
1447
|
+
*/
|
1448
|
+
|
1449
|
+
function lazyLoadSlide(index, instance) {
|
1450
|
+
const itemData = instance.getItemData(index);
|
1451
|
+
|
1452
|
+
if (instance.dispatch('lazyLoadSlide', {
|
1453
|
+
index,
|
1454
|
+
itemData
|
1455
|
+
}).defaultPrevented) {
|
1456
|
+
return;
|
1457
|
+
}
|
1458
|
+
|
1459
|
+
return lazyLoadData(itemData, instance, index);
|
1460
|
+
}
|
1461
|
+
|
1462
|
+
/** @typedef {import("../photoswipe.js").default} PhotoSwipe */
|
1463
|
+
|
1464
|
+
/** @typedef {import("../slide/slide.js").SlideData} SlideData */
|
1465
|
+
|
1466
|
+
/**
|
1467
|
+
* PhotoSwipe base class that can retrieve data about every slide.
|
1468
|
+
* Shared by PhotoSwipe Core and PhotoSwipe Lightbox
|
1469
|
+
*/
|
1470
|
+
|
1471
|
+
class PhotoSwipeBase extends Eventable {
|
1472
|
+
/**
|
1473
|
+
* Get total number of slides
|
1474
|
+
*
|
1475
|
+
* @returns {number}
|
1476
|
+
*/
|
1477
|
+
getNumItems() {
|
1478
|
+
var _this$options;
|
1479
|
+
|
1480
|
+
let numItems = 0;
|
1481
|
+
const dataSource = (_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.dataSource;
|
1482
|
+
|
1483
|
+
if (dataSource && 'length' in dataSource) {
|
1484
|
+
// may be an array or just object with length property
|
1485
|
+
numItems = dataSource.length;
|
1486
|
+
} else if (dataSource && 'gallery' in dataSource) {
|
1487
|
+
// query DOM elements
|
1488
|
+
if (!dataSource.items) {
|
1489
|
+
dataSource.items = this._getGalleryDOMElements(dataSource.gallery);
|
1490
|
+
}
|
1491
|
+
|
1492
|
+
if (dataSource.items) {
|
1493
|
+
numItems = dataSource.items.length;
|
1494
|
+
}
|
1495
|
+
} // legacy event, before filters were introduced
|
1496
|
+
|
1497
|
+
|
1498
|
+
const event = this.dispatch('numItems', {
|
1499
|
+
dataSource,
|
1500
|
+
numItems
|
1501
|
+
});
|
1502
|
+
return this.applyFilters('numItems', event.numItems, dataSource);
|
1503
|
+
}
|
1504
|
+
/**
|
1505
|
+
* @param {SlideData} slideData
|
1506
|
+
* @param {number} index
|
1507
|
+
* @returns {Content}
|
1508
|
+
*/
|
1509
|
+
|
1510
|
+
|
1511
|
+
createContentFromData(slideData, index) {
|
1512
|
+
return new Content(slideData, this, index);
|
1513
|
+
}
|
1514
|
+
/**
|
1515
|
+
* Get item data by index.
|
1516
|
+
*
|
1517
|
+
* "item data" should contain normalized information that PhotoSwipe needs to generate a slide.
|
1518
|
+
* For example, it may contain properties like
|
1519
|
+
* `src`, `srcset`, `w`, `h`, which will be used to generate a slide with image.
|
1520
|
+
*
|
1521
|
+
* @param {number} index
|
1522
|
+
* @returns {SlideData}
|
1523
|
+
*/
|
1524
|
+
|
1525
|
+
|
1526
|
+
getItemData(index) {
|
1527
|
+
var _this$options2;
|
1528
|
+
|
1529
|
+
const dataSource = (_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.dataSource;
|
1530
|
+
/** @type {SlideData | HTMLElement} */
|
1531
|
+
|
1532
|
+
let dataSourceItem = {};
|
1533
|
+
|
1534
|
+
if (Array.isArray(dataSource)) {
|
1535
|
+
// Datasource is an array of elements
|
1536
|
+
dataSourceItem = dataSource[index];
|
1537
|
+
} else if (dataSource && 'gallery' in dataSource) {
|
1538
|
+
// dataSource has gallery property,
|
1539
|
+
// thus it was created by Lightbox, based on
|
1540
|
+
// gallery and children options
|
1541
|
+
// query DOM elements
|
1542
|
+
if (!dataSource.items) {
|
1543
|
+
dataSource.items = this._getGalleryDOMElements(dataSource.gallery);
|
1544
|
+
}
|
1545
|
+
|
1546
|
+
dataSourceItem = dataSource.items[index];
|
1547
|
+
}
|
1548
|
+
|
1549
|
+
let itemData = dataSourceItem;
|
1550
|
+
|
1551
|
+
if (itemData instanceof Element) {
|
1552
|
+
itemData = this._domElementToItemData(itemData);
|
1553
|
+
} // Dispatching the itemData event,
|
1554
|
+
// it's a legacy verion before filters were introduced
|
1555
|
+
|
1556
|
+
|
1557
|
+
const event = this.dispatch('itemData', {
|
1558
|
+
itemData: itemData || {},
|
1559
|
+
index
|
1560
|
+
});
|
1561
|
+
return this.applyFilters('itemData', event.itemData, index);
|
1562
|
+
}
|
1563
|
+
/**
|
1564
|
+
* Get array of gallery DOM elements,
|
1565
|
+
* based on childSelector and gallery element.
|
1566
|
+
*
|
1567
|
+
* @param {HTMLElement} galleryElement
|
1568
|
+
* @returns {HTMLElement[]}
|
1569
|
+
*/
|
1570
|
+
|
1571
|
+
|
1572
|
+
_getGalleryDOMElements(galleryElement) {
|
1573
|
+
var _this$options3, _this$options4;
|
1574
|
+
|
1575
|
+
if ((_this$options3 = this.options) !== null && _this$options3 !== void 0 && _this$options3.children || (_this$options4 = this.options) !== null && _this$options4 !== void 0 && _this$options4.childSelector) {
|
1576
|
+
return getElementsFromOption(this.options.children, this.options.childSelector, galleryElement) || [];
|
1577
|
+
}
|
1578
|
+
|
1579
|
+
return [galleryElement];
|
1580
|
+
}
|
1581
|
+
/**
|
1582
|
+
* Converts DOM element to item data object.
|
1583
|
+
*
|
1584
|
+
* @param {HTMLElement} element DOM element
|
1585
|
+
* @returns {SlideData}
|
1586
|
+
*/
|
1587
|
+
|
1588
|
+
|
1589
|
+
_domElementToItemData(element) {
|
1590
|
+
/** @type {SlideData} */
|
1591
|
+
const itemData = {
|
1592
|
+
element
|
1593
|
+
};
|
1594
|
+
const linkEl =
|
1595
|
+
/** @type {HTMLAnchorElement} */
|
1596
|
+
element.tagName === 'A' ? element : element.querySelector('a');
|
1597
|
+
|
1598
|
+
if (linkEl) {
|
1599
|
+
// src comes from data-pswp-src attribute,
|
1600
|
+
// if it's empty link href is used
|
1601
|
+
itemData.src = linkEl.dataset.pswpSrc || linkEl.href;
|
1602
|
+
|
1603
|
+
if (linkEl.dataset.pswpSrcset) {
|
1604
|
+
itemData.srcset = linkEl.dataset.pswpSrcset;
|
1605
|
+
}
|
1606
|
+
|
1607
|
+
itemData.width = linkEl.dataset.pswpWidth ? parseInt(linkEl.dataset.pswpWidth, 10) : 0;
|
1608
|
+
itemData.height = linkEl.dataset.pswpHeight ? parseInt(linkEl.dataset.pswpHeight, 10) : 0; // support legacy w & h properties
|
1609
|
+
|
1610
|
+
itemData.w = itemData.width;
|
1611
|
+
itemData.h = itemData.height;
|
1612
|
+
|
1613
|
+
if (linkEl.dataset.pswpType) {
|
1614
|
+
itemData.type = linkEl.dataset.pswpType;
|
1615
|
+
}
|
1616
|
+
|
1617
|
+
const thumbnailEl = element.querySelector('img');
|
1618
|
+
|
1619
|
+
if (thumbnailEl) {
|
1620
|
+
var _thumbnailEl$getAttri;
|
1621
|
+
|
1622
|
+
// msrc is URL to placeholder image that's displayed before large image is loaded
|
1623
|
+
// by default it's displayed only for the first slide
|
1624
|
+
itemData.msrc = thumbnailEl.currentSrc || thumbnailEl.src;
|
1625
|
+
itemData.alt = (_thumbnailEl$getAttri = thumbnailEl.getAttribute('alt')) !== null && _thumbnailEl$getAttri !== void 0 ? _thumbnailEl$getAttri : '';
|
1626
|
+
}
|
1627
|
+
|
1628
|
+
if (linkEl.dataset.pswpCropped || linkEl.dataset.cropped) {
|
1629
|
+
itemData.thumbCropped = true;
|
1630
|
+
}
|
1631
|
+
}
|
1632
|
+
|
1633
|
+
return this.applyFilters('domItemData', itemData, element, linkEl);
|
1634
|
+
}
|
1635
|
+
/**
|
1636
|
+
* Lazy-load by slide data
|
1637
|
+
*
|
1638
|
+
* @param {SlideData} itemData Data about the slide
|
1639
|
+
* @param {number} index
|
1640
|
+
* @returns {Content} Image that is being decoded or false.
|
1641
|
+
*/
|
1642
|
+
|
1643
|
+
|
1644
|
+
lazyLoadData(itemData, index) {
|
1645
|
+
return lazyLoadData(itemData, this, index);
|
1646
|
+
}
|
1647
|
+
|
1648
|
+
}
|
1649
|
+
|
1650
|
+
/**
|
1651
|
+
* @template T
|
1652
|
+
* @typedef {import('../types.js').Type<T>} Type<T>
|
1653
|
+
*/
|
1654
|
+
|
1655
|
+
/** @typedef {import('../photoswipe.js').default} PhotoSwipe */
|
1656
|
+
|
1657
|
+
/** @typedef {import('../photoswipe.js').PhotoSwipeOptions} PhotoSwipeOptions */
|
1658
|
+
|
1659
|
+
/** @typedef {import('../photoswipe.js').DataSource} DataSource */
|
1660
|
+
|
1661
|
+
/** @typedef {import('../photoswipe.js').Point} Point */
|
1662
|
+
|
1663
|
+
/** @typedef {import('../slide/content.js').default} Content */
|
1664
|
+
|
1665
|
+
/** @typedef {import('../core/eventable.js').PhotoSwipeEventsMap} PhotoSwipeEventsMap */
|
1666
|
+
|
1667
|
+
/** @typedef {import('../core/eventable.js').PhotoSwipeFiltersMap} PhotoSwipeFiltersMap */
|
1668
|
+
|
1669
|
+
/**
|
1670
|
+
* @template {keyof PhotoSwipeEventsMap} T
|
1671
|
+
* @typedef {import('../core/eventable.js').EventCallback<T>} EventCallback<T>
|
1672
|
+
*/
|
1673
|
+
|
1674
|
+
/**
|
1675
|
+
* PhotoSwipe Lightbox
|
1676
|
+
*
|
1677
|
+
* - If user has unsupported browser it falls back to default browser action (just opens URL)
|
1678
|
+
* - Binds click event to links that should open PhotoSwipe
|
1679
|
+
* - parses DOM strcture for PhotoSwipe (retrieves large image URLs and sizes)
|
1680
|
+
* - Initializes PhotoSwipe
|
1681
|
+
*
|
1682
|
+
*
|
1683
|
+
* Loader options use the same object as PhotoSwipe, and supports such options:
|
1684
|
+
*
|
1685
|
+
* gallery - Element | Element[] | NodeList | string selector for the gallery element
|
1686
|
+
* children - Element | Element[] | NodeList | string selector for the gallery children
|
1687
|
+
*
|
1688
|
+
*/
|
1689
|
+
|
1690
|
+
class PhotoSwipeLightbox extends PhotoSwipeBase {
|
1691
|
+
/**
|
1692
|
+
* @param {PhotoSwipeOptions} [options]
|
1693
|
+
*/
|
1694
|
+
constructor(options) {
|
1695
|
+
super();
|
1696
|
+
/** @type {PhotoSwipeOptions} */
|
1697
|
+
|
1698
|
+
this.options = options || {};
|
1699
|
+
this._uid = 0;
|
1700
|
+
this.shouldOpen = false;
|
1701
|
+
/**
|
1702
|
+
* @private
|
1703
|
+
* @type {Content | undefined}
|
1704
|
+
*/
|
1705
|
+
|
1706
|
+
this._preloadedContent = undefined;
|
1707
|
+
this.onThumbnailsClick = this.onThumbnailsClick.bind(this);
|
1708
|
+
}
|
1709
|
+
/**
|
1710
|
+
* Initialize lightbox, should be called only once.
|
1711
|
+
* It's not included in the main constructor, so you may bind events before it.
|
1712
|
+
*/
|
1713
|
+
|
1714
|
+
|
1715
|
+
init() {
|
1716
|
+
// Bind click events to each gallery
|
1717
|
+
getElementsFromOption(this.options.gallery, this.options.gallerySelector).forEach(galleryElement => {
|
1718
|
+
galleryElement.addEventListener('click', this.onThumbnailsClick, false);
|
1719
|
+
});
|
1720
|
+
}
|
1721
|
+
/**
|
1722
|
+
* @param {MouseEvent} e
|
1723
|
+
*/
|
1724
|
+
|
1725
|
+
|
1726
|
+
onThumbnailsClick(e) {
|
1727
|
+
// Exit and allow default browser action if:
|
1728
|
+
if (specialKeyUsed(e) // ... if clicked with a special key (ctrl/cmd...)
|
1729
|
+
|| window.pswp) {
|
1730
|
+
// ... if PhotoSwipe is already open
|
1731
|
+
return;
|
1732
|
+
} // If both clientX and clientY are 0 or not defined,
|
1733
|
+
// the event is likely triggered by keyboard,
|
1734
|
+
// so we do not pass the initialPoint
|
1735
|
+
//
|
1736
|
+
// Note that some screen readers emulate the mouse position,
|
1737
|
+
// so it's not the ideal way to detect them.
|
1738
|
+
//
|
1739
|
+
|
1740
|
+
/** @type {Point | null} */
|
1741
|
+
|
1742
|
+
|
1743
|
+
let initialPoint = {
|
1744
|
+
x: e.clientX,
|
1745
|
+
y: e.clientY
|
1746
|
+
};
|
1747
|
+
|
1748
|
+
if (!initialPoint.x && !initialPoint.y) {
|
1749
|
+
initialPoint = null;
|
1750
|
+
}
|
1751
|
+
|
1752
|
+
let clickedIndex = this.getClickedIndex(e);
|
1753
|
+
clickedIndex = this.applyFilters('clickedIndex', clickedIndex, e, this);
|
1754
|
+
/** @type {DataSource} */
|
1755
|
+
|
1756
|
+
const dataSource = {
|
1757
|
+
gallery:
|
1758
|
+
/** @type {HTMLElement} */
|
1759
|
+
e.currentTarget
|
1760
|
+
};
|
1761
|
+
|
1762
|
+
if (clickedIndex >= 0) {
|
1763
|
+
e.preventDefault();
|
1764
|
+
this.loadAndOpen(clickedIndex, dataSource, initialPoint);
|
1765
|
+
}
|
1766
|
+
}
|
1767
|
+
/**
|
1768
|
+
* Get index of gallery item that was clicked.
|
1769
|
+
*
|
1770
|
+
* @param {MouseEvent} e click event
|
1771
|
+
* @returns {number}
|
1772
|
+
*/
|
1773
|
+
|
1774
|
+
|
1775
|
+
getClickedIndex(e) {
|
1776
|
+
// legacy option
|
1777
|
+
if (this.options.getClickedIndexFn) {
|
1778
|
+
return this.options.getClickedIndexFn.call(this, e);
|
1779
|
+
}
|
1780
|
+
|
1781
|
+
const clickedTarget =
|
1782
|
+
/** @type {HTMLElement} */
|
1783
|
+
e.target;
|
1784
|
+
const childElements = getElementsFromOption(this.options.children, this.options.childSelector,
|
1785
|
+
/** @type {HTMLElement} */
|
1786
|
+
e.currentTarget);
|
1787
|
+
const clickedChildIndex = childElements.findIndex(child => child === clickedTarget || child.contains(clickedTarget));
|
1788
|
+
|
1789
|
+
if (clickedChildIndex !== -1) {
|
1790
|
+
return clickedChildIndex;
|
1791
|
+
} else if (this.options.children || this.options.childSelector) {
|
1792
|
+
// click wasn't on a child element
|
1793
|
+
return -1;
|
1794
|
+
} // There is only one item (which is the gallery)
|
1795
|
+
|
1796
|
+
|
1797
|
+
return 0;
|
1798
|
+
}
|
1799
|
+
/**
|
1800
|
+
* Load and open PhotoSwipe
|
1801
|
+
*
|
1802
|
+
* @param {number} index
|
1803
|
+
* @param {DataSource} [dataSource]
|
1804
|
+
* @param {Point | null} [initialPoint]
|
1805
|
+
* @returns {boolean}
|
1806
|
+
*/
|
1807
|
+
|
1808
|
+
|
1809
|
+
loadAndOpen(index, dataSource, initialPoint) {
|
1810
|
+
// Check if the gallery is already open
|
1811
|
+
if (window.pswp || !this.options) {
|
1812
|
+
return false;
|
1813
|
+
} // Use the first gallery element if dataSource is not provided
|
1814
|
+
|
1815
|
+
|
1816
|
+
if (!dataSource && this.options.gallery && this.options.children) {
|
1817
|
+
const galleryElements = getElementsFromOption(this.options.gallery);
|
1818
|
+
|
1819
|
+
if (galleryElements[0]) {
|
1820
|
+
dataSource = {
|
1821
|
+
gallery: galleryElements[0]
|
1822
|
+
};
|
1823
|
+
}
|
1824
|
+
} // set initial index
|
1825
|
+
|
1826
|
+
|
1827
|
+
this.options.index = index; // define options for PhotoSwipe constructor
|
1828
|
+
|
1829
|
+
this.options.initialPointerPos = initialPoint;
|
1830
|
+
this.shouldOpen = true;
|
1831
|
+
this.preload(index, dataSource);
|
1832
|
+
return true;
|
1833
|
+
}
|
1834
|
+
/**
|
1835
|
+
* Load the main module and the slide content by index
|
1836
|
+
*
|
1837
|
+
* @param {number} index
|
1838
|
+
* @param {DataSource} [dataSource]
|
1839
|
+
*/
|
1840
|
+
|
1841
|
+
|
1842
|
+
preload(index, dataSource) {
|
1843
|
+
const {
|
1844
|
+
options
|
1845
|
+
} = this;
|
1846
|
+
|
1847
|
+
if (dataSource) {
|
1848
|
+
options.dataSource = dataSource;
|
1849
|
+
} // Add the main module
|
1850
|
+
|
1851
|
+
/** @type {Promise<Type<PhotoSwipe>>[]} */
|
1852
|
+
|
1853
|
+
|
1854
|
+
const promiseArray = [];
|
1855
|
+
const pswpModuleType = typeof options.pswpModule;
|
1856
|
+
|
1857
|
+
if (isPswpClass(options.pswpModule)) {
|
1858
|
+
promiseArray.push(Promise.resolve(
|
1859
|
+
/** @type {Type<PhotoSwipe>} */
|
1860
|
+
options.pswpModule));
|
1861
|
+
} else if (pswpModuleType === 'string') {
|
1862
|
+
throw new Error('pswpModule as string is no longer supported');
|
1863
|
+
} else if (pswpModuleType === 'function') {
|
1864
|
+
promiseArray.push(
|
1865
|
+
/** @type {() => Promise<Type<PhotoSwipe>>} */
|
1866
|
+
options.pswpModule());
|
1867
|
+
} else {
|
1868
|
+
throw new Error('pswpModule is not valid');
|
1869
|
+
} // Add custom-defined promise, if any
|
1870
|
+
|
1871
|
+
|
1872
|
+
if (typeof options.openPromise === 'function') {
|
1873
|
+
// allow developers to perform some task before opening
|
1874
|
+
promiseArray.push(options.openPromise());
|
1875
|
+
}
|
1876
|
+
|
1877
|
+
if (options.preloadFirstSlide !== false && index >= 0) {
|
1878
|
+
this._preloadedContent = lazyLoadSlide(index, this);
|
1879
|
+
} // Wait till all promises resolve and open PhotoSwipe
|
1880
|
+
|
1881
|
+
|
1882
|
+
const uid = ++this._uid;
|
1883
|
+
Promise.all(promiseArray).then(iterableModules => {
|
1884
|
+
if (this.shouldOpen) {
|
1885
|
+
const mainModule = iterableModules[0];
|
1886
|
+
|
1887
|
+
this._openPhotoswipe(mainModule, uid);
|
1888
|
+
}
|
1889
|
+
});
|
1890
|
+
}
|
1891
|
+
/**
|
1892
|
+
* @private
|
1893
|
+
* @param {Type<PhotoSwipe> | { default: Type<PhotoSwipe> }} module
|
1894
|
+
* @param {number} uid
|
1895
|
+
*/
|
1896
|
+
|
1897
|
+
|
1898
|
+
_openPhotoswipe(module, uid) {
|
1899
|
+
// Cancel opening if UID doesn't match the current one
|
1900
|
+
// (if user clicked on another gallery item before current was loaded).
|
1901
|
+
//
|
1902
|
+
// Or if shouldOpen flag is set to false
|
1903
|
+
// (developer may modify it via public API)
|
1904
|
+
if (uid !== this._uid && this.shouldOpen) {
|
1905
|
+
return;
|
1906
|
+
}
|
1907
|
+
|
1908
|
+
this.shouldOpen = false; // PhotoSwipe is already open
|
1909
|
+
|
1910
|
+
if (window.pswp) {
|
1911
|
+
return;
|
1912
|
+
}
|
1913
|
+
/**
|
1914
|
+
* Pass data to PhotoSwipe and open init
|
1915
|
+
*
|
1916
|
+
* @type {PhotoSwipe}
|
1917
|
+
*/
|
1918
|
+
|
1919
|
+
|
1920
|
+
const pswp = typeof module === 'object' ? new module.default(this.options) // eslint-disable-line
|
1921
|
+
: new module(this.options); // eslint-disable-line
|
1922
|
+
|
1923
|
+
this.pswp = pswp;
|
1924
|
+
window.pswp = pswp; // map listeners from Lightbox to PhotoSwipe Core
|
1925
|
+
|
1926
|
+
/** @type {(keyof PhotoSwipeEventsMap)[]} */
|
1927
|
+
|
1928
|
+
Object.keys(this._listeners).forEach(name => {
|
1929
|
+
var _this$_listeners$name;
|
1930
|
+
|
1931
|
+
(_this$_listeners$name = this._listeners[name]) === null || _this$_listeners$name === void 0 || _this$_listeners$name.forEach(fn => {
|
1932
|
+
pswp.on(name,
|
1933
|
+
/** @type {EventCallback<typeof name>} */
|
1934
|
+
fn);
|
1935
|
+
});
|
1936
|
+
}); // same with filters
|
1937
|
+
|
1938
|
+
/** @type {(keyof PhotoSwipeFiltersMap)[]} */
|
1939
|
+
|
1940
|
+
Object.keys(this._filters).forEach(name => {
|
1941
|
+
var _this$_filters$name;
|
1942
|
+
|
1943
|
+
(_this$_filters$name = this._filters[name]) === null || _this$_filters$name === void 0 || _this$_filters$name.forEach(filter => {
|
1944
|
+
pswp.addFilter(name, filter.fn, filter.priority);
|
1945
|
+
});
|
1946
|
+
});
|
1947
|
+
|
1948
|
+
if (this._preloadedContent) {
|
1949
|
+
pswp.contentLoader.addToCache(this._preloadedContent);
|
1950
|
+
this._preloadedContent = undefined;
|
1951
|
+
}
|
1952
|
+
|
1953
|
+
pswp.on('destroy', () => {
|
1954
|
+
// clean up public variables
|
1955
|
+
this.pswp = undefined;
|
1956
|
+
delete window.pswp;
|
1957
|
+
});
|
1958
|
+
pswp.init();
|
1959
|
+
}
|
1960
|
+
/**
|
1961
|
+
* Unbinds all events, closes PhotoSwipe if it's open.
|
1962
|
+
*/
|
1963
|
+
|
1964
|
+
|
1965
|
+
destroy() {
|
1966
|
+
var _this$pswp;
|
1967
|
+
|
1968
|
+
(_this$pswp = this.pswp) === null || _this$pswp === void 0 || _this$pswp.destroy();
|
1969
|
+
this.shouldOpen = false;
|
1970
|
+
this._listeners = {};
|
1971
|
+
getElementsFromOption(this.options.gallery, this.options.gallerySelector).forEach(galleryElement => {
|
1972
|
+
galleryElement.removeEventListener('click', this.onThumbnailsClick, false);
|
1973
|
+
});
|
1974
|
+
}
|
1975
|
+
|
1976
|
+
}
|
1977
|
+
|
1978
|
+
return PhotoSwipeLightbox;
|
1979
|
+
|
1980
|
+
}));
|
1981
|
+
|