Plugin Directory

Changeset 2635456


Ignore:
Timestamp:
11/25/2021 04:05:31 PM (3 years ago)
Author:
netzstrategen
Message:

Preparing release 2.8.2.

Location:
gallerya/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • gallerya/trunk/README.txt

    r2631983 r2635456  
    11=== Gallerya ===
    2 Contributors: netzstrategen, fabianmarz, juanlopez4691, lucapipolo, tha_sun, gyopiazza, Mauricio-Urrego chrisbaltazar
     2Contributors: netzstrategen, fabianmarz, juanlopez4691, lucapipolo, tha_sun, gyopiazza, Mauricio-Urrego, chrisbaltazar, bogdanarizancu
    33Tags: gallery, galleries, image, images, photo, album, responsive, responsive gallery, image gallery, photo gallery, carousel, image carousel, slider, image slider, slideshow, lightbox, fullscreen, zoom, media, foto, fotos, thumbnail, thumbnails, video, video gallery, lightgallery, flickity, jquery
    44Requires at least: 4.5
    5 Tested up to: 5.4
    6 Stable tag: 2.8.1
     5Tested up to: 5.6
     6Stable tag: 2.8.2
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2424
    2525== Changelog ==
     26
     27= 2.8.2 =
     282021-11-24
     29
     30* Fixed no thumbnail on initial video slide.
    2631
    2732= 2.8.1 =
  • gallerya/trunk/assets/scripts/script.js

    r2631983 r2635456  
    274274          .first();
    275275        $firstGalleryElement.detach().insertAfter(firstImage);
     276        setVideoPlayerUrl(1);
    276277      }
    277278    }
  • gallerya/trunk/dist/scripts/script.min.js

    r2631983 r2635456  
    1 !function(e){e(document).ready(function(){function a(){var a=e(".woocommerce-product-gallery .woocommerce-product-gallery__wrapper"),t=a.children(".woocommerce-product-gallery__image");if(!(t.length<=1)){var i=t.first();if(i.hasClass("has-video")){var l=a.children(".woocommerce-product-gallery__image:not(.has-video)").first();i.detach().insertAfter(l)}}}function t(){var a=e(".woocommerce-product-gallery .gallerya__video-content").first();if(!(a.length<1)){var t=a.data("video-thumb"),i=e(".flex-control-nav li img"),l=i.length>1?1:0,o=i.eq(l);o.attr("src")!==t&&(i.first().attr("src",o.attr("src")),o.attr("src",t).attr("data-lazy-src",t).parent().addClass("slider-thumb-video"))}}function i(a){var t=e(".woocommerce-product-gallery .woocommerce-product-gallery__image").eq(a);if(e(t).hasClass("has-video")){var i=e(t).find("iframe").first();i.attr("src")||i.attr("src",e(t).data("video-url"))}}function l(e){e.hiddenSlides&&(e.find("li").css("opacity",1),e.flickity("reposition"),e.flickity("selectCell",0),e.hiddenSlides=0)}if(e(".js-gallerya-slider").length>0&&"function"==typeof e.fn.flickity){var o="M85,50.36033a2.72075,2.72075,0,0,0-2.74945-2.68906H24.01177L47.61119,24.59022a2.65667,2.65667,0,0,0,0-3.80232,2.79411,2.79411,0,0,0-3.88955,0L15.80559,48.09077a2.64614,2.64614,0,0,0,0,3.80232L43.729,79.21211a2.79185,2.79185,0,0,0,3.88771,0,2.64613,2.64613,0,0,0,0-3.80233L24.756,53.04939h57.4946A2.72075,2.72075,0,0,0,85,50.36033Z";e(".js-gallerya-slider").each(function(a,t){var i=e(this).closest(".gallerya--slider, .gallerya--product-variation-slider"),l=i.data("gallerya-navigation"),n=i.data("galleryaPageDots"),r=i.find(".js-gallerya-thumbnail-slider"),s=i.find("[data-gallerya-count]"),c=i.parents("a.woocommerce-loop-product__link"),d={cellAlign:"left",contain:!0,wrapAround:!0,imagesLoaded:!0,watchCSS:!0,lazyLoad:!0};i.hasClass("gallerya--product-variation-slider")||(d.arrowShape=o),"undefined"!=typeof n?d.pageDots=1==n:("undefined"==typeof l||0==l||r.length>0)&&(d.pageDots=!1),e(this).addClass("flickity"),e(this).flickity(d),e(this).on("change.flickity",function(a,t){var i=e(this).find("li.is-selected").data("gallerya-variant-permalink");i&&c.prop("href",i)});var f=e(this).data("flickity");if(r.length>0){var u={asNavFor:t,contain:!0,pageDots:!1,imagesLoaded:!0,groupCells:!0,arrowShape:o};r.flickity(u),e(this).on("select.flickity",function(){var e=f.selectedIndex,a="is-currently-selected";r.find(".flickity-slider li").removeClass(a).eq(e).addClass(a)})}s&&e(this).on("select.flickity",function(){var e=f.selectedIndex+1;s.text(e+"/"+f.slides.length)})}),e(".woocommerce-loop-product__link").on("click",function(a){if(0!==e(a.target).closest(".flickity-prev-next-button").length)return a.stopPropagation(),!1})}if(e().fancybox({selector:"[data-fancybox], .js-gallerya-lightbox .gallerya__image > a, .woocommerce-product-gallery .woocommerce-product-gallery__image > a",closeExisting:!1,loop:!0,keyboard:!0,buttons:["zoom","fullScreen","share","download","thumbs","close"],animationEffect:"zoom",animationDuration:250,transitionEffect:"slide",thumbs:{autoStart:!1,axis:"x"},image:{preload:!0},iframe:{preload:!0},lang:fancyboxTranslations.language,i18n:{de:{CLOSE:fancyboxTranslations.de.close,NEXT:fancyboxTranslations.de.next,PREV:fancyboxTranslations.de.prev,ERROR:fancyboxTranslations.de.error,PLAY_START:fancyboxTranslations.de.play_start,PLAY_STOP:fancyboxTranslations.de.play_stop,FULL_SCREEN:fancyboxTranslations.de.full_screen,THUMBS:fancyboxTranslations.de.thumbs,DOWNLOAD:fancyboxTranslations.de.download,SHARE:fancyboxTranslations.de.share,ZOOM:fancyboxTranslations.de.zoom}}}),e(".js-gallerya-product-thumbnail-slider").length>0&&"function"==typeof e.fn.flickity){var n=e(".js-gallerya-product-thumbnail-slider").parent().find(".flex-control-thumbs").first();if(!n.length)return;var r={contain:!0,pageDots:!1,imagesLoaded:!0,groupCells:!0},s=parseInt(getComputedStyle(n.get(0)).getPropertyValue("--thumbnail-spacing-unit"),10),c=parseInt(getComputedStyle(n.get(0)).getPropertyValue("--thumbnail-slider-margin"),10),d=n.find("li").first().width(),f=n.width(),u=7,y=4;if(d>0&&f>d){for(;(f-2*c-s*y)/(y+1)>=d&&(y++,y!==u););n.get(0).style.setProperty("--thumbnail-count",y)}var g=n.find("li").length;r.prevNextButtons=g>y,n.addClass("flickity").on("ready.flickity",function(){a()}).on("settle.flickity",function(){t()}).on("staticClick.flickity",function(a,t,l,o){e(l).hasClass("slider-thumb-video")&&i(o)});var h=n.flickity(r),m=e(".single_variation_wrap");n.hiddenSlides=0;var p=e(".woocommerce-product-gallery").data("flexslider");p&&h.on("mouseover","li",function(a){var t=e(a.currentTarget);p.flexslider(t.index()),t.hasClass("slider-thumb-video")&&i(t.index())}),e(document).on("afterShow.fb",function(e,a,t){p.flexslider(t.index),n.flickity("selectCell",t.index)}),m.on("show_variation",function(a,t){l(n);var i=(product_variation_images.gallery,product_variation_images[t.variation_id]||[]);i.length>1&&(n.find("img").each(function(){var a=e(this),t=a.attr("src");i.includes(t)||(a.parent().css("opacity",.15),n.hiddenSlides++)}),n.hiddenSlides&&n.flickity("reposition"));var o=n.find('img[src="'+t.image.gallery_thumbnail_src+'"]').parent().index();n.flickity("selectCell",o)}),m.on("hide_variation",function(e){n.hiddenSlides&&(l(n),n.hiddenSlides=0)})}else a(),t(),e(".single-product-summary .flex-control-nav li").on("click",function(){var a=e(this);a.hasClass("slider-thumb-video")&&i(a.index())})})}(jQuery);
     1!function(e){e(document).ready(function(){function a(){var a=e(".woocommerce-product-gallery .woocommerce-product-gallery__wrapper"),t=a.children(".woocommerce-product-gallery__image");if(!(t.length<=1)){var l=t.first();if(l.hasClass("has-video")){var o=a.children(".woocommerce-product-gallery__image:not(.has-video)").first();l.detach().insertAfter(o),i(1)}}}function t(){var a=e(".woocommerce-product-gallery .gallerya__video-content").first();if(!(a.length<1)){var t=a.data("video-thumb"),i=e(".flex-control-nav li img"),l=i.length>1?1:0,o=i.eq(l);o.attr("src")!==t&&(i.first().attr("src",o.attr("src")),o.attr("src",t).attr("data-lazy-src",t).parent().addClass("slider-thumb-video"))}}function i(a){var t=e(".woocommerce-product-gallery .woocommerce-product-gallery__image").eq(a);if(e(t).hasClass("has-video")){var i=e(t).find("iframe").first();i.attr("src")||i.attr("src",e(t).data("video-url"))}}function l(e){e.hiddenSlides&&(e.find("li").css("opacity",1),e.flickity("reposition"),e.flickity("selectCell",0),e.hiddenSlides=0)}if(e(".js-gallerya-slider").length>0&&"function"==typeof e.fn.flickity){var o="M85,50.36033a2.72075,2.72075,0,0,0-2.74945-2.68906H24.01177L47.61119,24.59022a2.65667,2.65667,0,0,0,0-3.80232,2.79411,2.79411,0,0,0-3.88955,0L15.80559,48.09077a2.64614,2.64614,0,0,0,0,3.80232L43.729,79.21211a2.79185,2.79185,0,0,0,3.88771,0,2.64613,2.64613,0,0,0,0-3.80233L24.756,53.04939h57.4946A2.72075,2.72075,0,0,0,85,50.36033Z";e(".js-gallerya-slider").each(function(a,t){var i=e(this).closest(".gallerya--slider, .gallerya--product-variation-slider"),l=i.data("gallerya-navigation"),n=i.data("galleryaPageDots"),r=i.find(".js-gallerya-thumbnail-slider"),s=i.find("[data-gallerya-count]"),c=i.parents("a.woocommerce-loop-product__link"),d={cellAlign:"left",contain:!0,wrapAround:!0,imagesLoaded:!0,watchCSS:!0,lazyLoad:!0};i.hasClass("gallerya--product-variation-slider")||(d.arrowShape=o),"undefined"!=typeof n?d.pageDots=1==n:("undefined"==typeof l||0==l||r.length>0)&&(d.pageDots=!1),e(this).addClass("flickity"),e(this).flickity(d),e(this).on("change.flickity",function(a,t){var i=e(this).find("li.is-selected").data("gallerya-variant-permalink");i&&c.prop("href",i)});var f=e(this).data("flickity");if(r.length>0){var u={asNavFor:t,contain:!0,pageDots:!1,imagesLoaded:!0,groupCells:!0,arrowShape:o};r.flickity(u),e(this).on("select.flickity",function(){var e=f.selectedIndex,a="is-currently-selected";r.find(".flickity-slider li").removeClass(a).eq(e).addClass(a)})}s&&e(this).on("select.flickity",function(){var e=f.selectedIndex+1;s.text(e+"/"+f.slides.length)})}),e(".woocommerce-loop-product__link").on("click",function(a){if(0!==e(a.target).closest(".flickity-prev-next-button").length)return a.stopPropagation(),!1})}if(e().fancybox({selector:"[data-fancybox], .js-gallerya-lightbox .gallerya__image > a, .woocommerce-product-gallery .woocommerce-product-gallery__image > a",closeExisting:!1,loop:!0,keyboard:!0,buttons:["zoom","fullScreen","share","download","thumbs","close"],animationEffect:"zoom",animationDuration:250,transitionEffect:"slide",thumbs:{autoStart:!1,axis:"x"},image:{preload:!0},iframe:{preload:!0},lang:fancyboxTranslations.language,i18n:{de:{CLOSE:fancyboxTranslations.de.close,NEXT:fancyboxTranslations.de.next,PREV:fancyboxTranslations.de.prev,ERROR:fancyboxTranslations.de.error,PLAY_START:fancyboxTranslations.de.play_start,PLAY_STOP:fancyboxTranslations.de.play_stop,FULL_SCREEN:fancyboxTranslations.de.full_screen,THUMBS:fancyboxTranslations.de.thumbs,DOWNLOAD:fancyboxTranslations.de.download,SHARE:fancyboxTranslations.de.share,ZOOM:fancyboxTranslations.de.zoom}}}),e(".js-gallerya-product-thumbnail-slider").length>0&&"function"==typeof e.fn.flickity){var n=e(".js-gallerya-product-thumbnail-slider").parent().find(".flex-control-thumbs").first();if(!n.length)return;var r={contain:!0,pageDots:!1,imagesLoaded:!0,groupCells:!0},s=parseInt(getComputedStyle(n.get(0)).getPropertyValue("--thumbnail-spacing-unit"),10),c=parseInt(getComputedStyle(n.get(0)).getPropertyValue("--thumbnail-slider-margin"),10),d=n.find("li").first().width(),f=n.width(),u=7,y=4;if(d>0&&f>d){for(;(f-2*c-s*y)/(y+1)>=d&&(y++,y!==u););n.get(0).style.setProperty("--thumbnail-count",y)}var g=n.find("li").length;r.prevNextButtons=g>y,n.addClass("flickity").on("ready.flickity",function(){a()}).on("settle.flickity",function(){t()}).on("staticClick.flickity",function(a,t,l,o){e(l).hasClass("slider-thumb-video")&&i(o)});var h=n.flickity(r),m=e(".single_variation_wrap");n.hiddenSlides=0;var p=e(".woocommerce-product-gallery").data("flexslider");p&&h.on("mouseover","li",function(a){var t=e(a.currentTarget);p.flexslider(t.index()),t.hasClass("slider-thumb-video")&&i(t.index())}),e(document).on("afterShow.fb",function(e,a,t){p.flexslider(t.index),n.flickity("selectCell",t.index)}),m.on("show_variation",function(a,t){l(n);var i=(product_variation_images.gallery,product_variation_images[t.variation_id]||[]);i.length>1&&(n.find("img").each(function(){var a=e(this),t=a.attr("src");i.includes(t)||(a.parent().css("opacity",.15),n.hiddenSlides++)}),n.hiddenSlides&&n.flickity("reposition"));var o=n.find('img[src="'+t.image.gallery_thumbnail_src+'"]').parent().index();n.flickity("selectCell",o)}),m.on("hide_variation",function(e){n.hiddenSlides&&(l(n),n.hiddenSlides=0)})}else a(),t(),e(".single-product-summary .flex-control-nav li").on("click",function(){var a=e(this);a.hasClass("slider-thumb-video")&&i(a.index())})})}(jQuery);
    22//# sourceMappingURL=script.min.js.map
  • gallerya/trunk/dist/scripts/script.min.js.map

    r2631983 r2635456  
    1 {"version":3,"sources":["../assets/scripts/script.js"],"names":["$","document","ready","setProductGalleryVideoSlide","$galleryWraper","$galleryElements","children","length","$firstGalleryElement","first","hasClass","firstImage","detach","insertAfter","setProductGalleryVideoThumbnail","$videoContent","videoThumbSrc","data","$sliderThumbs","videoThumbPos","videoThumb","eq","attr","parent","addClass","setVideoPlayerUrl","slideIndex","slide","$videoPlayer","find","restoreSliderThumbs","$slider","hiddenSlides","css","flickity","fn","arrowShape","each","index","element","galleryaSlider","this","closest","navigation","pageDots","thumbnails","count","productLink","parents","sliderArgs","cellAlign","contain","wrapAround","imagesLoaded","watchCSS","lazyLoad","on","event","variantURL","prop","flickityData","thumbnailsArgs","asNavFor","groupCells","selectedIndex","className","removeClass","slideNumber","text","slides","e","target","stopPropagation","fancybox","selector","closeExisting","loop","keyboard","buttons","animationEffect","animationDuration","transitionEffect","thumbs","autoStart","axis","image","preload","iframe","lang","fancyboxTranslations","language","i18n","de","CLOSE","close","NEXT","next","PREV","prev","ERROR","error","PLAY_START","play_start","PLAY_STOP","play_stop","FULL_SCREEN","full_screen","THUMBS","DOWNLOAD","download","SHARE","share","ZOOM","zoom","$thumbnailSliderEl","thumbnailSliderArgs","thumbnailSpacingUnit","parseInt","getComputedStyle","get","getPropertyValue","thumbnailSliderMargin","initialImgsWidth","width","thumbnailSliderWidth","maxCols","noCols","style","setProperty","numberOfThumbnails","prevNextButtons","pointer","cellElement","cellIndex","$thumbnailSlider","$singleVariation","productGallery","currentTarget","flexslider","instance","variation","selectedVariationImages","product_variation_images","gallery","variation_id","$this","thumb","includes","thumbnailIndex","gallery_thumbnail_src","jQuery"],"mappings":"CAAA,SAAWA,GACTA,EAAEC,UAAUC,MAAM,WAmQhB,QAASC,KAEP,GAAMC,GAAiBJ,EAAE,sEACnBK,EAAmBD,EACtBE,SAAS,sCACZ,MAAID,EAAiBE,QAAU,GAA/B,CAGA,GAAMC,GAAuBH,EAAiBI,OAC9C,IAAID,EAAqBE,SAAS,aAAc,CAE9C,GAAMC,GAAaP,EAChBE,SAAS,uDACTG,OACHD,GAAqBI,SAASC,YAAYF,KAO9C,QAASG,KACP,GAAMC,GAAgBf,EAAE,yDAAyDS,OAEjF,MAAIM,EAAcR,OAAS,GAA3B,CAGA,GAAMS,GAAgBD,EAAcE,KAAK,eACnCC,EAAgBlB,EAAE,4BAGlBmB,EAAgBD,EAAcX,OAAS,EAAI,EAAI,EAC/Ca,EAAaF,EAAcG,GAAGF,EAEhCC,GAAWE,KAAK,SAAWN,IAC7BE,EAAcT,QAAQa,KAAK,MAAOF,EAAWE,KAAK,QAClDF,EACGE,KAAK,MAAON,GAEZM,KAAK,gBAAiBN,GACtBO,SAASC,SAAS,wBAezB,QAASC,GAAkBC,GACzB,GAAMC,GAAQ3B,EAAE,oEAAoEqB,GAAGK,EACvF,IAAK1B,EAAE2B,GAAOjB,SAAS,aAAvB,CAGA,GAAMkB,GAAe5B,EAAE2B,GAAOE,KAAK,UAAUpB,OACxCmB,GAAaN,KAAK,QACrBM,EAAaN,KAAK,MAAOtB,EAAE2B,GAAOV,KAAK,eAU3C,QAASa,GAAoBC,GACvBA,EAAQC,eACVD,EAAQF,KAAK,MAAMI,IAAI,UAAW,GAClCF,EAAQG,SAAS,cACjBH,EAAQG,SAAS,aAAc,GAC/BH,EAAQC,aAAe,GA5U3B,GAAIhC,EAAE,uBA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ASU,IAAI,UAAW,KAC9BiF,EAAmBlF,kBAGnBkF,EAAmBlF,cACrBkF,EAAmBhF,SAAS,cAIhC,IAAMkH,GAAiBlC,EACpBrF,KAAK,YAAc+G,EAAUvD,MAAMgE,sBAAwB,MAC3D9H,SACAe,OAEH4E,GAAmBhF,SAAS,aAAckH,KAI5Cb,EAAiB/E,GAAG,iBAAkB,SAAUC,GAC1CyD,EAAmBlF,eACrBF,EAAoBoF,GACpBA,EAAmBlF,aAAe,SAMtC7B,KACAW,IACAd,EAAE,gDAAgDwD,GAAG,QAAS,WAC5D,GAAMyF,GAAQjJ,EAAEyC,KACZwG,GAAMvI,SAAS,uBACjBe,EAAkBwH,EAAM3G,cA0F/BgH","file":"script.min.js","sourcesContent":["(function ($) {\n  $(document).ready(function () {\n\n    // Adds slide navigation through variation thumbnails for variable products\n    // displayed in products listings.\n    if ($('.js-gallerya-slider').length > 0 && typeof $.fn.flickity === 'function') {\n      const arrowShape = 'M85,50.36033a2.72075,2.72075,0,0,0-2.74945-2.68906H24.01177L47.61119,24.59022a2.65667,2.65667,0,0,0,0-3.80232,2.79411,2.79411,0,0,0-3.88955,0L15.80559,48.09077a2.64614,2.64614,0,0,0,0,3.80232L43.729,79.21211a2.79185,2.79185,0,0,0,3.88771,0,2.64613,2.64613,0,0,0,0-3.80233L24.756,53.04939h57.4946A2.72075,2.72075,0,0,0,85,50.36033Z';\n\n      $('.js-gallerya-slider').each(function (index, element) {\n        const galleryaSlider = $(this).closest('.gallerya--slider, .gallerya--product-variation-slider');\n        const navigation = galleryaSlider.data('gallerya-navigation');\n        const pageDots = galleryaSlider.data('galleryaPageDots');\n        const thumbnails = galleryaSlider.find('.js-gallerya-thumbnail-slider');\n        const count = galleryaSlider.find('[data-gallerya-count]');\n        const productLink = galleryaSlider.parents('a.woocommerce-loop-product__link');\n        const sliderArgs = {\n          cellAlign: 'left',\n          contain: true,\n          wrapAround: true,\n          imagesLoaded: true,\n          watchCSS: true,\n          lazyLoad: true,\n        };\n\n        if (!galleryaSlider.hasClass('gallerya--product-variation-slider')) {\n          sliderArgs.arrowShape = arrowShape;\n        }\n        if (typeof pageDots !== 'undefined') {\n          // Let the pageDots property be overriden by a data-attribute.\n          sliderArgs.pageDots = pageDots == true;\n        }\n        else if (typeof navigation === 'undefined' || navigation == false || thumbnails.length > 0) {\n          sliderArgs.pageDots = false;\n        }\n\n        // Adjust styling before slider init.\n        $(this).addClass('flickity');\n        $(this).flickity(sliderArgs);\n\n        // Handle the slide changing to update the variant url\n        $(this).on('change.flickity', function (event, index) {\n          const variantURL = $(this).find('li.is-selected').data('gallerya-variant-permalink');\n          if (variantURL) {\n            productLink.prop('href', variantURL);\n          }\n        });\n\n        const flickityData = $(this).data('flickity');\n        if (thumbnails.length > 0) {\n          const thumbnailsArgs = {\n            asNavFor: element,\n            contain: true,\n            pageDots: false,\n            imagesLoaded: true,\n            groupCells: true,\n            arrowShape: arrowShape,\n          };\n          thumbnails.flickity(thumbnailsArgs);\n\n          $(this).on('select.flickity', function () {\n            const index = flickityData.selectedIndex;\n            const className = 'is-currently-selected';\n            thumbnails.find('.flickity-slider li').removeClass(className)\n              .eq(index).addClass(className);\n          });\n        }\n        if (count) {\n          $(this).on('select.flickity', function () {\n            const slideNumber = flickityData.selectedIndex + 1;\n            count.text(slideNumber + '/' + flickityData.slides.length);\n          });\n        }\n      });\n\n      $('.woocommerce-loop-product__link').on('click', function (e) {\n        // Prevent clicks onto slider arrows to bubble through to wrapping product link.\n        if ($(e.target).closest('.flickity-prev-next-button').length !== 0){\n          e.stopPropagation();\n          return false;\n        }\n      });\n    }\n\n    // Adds lightbox functionality to product gallery.\n    $().fancybox({\n      selector : '[data-fancybox], .js-gallerya-lightbox .gallerya__image > a, .woocommerce-product-gallery .woocommerce-product-gallery__image > a',\n      closeExisting: false,\n      loop: true,\n      keyboard: true,\n      buttons: [\n        'zoom',\n        'fullScreen',\n        'share',\n        'download',\n        'thumbs',\n        'close'\n      ],\n      animationEffect: 'zoom',\n      animationDuration: 250,\n      transitionEffect: 'slide',\n      thumbs: {\n        autoStart: false,\n        axis: 'x'\n      },\n      image: {\n        preload: true\n      },\n      iframe: {\n        preload: true,\n      },\n      lang: fancyboxTranslations.language,\n      i18n: {\n        de: {\n          CLOSE: fancyboxTranslations.de.close,\n          NEXT: fancyboxTranslations.de.next,\n          PREV: fancyboxTranslations.de.prev,\n          ERROR: fancyboxTranslations.de.error,\n          PLAY_START: fancyboxTranslations.de.play_start,\n          PLAY_STOP: fancyboxTranslations.de.play_stop,\n          FULL_SCREEN: fancyboxTranslations.de.full_screen,\n          THUMBS: fancyboxTranslations.de.thumbs,\n          DOWNLOAD: fancyboxTranslations.de.download,\n          SHARE: fancyboxTranslations.de.share,\n          ZOOM: fancyboxTranslations.de.zoom\n        }\n      }\n    });\n\n    // Adds thumbnails slider to product gallery on product detail page.\n    if ($('.js-gallerya-product-thumbnail-slider').length > 0 && typeof $.fn.flickity === 'function') {\n      const $thumbnailSliderEl = $('.js-gallerya-product-thumbnail-slider').parent().find('.flex-control-thumbs').first();\n\n      if (!$thumbnailSliderEl.length) {\n        return;\n      }\n\n      const thumbnailSliderArgs = {\n        contain: true,\n        pageDots: false,\n        imagesLoaded: true,\n        groupCells: true,\n      };\n\n      // Calculate # of cols, given the initial images width as the minimum, at least 4 cols.\n      const thumbnailSpacingUnit  = parseInt(getComputedStyle($thumbnailSliderEl.get(0)).getPropertyValue('--thumbnail-spacing-unit'), 10);\n      const thumbnailSliderMargin = parseInt(getComputedStyle($thumbnailSliderEl.get(0)).getPropertyValue('--thumbnail-slider-margin'), 10);\n      const initialImgsWidth = $thumbnailSliderEl.find('li').first().width();\n      const thumbnailSliderWidth = $thumbnailSliderEl.width();\n      const maxCols = 7;\n      let noCols = 4;\n\n      if (initialImgsWidth > 0 && thumbnailSliderWidth > initialImgsWidth) {\n        while (((thumbnailSliderWidth - (2 * thumbnailSliderMargin)) - (thumbnailSpacingUnit * noCols)) / (noCols + 1) >= initialImgsWidth) {\n          noCols++;\n          if (noCols === maxCols) {\n            break;\n          }\n        }\n        // Update # of cols in css vars.\n        $thumbnailSliderEl.get(0).style.setProperty('--thumbnail-count', noCols);\n      }\n\n      // If less thumbs than slider viewport, don't show prev/next arrows.\n      const numberOfThumbnails = $thumbnailSliderEl.find('li').length;\n      thumbnailSliderArgs.prevNextButtons = numberOfThumbnails > noCols;\n\n      // Add video player and video thumbnail to the product gallery.\n      $thumbnailSliderEl\n        .addClass('flickity')\n        .on('ready.flickity', function () {\n          setProductGalleryVideoSlide();\n        })\n        .on('settle.flickity', function () {\n          setProductGalleryVideoThumbnail();\n        })\n        .on('staticClick.flickity', function (event, pointer, cellElement, cellIndex) {\n          if ($(cellElement).hasClass('slider-thumb-video')) {\n            setVideoPlayerUrl(cellIndex);\n          }\n        });\n      // Initialise the thumbnail slider.\n      const $thumbnailSlider = $thumbnailSliderEl.flickity(thumbnailSliderArgs);\n      const $singleVariation = $('.single_variation_wrap');\n      // Initially no slide is hidden.\n      $thumbnailSliderEl.hiddenSlides = 0;\n\n      // Selects the slide in the product gallery when the user hovers over the\n      // thumbnail images.\n      const productGallery = $('.woocommerce-product-gallery').data('flexslider');\n      if (productGallery) {\n        $thumbnailSlider.on('mouseover', 'li', function (event) {\n          const target = $(event.currentTarget);\n          productGallery.flexslider(target.index());\n          if (target.hasClass('slider-thumb-video')) {\n            setVideoPlayerUrl(target.index());\n          }\n        });\n      }\n\n      // Keep the thumbnails slider in sync with the lightbox navigation.\n      // When we jump to a previous/next slide, the corresponding thumbnail\n      // should also be selected and the slider repositioned.\n      $(document).on('afterShow.fb', function(e, instance, slide) {\n        productGallery.flexslider(slide.index);\n        $thumbnailSliderEl.flickity('selectCell', slide.index);\n      });\n\n      // Reacts to product variation selection.\n      $singleVariation.on('show_variation', function (event, variation) {\n        restoreSliderThumbs($thumbnailSliderEl);\n        // If selected variation has its own images gallery, lower the opacity\n        // of all other thumbnails.\n        const productGallery = product_variation_images.gallery;\n        const selectedVariationImages = product_variation_images[variation.variation_id] || [];\n        if (selectedVariationImages.length > 1) {\n          $thumbnailSliderEl.find('img').each(function () {\n            const $this = $(this);\n            const thumb = $this.attr('src');\n            // Lower the opaciy of the image if its not in the selected variation gallery.\n            if (!selectedVariationImages.includes(thumb)) {\n              $this.parent().css('opacity', 0.15);\n              $thumbnailSliderEl.hiddenSlides++;\n            }\n          });\n          if ($thumbnailSliderEl.hiddenSlides) {\n            $thumbnailSliderEl.flickity('reposition');\n          }\n        }\n        // Get the index of the variation thumbnail in the thumbnail slider.\n        const thumbnailIndex = $thumbnailSliderEl\n          .find('img[src=\"' + variation.image.gallery_thumbnail_src + '\"]')\n          .parent()\n          .index();\n        // Select the variation thumbnail in the thumbnail slider.\n        $thumbnailSliderEl.flickity('selectCell', thumbnailIndex);\n      });\n\n      // Reacts to product variation selection reset.\n      $singleVariation.on('hide_variation', function (event) {\n        if ($thumbnailSliderEl.hiddenSlides) {\n          restoreSliderThumbs($thumbnailSliderEl);\n          $thumbnailSliderEl.hiddenSlides = 0;\n        }\n      });\n    }\n    else {\n      // Flickity is not active.\n      setProductGalleryVideoSlide();\n      setProductGalleryVideoThumbnail();\n      $('.single-product-summary .flex-control-nav li').on('click', function () {\n        const $this = $(this);\n        if ($this.hasClass('slider-thumb-video')) {\n          setVideoPlayerUrl($this.index());\n        }\n      });\n    }\n\n    /**\n     * Swaps first and second slide of product gallery, if first is a video.\n     */\n    function setProductGalleryVideoSlide() {\n      // Video should be the second element in the product gallery.\n      const $galleryWraper = $('.woocommerce-product-gallery .woocommerce-product-gallery__wrapper');\n      const $galleryElements = $galleryWraper\n        .children('.woocommerce-product-gallery__image');\n      if ($galleryElements.length <= 1) {\n        return;\n      }\n      const $firstGalleryElement = $galleryElements.first();\n      if ($firstGalleryElement.hasClass('has-video')) {\n        // Set video as second slide.\n        const firstImage = $galleryWraper\n          .children('.woocommerce-product-gallery__image:not(.has-video)')\n          .first();\n        $firstGalleryElement.detach().insertAfter(firstImage);\n      }\n    }\n\n    /**\n     * Swaps first and second thumbnail of product gallery, if first is a video.\n     */\n    function setProductGalleryVideoThumbnail() {\n      const $videoContent = $('.woocommerce-product-gallery .gallerya__video-content').first();\n      // If there's no video content, exit.\n      if ($videoContent.length < 1) {\n        return;\n      }\n      const videoThumbSrc = $videoContent.data('video-thumb');\n      const $sliderThumbs = $('.flex-control-nav li img');\n      // Video thumb should be the second element in the slider,\n      // unless there's only one slide.\n      const videoThumbPos = $sliderThumbs.length > 1 ? 1 : 0;\n      const videoThumb = $sliderThumbs.eq(videoThumbPos);\n      // Avoid switching thumbnails if second thumb is already the video.\n      if (videoThumb.attr('src') !== videoThumbSrc) {\n        $sliderThumbs.first().attr('src', videoThumb.attr('src'));\n        videoThumb\n          .attr('src', videoThumbSrc)\n          // Ensure lazy loaded image is the video thumbnail.\n          .attr('data-lazy-src', videoThumbSrc)\n          .parent().addClass('slider-thumb-video');\n      }\n    }\n\n    /**\n     * Sets the URL of the video slide referred by a video thumbnail.\n     *\n     * Initially we don't set video URL in the video slide iframe to avoid\n     * loading it if unless it is displayed.\n     * If the thumbnail clicked refers to a video slide, then we assign\n     * the video URL to the player iframe.\n     *\n     * @param {int} slideIndex\n     *   Index of the thumbnail and the slide in the product gallery.\n     */\n    function setVideoPlayerUrl(slideIndex) {\n      const slide = $('.woocommerce-product-gallery .woocommerce-product-gallery__image').eq(slideIndex);\n      if (!$(slide).hasClass('has-video')) {\n        return;\n      }\n      const $videoPlayer = $(slide).find('iframe').first();\n      if (!$videoPlayer.attr('src')) {\n        $videoPlayer.attr('src', $(slide).data('video-url'));\n      }\n    }\n\n    /**\n     * Restores opacity of slides in the given flickity slider.\n     *\n     * @param {object} $slider\n     *   jQuery object for the flickity slider.\n     */\n    function restoreSliderThumbs($slider) {\n      if ($slider.hiddenSlides) {\n        $slider.find('li').css('opacity', 1);\n        $slider.flickity('reposition');\n        $slider.flickity('selectCell', 0);\n        $slider.hiddenSlides = 0;\n      }\n    }\n\n  });\n})(jQuery);\n"],"sourceRoot":"assets/scripts/"}
     1{"version":3,"sources":["../assets/scripts/script.js"],"names":["$","document","ready","setProductGalleryVideoSlide","$galleryWraper","$galleryElements","children","length","$firstGalleryElement","first","hasClass","firstImage","detach","insertAfter","setVideoPlayerUrl","setProductGalleryVideoThumbnail","$videoContent","videoThumbSrc","data","$sliderThumbs","videoThumbPos","videoThumb","eq","attr","parent","addClass","slideIndex","slide","$videoPlayer","find","restoreSliderThumbs","$slider","hiddenSlides","css","flickity","fn","arrowShape","each","index","element","galleryaSlider","this","closest","navigation","pageDots","thumbnails","count","productLink","parents","sliderArgs","cellAlign","contain","wrapAround","imagesLoaded","watchCSS","lazyLoad","on","event","variantURL","prop","flickityData","thumbnailsArgs","asNavFor","groupCells","selectedIndex","className","removeClass","slideNumber","text","slides","e","target","stopPropagation","fancybox","selector","closeExisting","loop","keyboard","buttons","animationEffect","animationDuration","transitionEffect","thumbs","autoStart","axis","image","preload","iframe","lang","fancyboxTranslations","language","i18n","de","CLOSE","close","NEXT","next","PREV","prev","ERROR","error","PLAY_START","play_start","PLAY_STOP","play_stop","FULL_SCREEN","full_screen","THUMBS","DOWNLOAD","download","SHARE","share","ZOOM","zoom","$thumbnailSliderEl","thumbnailSliderArgs","thumbnailSpacingUnit","parseInt","getComputedStyle","get","getPropertyValue","thumbnailSliderMargin","initialImgsWidth","width","thumbnailSliderWidth","maxCols","noCols","style","setProperty","numberOfThumbnails","prevNextButtons","pointer","cellElement","cellIndex","$thumbnailSlider","$singleVariation","productGallery","currentTarget","flexslider","instance","variation","selectedVariationImages","product_variation_images","gallery","variation_id","$this","thumb","includes","thumbnailIndex","gallery_thumbnail_src","jQuery"],"mappings":"CAAA,SAAWA,GACTA,EAAEC,UAAUC,MAAM,WAmQhB,QAASC,KAEP,GAAMC,GAAiBJ,EAAE,sEACnBK,EAAmBD,EACtBE,SAAS,sCACZ,MAAID,EAAiBE,QAAU,GAA/B,CAGA,GAAMC,GAAuBH,EAAiBI,OAC9C,IAAID,EAAqBE,SAAS,aAAc,CAE9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EyC,KACZwG,GAAMvI,SAAS,uBACjBI,EAAkBmI,EAAM3G,cA2F/BgH","file":"script.min.js","sourcesContent":["(function ($) {\n  $(document).ready(function () {\n\n    // Adds slide navigation through variation thumbnails for variable products\n    // displayed in products listings.\n    if ($('.js-gallerya-slider').length > 0 && typeof $.fn.flickity === 'function') {\n      const arrowShape = 'M85,50.36033a2.72075,2.72075,0,0,0-2.74945-2.68906H24.01177L47.61119,24.59022a2.65667,2.65667,0,0,0,0-3.80232,2.79411,2.79411,0,0,0-3.88955,0L15.80559,48.09077a2.64614,2.64614,0,0,0,0,3.80232L43.729,79.21211a2.79185,2.79185,0,0,0,3.88771,0,2.64613,2.64613,0,0,0,0-3.80233L24.756,53.04939h57.4946A2.72075,2.72075,0,0,0,85,50.36033Z';\n\n      $('.js-gallerya-slider').each(function (index, element) {\n        const galleryaSlider = $(this).closest('.gallerya--slider, .gallerya--product-variation-slider');\n        const navigation = galleryaSlider.data('gallerya-navigation');\n        const pageDots = galleryaSlider.data('galleryaPageDots');\n        const thumbnails = galleryaSlider.find('.js-gallerya-thumbnail-slider');\n        const count = galleryaSlider.find('[data-gallerya-count]');\n        const productLink = galleryaSlider.parents('a.woocommerce-loop-product__link');\n        const sliderArgs = {\n          cellAlign: 'left',\n          contain: true,\n          wrapAround: true,\n          imagesLoaded: true,\n          watchCSS: true,\n          lazyLoad: true,\n        };\n\n        if (!galleryaSlider.hasClass('gallerya--product-variation-slider')) {\n          sliderArgs.arrowShape = arrowShape;\n        }\n        if (typeof pageDots !== 'undefined') {\n          // Let the pageDots property be overriden by a data-attribute.\n          sliderArgs.pageDots = pageDots == true;\n        }\n        else if (typeof navigation === 'undefined' || navigation == false || thumbnails.length > 0) {\n          sliderArgs.pageDots = false;\n        }\n\n        // Adjust styling before slider init.\n        $(this).addClass('flickity');\n        $(this).flickity(sliderArgs);\n\n        // Handle the slide changing to update the variant url\n        $(this).on('change.flickity', function (event, index) {\n          const variantURL = $(this).find('li.is-selected').data('gallerya-variant-permalink');\n          if (variantURL) {\n            productLink.prop('href', variantURL);\n          }\n        });\n\n        const flickityData = $(this).data('flickity');\n        if (thumbnails.length > 0) {\n          const thumbnailsArgs = {\n            asNavFor: element,\n            contain: true,\n            pageDots: false,\n            imagesLoaded: true,\n            groupCells: true,\n            arrowShape: arrowShape,\n          };\n          thumbnails.flickity(thumbnailsArgs);\n\n          $(this).on('select.flickity', function () {\n            const index = flickityData.selectedIndex;\n            const className = 'is-currently-selected';\n            thumbnails.find('.flickity-slider li').removeClass(className)\n              .eq(index).addClass(className);\n          });\n        }\n        if (count) {\n          $(this).on('select.flickity', function () {\n            const slideNumber = flickityData.selectedIndex + 1;\n            count.text(slideNumber + '/' + flickityData.slides.length);\n          });\n        }\n      });\n\n      $('.woocommerce-loop-product__link').on('click', function (e) {\n        // Prevent clicks onto slider arrows to bubble through to wrapping product link.\n        if ($(e.target).closest('.flickity-prev-next-button').length !== 0){\n          e.stopPropagation();\n          return false;\n        }\n      });\n    }\n\n    // Adds lightbox functionality to product gallery.\n    $().fancybox({\n      selector : '[data-fancybox], .js-gallerya-lightbox .gallerya__image > a, .woocommerce-product-gallery .woocommerce-product-gallery__image > a',\n      closeExisting: false,\n      loop: true,\n      keyboard: true,\n      buttons: [\n        'zoom',\n        'fullScreen',\n        'share',\n        'download',\n        'thumbs',\n        'close'\n      ],\n      animationEffect: 'zoom',\n      animationDuration: 250,\n      transitionEffect: 'slide',\n      thumbs: {\n        autoStart: false,\n        axis: 'x'\n      },\n      image: {\n        preload: true\n      },\n      iframe: {\n        preload: true,\n      },\n      lang: fancyboxTranslations.language,\n      i18n: {\n        de: {\n          CLOSE: fancyboxTranslations.de.close,\n          NEXT: fancyboxTranslations.de.next,\n          PREV: fancyboxTranslations.de.prev,\n          ERROR: fancyboxTranslations.de.error,\n          PLAY_START: fancyboxTranslations.de.play_start,\n          PLAY_STOP: fancyboxTranslations.de.play_stop,\n          FULL_SCREEN: fancyboxTranslations.de.full_screen,\n          THUMBS: fancyboxTranslations.de.thumbs,\n          DOWNLOAD: fancyboxTranslations.de.download,\n          SHARE: fancyboxTranslations.de.share,\n          ZOOM: fancyboxTranslations.de.zoom\n        }\n      }\n    });\n\n    // Adds thumbnails slider to product gallery on product detail page.\n    if ($('.js-gallerya-product-thumbnail-slider').length > 0 && typeof $.fn.flickity === 'function') {\n      const $thumbnailSliderEl = $('.js-gallerya-product-thumbnail-slider').parent().find('.flex-control-thumbs').first();\n\n      if (!$thumbnailSliderEl.length) {\n        return;\n      }\n\n      const thumbnailSliderArgs = {\n        contain: true,\n        pageDots: false,\n        imagesLoaded: true,\n        groupCells: true,\n      };\n\n      // Calculate # of cols, given the initial images width as the minimum, at least 4 cols.\n      const thumbnailSpacingUnit  = parseInt(getComputedStyle($thumbnailSliderEl.get(0)).getPropertyValue('--thumbnail-spacing-unit'), 10);\n      const thumbnailSliderMargin = parseInt(getComputedStyle($thumbnailSliderEl.get(0)).getPropertyValue('--thumbnail-slider-margin'), 10);\n      const initialImgsWidth = $thumbnailSliderEl.find('li').first().width();\n      const thumbnailSliderWidth = $thumbnailSliderEl.width();\n      const maxCols = 7;\n      let noCols = 4;\n\n      if (initialImgsWidth > 0 && thumbnailSliderWidth > initialImgsWidth) {\n        while (((thumbnailSliderWidth - (2 * thumbnailSliderMargin)) - (thumbnailSpacingUnit * noCols)) / (noCols + 1) >= initialImgsWidth) {\n          noCols++;\n          if (noCols === maxCols) {\n            break;\n          }\n        }\n        // Update # of cols in css vars.\n        $thumbnailSliderEl.get(0).style.setProperty('--thumbnail-count', noCols);\n      }\n\n      // If less thumbs than slider viewport, don't show prev/next arrows.\n      const numberOfThumbnails = $thumbnailSliderEl.find('li').length;\n      thumbnailSliderArgs.prevNextButtons = numberOfThumbnails > noCols;\n\n      // Add video player and video thumbnail to the product gallery.\n      $thumbnailSliderEl\n        .addClass('flickity')\n        .on('ready.flickity', function () {\n          setProductGalleryVideoSlide();\n        })\n        .on('settle.flickity', function () {\n          setProductGalleryVideoThumbnail();\n        })\n        .on('staticClick.flickity', function (event, pointer, cellElement, cellIndex) {\n          if ($(cellElement).hasClass('slider-thumb-video')) {\n            setVideoPlayerUrl(cellIndex);\n          }\n        });\n      // Initialise the thumbnail slider.\n      const $thumbnailSlider = $thumbnailSliderEl.flickity(thumbnailSliderArgs);\n      const $singleVariation = $('.single_variation_wrap');\n      // Initially no slide is hidden.\n      $thumbnailSliderEl.hiddenSlides = 0;\n\n      // Selects the slide in the product gallery when the user hovers over the\n      // thumbnail images.\n      const productGallery = $('.woocommerce-product-gallery').data('flexslider');\n      if (productGallery) {\n        $thumbnailSlider.on('mouseover', 'li', function (event) {\n          const target = $(event.currentTarget);\n          productGallery.flexslider(target.index());\n          if (target.hasClass('slider-thumb-video')) {\n            setVideoPlayerUrl(target.index());\n          }\n        });\n      }\n\n      // Keep the thumbnails slider in sync with the lightbox navigation.\n      // When we jump to a previous/next slide, the corresponding thumbnail\n      // should also be selected and the slider repositioned.\n      $(document).on('afterShow.fb', function(e, instance, slide) {\n        productGallery.flexslider(slide.index);\n        $thumbnailSliderEl.flickity('selectCell', slide.index);\n      });\n\n      // Reacts to product variation selection.\n      $singleVariation.on('show_variation', function (event, variation) {\n        restoreSliderThumbs($thumbnailSliderEl);\n        // If selected variation has its own images gallery, lower the opacity\n        // of all other thumbnails.\n        const productGallery = product_variation_images.gallery;\n        const selectedVariationImages = product_variation_images[variation.variation_id] || [];\n        if (selectedVariationImages.length > 1) {\n          $thumbnailSliderEl.find('img').each(function () {\n            const $this = $(this);\n            const thumb = $this.attr('src');\n            // Lower the opaciy of the image if its not in the selected variation gallery.\n            if (!selectedVariationImages.includes(thumb)) {\n              $this.parent().css('opacity', 0.15);\n              $thumbnailSliderEl.hiddenSlides++;\n            }\n          });\n          if ($thumbnailSliderEl.hiddenSlides) {\n            $thumbnailSliderEl.flickity('reposition');\n          }\n        }\n        // Get the index of the variation thumbnail in the thumbnail slider.\n        const thumbnailIndex = $thumbnailSliderEl\n          .find('img[src=\"' + variation.image.gallery_thumbnail_src + '\"]')\n          .parent()\n          .index();\n        // Select the variation thumbnail in the thumbnail slider.\n        $thumbnailSliderEl.flickity('selectCell', thumbnailIndex);\n      });\n\n      // Reacts to product variation selection reset.\n      $singleVariation.on('hide_variation', function (event) {\n        if ($thumbnailSliderEl.hiddenSlides) {\n          restoreSliderThumbs($thumbnailSliderEl);\n          $thumbnailSliderEl.hiddenSlides = 0;\n        }\n      });\n    }\n    else {\n      // Flickity is not active.\n      setProductGalleryVideoSlide();\n      setProductGalleryVideoThumbnail();\n      $('.single-product-summary .flex-control-nav li').on('click', function () {\n        const $this = $(this);\n        if ($this.hasClass('slider-thumb-video')) {\n          setVideoPlayerUrl($this.index());\n        }\n      });\n    }\n\n    /**\n     * Swaps first and second slide of product gallery, if first is a video.\n     */\n    function setProductGalleryVideoSlide() {\n      // Video should be the second element in the product gallery.\n      const $galleryWraper = $('.woocommerce-product-gallery .woocommerce-product-gallery__wrapper');\n      const $galleryElements = $galleryWraper\n        .children('.woocommerce-product-gallery__image');\n      if ($galleryElements.length <= 1) {\n        return;\n      }\n      const $firstGalleryElement = $galleryElements.first();\n      if ($firstGalleryElement.hasClass('has-video')) {\n        // Set video as second slide.\n        const firstImage = $galleryWraper\n          .children('.woocommerce-product-gallery__image:not(.has-video)')\n          .first();\n        $firstGalleryElement.detach().insertAfter(firstImage);\n        setVideoPlayerUrl(1);\n      }\n    }\n\n    /**\n     * Swaps first and second thumbnail of product gallery, if first is a video.\n     */\n    function setProductGalleryVideoThumbnail() {\n      const $videoContent = $('.woocommerce-product-gallery .gallerya__video-content').first();\n      // If there's no video content, exit.\n      if ($videoContent.length < 1) {\n        return;\n      }\n      const videoThumbSrc = $videoContent.data('video-thumb');\n      const $sliderThumbs = $('.flex-control-nav li img');\n      // Video thumb should be the second element in the slider,\n      // unless there's only one slide.\n      const videoThumbPos = $sliderThumbs.length > 1 ? 1 : 0;\n      const videoThumb = $sliderThumbs.eq(videoThumbPos);\n      // Avoid switching thumbnails if second thumb is already the video.\n      if (videoThumb.attr('src') !== videoThumbSrc) {\n        $sliderThumbs.first().attr('src', videoThumb.attr('src'));\n        videoThumb\n          .attr('src', videoThumbSrc)\n          // Ensure lazy loaded image is the video thumbnail.\n          .attr('data-lazy-src', videoThumbSrc)\n          .parent().addClass('slider-thumb-video');\n      }\n    }\n\n    /**\n     * Sets the URL of the video slide referred by a video thumbnail.\n     *\n     * Initially we don't set video URL in the video slide iframe to avoid\n     * loading it if unless it is displayed.\n     * If the thumbnail clicked refers to a video slide, then we assign\n     * the video URL to the player iframe.\n     *\n     * @param {int} slideIndex\n     *   Index of the thumbnail and the slide in the product gallery.\n     */\n    function setVideoPlayerUrl(slideIndex) {\n      const slide = $('.woocommerce-product-gallery .woocommerce-product-gallery__image').eq(slideIndex);\n      if (!$(slide).hasClass('has-video')) {\n        return;\n      }\n      const $videoPlayer = $(slide).find('iframe').first();\n      if (!$videoPlayer.attr('src')) {\n        $videoPlayer.attr('src', $(slide).data('video-url'));\n      }\n    }\n\n    /**\n     * Restores opacity of slides in the given flickity slider.\n     *\n     * @param {object} $slider\n     *   jQuery object for the flickity slider.\n     */\n    function restoreSliderThumbs($slider) {\n      if ($slider.hiddenSlides) {\n        $slider.find('li').css('opacity', 1);\n        $slider.flickity('reposition');\n        $slider.flickity('selectCell', 0);\n        $slider.hiddenSlides = 0;\n      }\n    }\n\n  });\n})(jQuery);\n"],"sourceRoot":"assets/scripts/"}
  • gallerya/trunk/package.json

    r2631983 r2635456  
    11{
    22  "name": "gallerya",
    3   "version": "2.8.1",
     3  "version": "2.8.2",
    44  "author": "netzstrategen <[email protected]>",
    55  "repository": {
  • gallerya/trunk/plugin.php

    r2631983 r2635456  
    33/*
    44  Plugin Name: Gallerya
    5   Version: 2.8.1
     5  Version: 2.8.2
    66  Text Domain: gallerya
    77  Description: Change the native post gallery to be displayed as a slider with lightbox support.
Note: See TracChangeset for help on using the changeset viewer.