PageSourceSearch

https://cholita.gal/wp-content/themes/ciao/assets/js/zoo-scripts.js

js cholita.gal collected 2026-10-08 07:25:22 UTC 7,802 bytes, 203 lines download raw bytes

1//**All config js of theme
2(function ($) {
3    'use strict';
4    jQuery(document).ready(function ($) {
5        //Full width media for block
6        MediaFullWidth($('.media-block iframe'));
7        //Comment form js
8        zoo_comment_form_field();
9
10        //Back to Top
11        zoo_back_to_top();
12
13        // Fixes rows in RTL
14        function zoo_fix_vc_full_width_row() {
15            var $elements = jQuery('[data-vc-full-width="true"]');
16            jQuery.each($elements, function () {
17                var $el = jQuery(this);
18                $el.css('right', $el.css('left')).css('left', '');
19            });
20        }
21
22        jQuery(document).on('vc-full-width-row', function () {
23            if ($('body.rtl')[0]) {
24                zoo_fix_vc_full_width_row();
25            }
26        });
27        // Run one time because it was not firing in Mac/Firefox and Windows/Edge some times
28        zoo_fix_vc_full_width_row();
29        //Full width embed
30        var current_width = 0;
31        $(window).resize(function () {
32            if (current_width != $(window).width()) {
33                current_width = $(window).width();
34                if ($('.single .post-detail iframe')[0]) {
35                    $('.single .post-detail iframe').each(function () {
36                        let ration = $(this).height() / $(this).width();
37                        let wrap_width = $(this).parent().width();
38                        $(this).width(wrap_width);
39                        $(this).height(wrap_width * ration);
40                    })
41                }
42            }
43        }).resize();
44        if (typeof  $.fn.slick != 'undefined') {
45            $('.post-slider').slick({
46                slidesToShow: 1,
47                slidesToScroll: 1,
48                rows: 0,
49                rtl: $('body.rtl')[0] ? true : false,
50                swipe: true,
51                centerPadding: '120px',
52                prevArrow: '<span class="zoo-carousel-btn prev-item"><i class="cs-font clever-icon-arrow-left-5"></i></span>',
53                nextArrow: '<span class="zoo-carousel-btn next-item "><i class="cs-font clever-icon-arrow-right-5"></i></span>',
54                centerMode: true,
55                responsive: [
56                    {
57                        breakpoint: 768,
58                        settings: {
59                            centerPadding: '40px',
60                        }
61                    },
62                    {
63                        breakpoint: 480,
64                        settings: {
65                            arrows: false,
66                            centerPadding: '0',
67                        }
68                    }
69                ]
70            });
71        }
72        //Add arrow toggle for Widget categories
73        if ($('.widget_categories, .widget_nav_menu, .widget_pages')[0]) {
74            $('.widget_categories, .widget_nav_menu, .widget_pages').each(function () {
75                $(this).find('.children, .sub-menu').parent().append('<span class="cs-font clever-icon-down toggle-view"></span>');
76            });
77            $(document).on('click', 'span.toggle-view', function () {
78                $(this).toggleClass('active');
79                $(this).parent().find(' > .children').slideToggle();
80                $(this).parent().find('>.sub-menu').slideToggle();
81            });
82        }
83
84        // Append text direction switcher button
85        if (zooThemeSettings.enable_dev_mode === '1') {
86            var $body = $(document.body),
87                queryMark = null,
88                currentUrl = window.location.href.replace(/[&|\?]text-direction=\S{3}/g, '');
89
90            if (!$('#zoo-theme-dev-actions').length) {
91                $body.append('<div id="zoo-theme-dev-actions"></div>');
92            }
93
94            if (currentUrl.indexOf('?') > -1) {
95                queryMark = '&';
96            } else {
97                queryMark = '?';
98            }
99
100            if (zooThemeSettings.isRtl || $body.hasClass('rtl')) {
101                $('#zoo-theme-dev-actions').append('<a class="button action-link" href="' + currentUrl + queryMark + 'text-direction=ltr">LTR</a>');
102            } else {
103                $('#zoo-theme-dev-actions').append('<a class="button action-link" href="' + currentUrl + queryMark + 'text-direction=rtl">RTL</a>');
104            }
105        }
106    });
107
108    //Comment form effect when focus
109    function zoo_comment_form_field() {
110        //Comment form effect
111        $(document).on('focusin', '.wrap-text-field input, .wrap-text-field textarea', function () {
112            $(this).parents('.wrap-text-field').addClass('focus');
113        });
114        $(document).on('focusout', '.wrap-text-field input, .wrap-text-field textarea', function () {
115            if ($(this).val() == '')
116                $(this).parents('.wrap-text-field').removeClass('focus');
117        });
118        $('.wrap-text-field input, .wrap-text-field textarea').each(function () {
119            if ($(this).val() != '')
120                $(this).parents('.wrap-text-field').addClass('focus');
121        });
122    }
123
124    $(window).on('load', function () {
125        $('#page-load').addClass('deactive');
126        $('.lazy-img').zoo_lazyImg();
127    });
128
129    jQuery.fn.extend({
130        //Lazy Img Config
131        zoo_lazyImg: function () {
132            if ($(this)[0]) {
133                $(this).not('.sec-img, .loaded').parent().addClass('loading');
134                if(typeof deferimg !="undefined"){
135                    deferimg('img[data-src]:not(.sec-img)', 0, 'loaded',
136                        function () {
137                            $(this).closest('.loading').removeClass('loading');
138                        });
139                }
140            }
141        },
142        ActiveScreen: function () {
143            var itemtop, windowH, scrolltop;
144            itemtop = $(this).offset().top;
145            windowH = $(window).height();
146            scrolltop = $(window).scrollTop();
147            if (itemtop < scrolltop + windowH * 2 / 3) {
148                return true;
149            }
150            else {
151                return false;
152            }
153        },
154
155    });
156    var MediaFullWidth = function (selector) {
157        var current_width = 0;
158        $(window).resize(function () {
159            if (current_width != $(window).width()) {
160                current_width = $(window).width();
161                selector.each(function () {
162                    let aspectRatio = $(this).height() / $(this).width();
163                    $(this).removeAttr('height').removeAttr('width');
164                    let newWidth = jQuery(this).parent().width();
165                    $(this).width(newWidth).height(newWidth * aspectRatio);
166                });
167            }
168        }).resize();
169    };
170
171    //Back to top function
172    function zoo_back_to_top() {
173        $(window).load(function () {
174            if ($('#zoo-back-to-top')[0]) {
175                let $toTopButton = $('#zoo-back-to-top');
176                jQuery(window).on("scroll", function () {
177                    if ($(window).scrollTop() > 100) {
178                        $toTopButton.addClass('active')
179                    } else {
180                        $toTopButton.removeClass('active')
181                    }
182                });
183                $(document).on('click', '#zoo-back-to-top', function (e) {
184                    e.preventDefault();
185                    $('html, body').animate({
186                        scrollTop: 0
187                    }, 700);
188                });
189            }
190        });
191    }
192
193
194    $(document).on('click', '.cvca-button', function (e) {
195        let target = $(this).attr('href');
196        if ($(target)[0]) {
197            e.preventDefault();
198            $('html, body').animate({
199                scrollTop: $(target).offset().top - $('.site-header').height() / 2
200            }, 800);
201        }
202    });
203})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.