HEX
Server: Apache/2
System: Linux vps33975.sdns.vn 3.10.0-1160.15.2.el7.x86_64 #1 SMP Wed Feb 3 15:06:38 UTC 2021 x86_64
User: agritom (1060)
PHP: 7.4.33
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/agritom/public_html/wp-content/plugins/devvn-woocommerce-reviews/js/mh-custom.js
(function ($) {
    'use strict';

    // Document ready
    $(function () {
        /* Carousel reviews */
        // $('.reviews-carousel').owlCarousel({
        //     loop: true,
        //     dots: false,
        //     nav: false,
        //     items: 1,
        // });

        /* Gallery all comment */
        var order = '';
        var container = [];
        $('.devvn_list_item').each(function() {
            var item = {
                src: $(this).find('.devvn_reviews_detail').html(),
            };
            container.push(item);
        });
        
        $('.devvn-reviews-img-popup').click(function(e) { 
            order = parseInt($(this).attr('data-order'))-1;
        });

        $('.devvn-reviews-img-popup').magnificPopup({
            type: 'inline',
            items: container,
            mainClass: 'devvn-shortcode-reviews-popup',
            gallery:{
                enabled:true
            },
            callbacks: {
                open: function() {
                    $(this).magnificPopup('goTo', order);

                    // $('.reviews-carousel').owlCarousel({
                    //     loop: true,
                    //     dots: true,
                    //     nav: false,
                    //     items: 1
                    // });

                    $('.reviews-carousel').flickity({
                        // options
                        cellAlign: 'left',
                        contain: true,
                        wrapAround: true,
                        pauseAutoPlayOnHover: true,
                        prevNextButtons: false,
                        pageDots: true,
                    });

                    $('.mfp-arrow').click(function(e) {  
                        // $('.reviews-carousel').owlCarousel({
                        //     loop: true,
                        //     dots: true,
                        //     nav: false,
                        //     items: 1
                        // });

                        $('.reviews-carousel').flickity({
                        // options
                        cellAlign: 'left',
                        contain: true,
                        wrapAround: true,
                        pauseAutoPlayOnHover: true,
                        prevNextButtons: false,
                        pageDots: true,
                    });
                    });
                }
            }
        });

        /* Gallery image comment */
        $('.cmt_attachment_img a').click(function(e) {
            e.preventDefault();
            var container = [];
            var pswp_cmt = $(this).attr('data-pswp');
            $('#cmt_attachment_img_'+pswp_cmt).find('li').each(function() {
                var $link = $(this).find('a'),
                item = {
                    src: $link.data('link'),
                    w: $link.data('width'),
                    h: $link.data('height'),
                    title: $link.data('caption')
                };
                container.push(item);
            });
            
            var $pswp = $('.pswp')[0],
            options = {
                index: $(this).parent('li').index(),
                bgOpacity: 0.85,
                showHideOpacity: true
            };
            var gallery = new PhotoSwipe($pswp, PhotoSwipeUI_Default, container, options);
            gallery.init();
        });
    });

    // On window load
    $(window).on('load', function () {

    });

})(jQuery);