PageSourceSearch

https://ukragroconsult.com/wp-content/themes/hello-elementor-child/assets/js/main.js

js ukragroconsult.com collected 2026-10-01 11:26:48 UTC 24,058 bytes, 662 lines download raw bytes

1jQuery(document).ready(function($) {
2    // close dropdown menu when click outside
3    $(document).mouseup(function(e){
4       var menu = $('.sub-menu');
5       var link = $('.menu-item');
6       if ((!menu.is(e.target) && menu.has(e.target).length === 0)  && (!link.is(e.target) && link.has(e.target).length === 0))
7       {
8        // console.log("some txt");
9
10        $(".menu-open-dropdown").each(function(index) {
11            $(this).removeClass("active-link")
12        })
13
14        $(".mobile-nav__menu .sub-menu").each(function(index) {
15            $(this).removeClass("active-list")
16        })
17
18        $(".header__menu .sub-menu").each(function(index) {
19            $(this).removeClass("active-list")
20        })
21
22       }
23    });
24
25
26    // if (window.innerWidth < 1439) {
27        jQuery('.menu-open-dropdown').click(function(e){
28            e.preventDefault();
29
30            if(!jQuery(this).hasClass('active-link')) {
31                jQuery(".menu-open-dropdown").each(function(index) {
32                    jQuery(this).removeClass("active-link")
33                })
34                jQuery(".mobile-nav__menu .sub-menu").each(function(index) {
35                    jQuery(this).removeClass("active-list")
36                })
37                jQuery(".header__menu .sub-menu").each(function(index) {
38                    jQuery(this).removeClass("active-list")
39                })
40            }
41           jQuery(this).closest("li").find("ul").toggleClass("active-list")
42           jQuery(this).toggleClass("active-link")
43        });
44
45    // }
46
47
48
49    // mobile menu burger
50    $('#hamburger').click(function(e) {
51        $(this).toggleClass("hamburger--active")
52        $("#mobileNav").fadeToggle()
53
54                jQuery(".menu-open-dropdown").each(function(index) {
55                    jQuery(this).removeClass("active-link")
56                })
57
58                jQuery(".mobile-nav__menu .sub-menu").each(function(index) {
59                    jQuery(this).removeClass("active-list")
60                })
61    })
62
63    // // disable menu-item-has-children click
64    // $(".menu-item-has-children").click(function(e) {
65    //     e.preventDefault();
66    // })
67
68    // home page
69    if ($(".home-news")[0]) {
70        if ($(window).width() < 992) {
71            const swiper = new Swiper('#homeNewsSlider', {
72                slidesPerView: 1,
73                spaceBetween: 30,
74                breakpoints: {
75                    768: {
76                        slidesPerView: 2
77                    }
78                },
79                pagination: {
80                    el: "#homeNewsSliderPagination"
81                }
82            })
83        }
84    }
85
86    if ($("#previewVideo")[0]) {
87        $('#previewVideo').lightGallery();
88    }
89
90    // about page
91    $(".about-experience__tabs-link ").click(function(e) {
92        e.preventDefault();
93        $(".about-experience__tabs-link--active").removeClass("about-experience__tabs-link--active")
94        $(this).addClass("about-experience__tabs-link--active")
95        $(".about-experience__tab-content").each(function(index) {
96            $(this).hide()
97        })
98        let year = $(this).data("year")
99        year = '#' + year
100        $(year).show()
101    })
102
103    if ($("#aboutVideo")[0]) {
104        $('#aboutVideo').lightGallery();
105    }
106
107    // news page && search
108    if ($("#newsSort")[0]) {
109        $("#newsSort").selectric({
110            disableOnMobile: false,
111        })
112    }
113
114
115
116    function changeParamAndRedirect(url, param, oldValue, newValue) {
117        let replacedUrl = url.replace(param + "=" + oldValue, (param + "=" + newValue));
118        window.location.replace(replacedUrl)
119    }
120
121    function paramExist(url, param) {
122        if ((url.indexOf('?' + param + '=') != -1) || (url.indexOf('&' + param + '=') != -1)) {
123            return true
124        } else {
125            return false
126        }
127    }
128
129    function getValueOfParam(url, param) {
130        let newurl = new URL(url);
131        let paramValue = newurl.searchParams.get(param);
132        return paramValue;
133    }
134
135    if ($("#newsDateFrom")[0]) {
136        $('#newsDateFrom').datepicker({
137            onSelect: function onSelect(fd, date) {
138                let currentUrl = window.location.href;
139                if (paramExist(currentUrl, "from")) {
140                    changeParamAndRedirect(currentUrl, "from", getValueOfParam(currentUrl, "from"), fd)
141                } else {
142                    if ((paramExist(currentUrl, "to")) || (paramExist(currentUrl, "order")) || (paramExist(currentUrl, "cpage")) || (paramExist(currentUrl, "cat"))) {
143                        window.location.replace(currentUrl + "&from=" + fd);
144                    } else {
145                        window.location.replace(currentUrl + "?from=" + fd);
146                    }
147                }
148            }
149        })
150    }
151
152    if ($("#newsDateTo")[0]) {
153        $('#newsDateTo').datepicker({
154            onSelect: function onSelect(fd, date) {
155                let currentUrl = window.location.href;
156                if (paramExist(currentUrl, "to")) {
157                    changeParamAndRedirect(currentUrl, "to", getValueOfParam(currentUrl, "to"), fd)
158                } else {
159                    if ((paramExist(currentUrl, "from")) || (paramExist(currentUrl, "order")) || (paramExist(currentUrl, "cpage")) || (paramExist(currentUrl, "cat"))) {
160                        window.location.replace(currentUrl + "&to=" + fd);
161                    } else {
162                        window.location.replace(currentUrl + "?to=" 
162+ fd);
163                    }
164                }
165            }
166        })
167    }
168
169    $("#newsSort").change(function() {
170        let currentUrl = window.location.href;
171        if (paramExist(currentUrl, "order")) {
172            changeParamAndRedirect(currentUrl, "order", getValueOfParam(currentUrl, "order"), $(this).val())
173        } else {
174            if ((paramExist(currentUrl, "from")) || (paramExist(currentUrl, "to")) || (paramExist(currentUrl, "cpage")) || (paramExist(currentUrl, "cat"))) {
175                window.location.replace(currentUrl + "&order=" + $(this).val());
176            } else {
177                window.location.replace(currentUrl + "?order=" + $(this).val());
178            }
179        }
180    })
181
182    // single research
183    if ($("#sliderOtherResearch")[0]) {
184        const swiper = new Swiper('#sliderOtherResearch', {
185            slidesPerView: 1,
186            spaceBetween: 15,
187            breakpoints: {
188                768: {
189                    slidesPerView: 2,
190                    spaceBetween: 15
191                },
192                992: {
193                    slidesPerView: 3
194                }
195            },
196            navigation: {
197                nextEl: "#sliderOtherResearchNext",
198                prevEl: "#sliderOtherResearchPrev"
199            },
200        });
201    }
202
203    if ($("#rightside-1")[0]) {
204        var offsideMenu1 = offside('#rightside-1', {
205            buttonsSelector: '.btn-rightside-1 , .btn-close-1',
206            slidingSide: 'right',
207        });
208    }
209    if ($("#diagramPopup-1")[0]) {
210        var offsideMenu1 = offside('#diagramPopup-1', {
211            buttonsSelector: '.btn-diagramPopup-1 , .diagramPopup-close-1',
212            slidingSide: 'right',
213        });
214    }
215    if ($("#rightside-2")[0]) {
216        var offsideMenu2 = offside('#rightside-2', {
217            buttonsSelector: '.btn-rightside-2 , .btn-close-2',
218            slidingSide: 'right',
219        });
220    }
221    if ($("#diagramPopup-2")[0]) {
222        var offsideMenu2 = offside('#diagramPopup-2', {
223            buttonsSelector: '.btn-diagramPopup-2 , .diagramPopup-close-2',
224            slidingSide: 'right',
225        });
226    }
227    if ($(".single-research .site-overlay")[0]) {
228        let overlay = document.querySelector('.site-overlay').addEventListener('click', offside.factory.closeOpenOffside);
229        let container = document.getElementsByClassName('single-research__container')[0];
230        let windowHeight = window.innerHeight;
231        let windowWidth = window.innerWidth;
232        let scrollArea = windowHeight;
233        let square1 = document.getElementsByClassName('single-research__img-side')[0];
234        window.addEventListener('scroll', function() {
235            var scrollTop = window.pageYOffset || window.scrollTop;
236            var scrollPercent = scrollTop / scrollArea || 0;
237            jQuery('.single-research__img-side').animate({
238                top: scrollPercent * window.innerHeight + 'px'
239            }, 5, 'linear')
240            square1.style.top = scrollPercent * window.innerHeight + 'px';
241        });
242    }
243
244    // conference about single
245    if ($("#videoGallery")[0]) {
246        $('#videoGallery').lightGallery();
247    }
248    if ($("#conferenceStart")[0]) {
249        let countDownDate = new Date($("#conferenceStart").val()).getTime();
250
251
252        let now = new Date().getTime();
253        let distance = countDownDate - now;
254        if (distance < 0) {
255             $(".conference-heading__timer").remove();
256        }
257
258        let x = setInterval(function() {
259
260            let days = Math.floor(distance / (1000 * 60 * 60 * 24));
261            let hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
262            let minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
263            document.getElementById("timerDays").innerHTML = days
264            document.getElementById("timerHours").innerHTML = hours
265            document.getElementById("timerMinutes").innerHTML = minutes
266
267            if (distance < 0) {
268                clearInterval(x);
269                $(".conference-heading__date").innerHTML = "EXPIRED";
270            }
271        }, 1000);
272    }
273    if ($("#sliderSpeakers")[0]) {
274        const swiper = new Swiper('#sliderSpeakers', {
275            slidesPerView: 1,
276            breakpoints: {
277                768: {
278                    slidesPerView: 2,
279                    spaceBetween: 15
280                },
281                992: {
282                    slidesPerView: 3,
283                    spaceBetween: 15
284                },
285                1200: {
286                    slidesPerView: 5,
287                    spaceBetween: 15
288                }
289            },
290            navigation: {
291                nextEl: "#sliderSpeakersNext",
292                prevEl: "#sliderSpeakersPrev"
293            }
294        });
295    }
296
297
298
299    if ($("#sliderPhotogallery")[0]) {
300        const swiper = new Swiper('#sliderPhotogallery', {
301            slidesPerView: 1,
302            breakpoints: {
303                768: {
304                    slidesPerView: 1,
305                    spaceBetween: 15
306                },
307                992: {
308                    slidesPerView: 3,
309                    spaceBetween: 15
310                },
311                1200: {
312                    slidesPerView: 3,
313                    spaceBetween: 15
314                }
315            },
316            navigation: {
317                nextEl: "#sliderGalleryNext",
318                prevEl: "#sliderGalleryPrev"
319            }
320        });
321    }
322
323
324    if ($(".conference-program")[0]) {
325        $('a[data-target^="pt"]').click(function() {
326            let date = $(this).closest('ul').attr('data-date');
327            let stream = $(this).attr('data-target');
328            $(this).closest('ul').find('.conference-program__dates-link--active').removeClass('conference-program__dates-link--active');
329            $(this).addClass('conference-program__dates-link--active');
330            $('.conference-program__content.active').removeClass('active');
331            $('.conference-program__content.' + date + '.' + stream + '').addClass('active');
332
333            console.log(stream)
334        })
335        $('a[data-target^="date"]').click(function() {
336            console.log($(this).attr('data-target'));
337            let date = $(this).attr('data-target');
338            $(this).closest('ul').find('.conference-program__dates-link--active').removeClass('conference-program__dates-link--active');
339            $(this).addClass('conference-program__dates-link--active');
340
341            $('.conference-program ul[data-date].active').removeClass('active');
342            $('ul[data-date="' + date + '"]').addClass('active');
343            $('ul[data-date="' + date + '"] li:first-child a').click();
344
345            $(".conference-program__content").each(function(index) {
346
347                $(this).removeClass('active');
348                $('.conference-program__content[data-date="' + date + '"]').addClass('active');
349
350
351            })
352
353        })
354    }
355
356    // conference program SELECTRIC
357    if ($("#programDate")[0] && $(".programFlow")[0]) {
358
359        $("#programDate").selectric()
360        $("#programDate").on('change', function(){
361            let date = $(this).find(':selected').data('target');
362            $('.conference-program ul[data-date].active').removeClass('active');
363            $('ul[data-date="' + date + '"]').addClass('active');
364            $('ul[data-date="' + date + '"] li:first-child a').click();
365
366            $(".conference-program__content").each(function(index) {
367                $(this).removeClass('active');
368                $('.conference-program__content[data-date="' + date + '"]').addClass('active');
369            })
370
371
372            $(".selectric-programFlow").each(function(index) {
373                $(this).removeClass('selectric-active');
374                $('.programFlow[data-date="' + date + '"]').closest('.selectric-programFlow').addClass('selectric-active')
375
376                //$(this).find('.programFlow').prop('selectedIndex', 0).selectric('refresh'); // reset potok
377
378            })
379        });
380
381        $(".programFlow").each(function(index) {
382            $(this).selectric()
383            $(this).on('change', function(){
384                let date = $(this).attr('data-date')
385                let stream = $(this).find(':selected').data('target');
386                $('.conference-program__content.active').removeClass('active');
387                $('.conference-program__content.' + date + '.' + stream + '').addClass('active');
388            });
389
390        })
391
392    }
393
394    // conference marketing
395    $('.marketing-service__btn').on("click", function(e) {
396        e.preventDefault();
397        $('#marketing-stends').val($(this).closest(".marketing-service__info").find('.marketing-service__title').text())
398        $("#marketingModal").fadeIn()
399    })
400
401    // conference sponsors package
402    $('.sposor-package__btn').on("click", function(e) {
403        e.preventDefault();
404        $('#sponsors-package').val(jQuery(this).closest(".conference-sponsors-package__item").find('.sponsor-package__title').text())
405        $("#sponsorsPackageModal").fadeIn()
406    })
407
408    // page upcoming conferences
409    $(".archive-conferences__year-link").click(function(e) {
410        e.preventDefault();
411        $(".archive-conferences__year-link--active").removeClass("archive-conferences__year-link--active")
412        $(this).addClass("archive-conferences__year-link--active")
413        $(".archive-conferences__year-wrapper").each(function(index) {
414            $(this).hide()
415        })
416        let year = $(this).data("year")
417        year = '#year-' + year
418        $(year).show()
419    })
420
421    //faq
422    $('.faq__item').toggle(function () {
423        $(this).addClass("faq-item--active");
424    }, function () {
425        $(this).removeClass("faq-item--active");
426    });
427
428
429
430    // footer menu toggle
431    $('.footer-nav__chapter-title').each(function(index, value) {
432        $(this).click((function(e) {
433            $(this).parent().children(".footer-nav__list").slideToggle()
434            $(this).parent().children(".footer-nav__chapter-arrow").toggleClass("footer-nav__chapter-arrow--active")
435        }))
436    });
437
438
439
440    // ALL MODALS
441    $('.open-modal').on("click", function(e) {
442        e.stopPropagation()
443        console.log('.open-modal')
444        let id = $(this).attr('id')
445        $("[data-speaker_id='" + id + "']").fadeIn()
446    })
447
448    $(".modal-xl").click(function(e) {
449        $(this).fadeOut()
450    })
451    $(".modal__in-xl").click(function(e) {
452        e.stopPropagation()
453    })
454    // all modals
455    $(".modal__close").click(function(e) {
456        // $("#freeConsultationModal").fadeOut()
457        $(this).closest('.modal-xl').fadeOut()
458    })
459
460
461
462
463    // footer modal form
464    $('#getFreeConsultation').click(function(e) {
465        e.stopPropagation()
466        $("#freeConsultationModal").fadeIn()
467    })
468    $('#bonusReportModalBtn').click(function(e) {
469        e.stopPropagation()
470        $("#bonusReportModal").fadeIn()
471    })
472    $(".modal").click(function(e) {
473        $(this).fadeOut()
474    })
475    $(".modal__in").click(function(e) {
476        e.stopPropagation()
477    })
478    // all modals
479    $(".modal__close").click(function(e) {
480        // $("#freeConsultationModal").fadeOut()
481        $(this).closest('.modal').fadeOut()
482    });
483
484
485
486    // conference nav menu update
487    if ($(".conference-menu").length > 0) {
488      if ($(".conference-menu .conference-menu__link").length > 0) {
489        // $(".conference-menu .conference-menu__item")[0].addClass('current');
490        $(".conference-menu .conference-menu__link").each(function( index ) {
491          if ($(this).hasClass('conference-menu__link--active')) {
492            $(this).parent('.conference-menu__item').addClass('current');
493          }
494        });
495      }
496      if ($(".conference-menu__wrapper .conf-nav-btn")) {
497        $(".conference-menu__wrapper .conf-nav-btn").on("click", function(e){
498          e.preventDefault();
499          $(this).parent('.conference-menu__wrapper').toggleClass('open');
500        });
501      }
502    }
503
504    // research nav menu update
505    if ($(".research__wr .research__tabs").length > 0) {
506      if ($(".research__tabs .list--tab__tab-link").length > 0) {
507        // $(".research__tabs .conference-menu__item")[0].addClass('current');
508        $(".research__tabs .list--tab__tab-link").each(function( index ) {
509          if ($(this).hasClass('list--tab__tab-link--active')) {
510            $(this).parent('.list--tab__tab').addClass('current');
511          }
512        });
513      }
514      if ($(".research__tabs .conf-nav-btn")) {
515        $(".research__tabs .conf-nav-btn").on("click", function(e){
516          e.preventDefault();
517          $(this).parent('.research__tabs').toggleClass('open');
518        });
519      }
520    }
521
522    /* wfp form */
523    if ($('.wpcf7-form .wfp-form').length) {
524        var $currForm = $('.wpcf7-form .wfp-form').parent('.wpcf7-form');
525        $currForm.on('wpcf7submit', function(){
526            var customerName = $currForm.find('input[name="your-name"]').val();
527            var customerEmail = $currForm.find('input[name="your-email"]').val();
528            if (customerName) {
529                localStorage.setItem('customerName', customerName);
530            }
531            if (customerEmail) {
532                localStorage.setItem('customerEmail', customerEmail);
533            }
534        });
535    }
536
537    /* js amoCRM */
538    const getQuery = window.location.search;
539    function createCookie(name, value, days) {
540        var expires = "";
541        if (days) {
542            var date = new Date();
543            date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
544            expires = "; expires=" + date.toUTCString();
545        }
546        document.cookie = name + "=" + value + expires + "; path=/";
547    }
548    function readCookie(name) {
549        var nameEQ = name + "=";
550        var ca = document.cookie.split(';');
551        for (var i = 0; i < ca.length; i++) {
552            var c = ca[i];
553            while (c.charAt(0) == ' ') c = c.substring(1, c.length);
554            if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
555        }
556        return null;
557    }
558    function eraseCookie(name) {
559        createCookie(name, "", -1);
560    }
561    // eraseCookie('urlGetData');
562    if (getQuery.includes('utm_')) {
563        createCookie('urlGetData', getQuery, 31);
564    }
565    if (readCookie('urlGetData') !== null) {
566        if ($("main form").length) {
567            // var $hrefInput = $("<input>").attr({
568            //     type: "hidden",
569            //     name: "href",
570            //     class: "getDataUrl",
571            //     value: ""
572            // })
573            $("main form").each(function(i) {
574                if ($(this).find('input[name="href"]').length == 0) {
575                    $("<input>").attr({
576                        type: "hidden",
577                        name: "href",
578                        class: "getDataUrl",
579                        value: ""
580                    }).insertAfter($(this).find("input:not([type=hidden]):not([type=submit]):last"));
581                    // $(this)[0].reset();
582                }
583            });
584        }
585        // console.log($('main form input[name="href"]').length);
586        // console.log(readCookie('urlGetData'));
587    }
588    if ($("form input.getDataUrl").length && readCookie('urlGetData')) {
589        $("form input.getDataUrl").val(readCookie('urlGetData'));
590        if ($('.conference-reg').length) {
591            $('.conference-reg').attr('data-getDataUrl', readCookie('urlGetData'));
592        }
593    }
594
595    // latina chapters fix
596    if ($('body.postid-114552 input[type="text"]').length || $('body.postid-236990 input[type="text"]').length || $('body.postid-235703 input[type="text"]').length || $('body.postid-244196 input[type="text"]').length || $('body.postid-222478 input[type="text"]').length) {
597        //console.log($().length);
598        $('input[type="text"]').on("input", function(event) {
599            var input = event.target;
600            var regex = /^[^\u0400-\u04FF]+$/;
601
602            if (!regex.test(input.value)) {
603                input.value = input.value.replace(/[\u0400-\u04FF]+/g, '');
604            }
605        });
606    }
607
608    /* pdfjs settings */
609    if (document.querySelector(".pdfjs-fullscreen")) {
610      const pdfjsFullScreen = document.querySelectorAll(".pdfjs-fullscreen");
611      pdfjsFullScreen.forEach(function (pdfjsFsBtn) {
612        pdfjsFsBtn.querySelector("a").innerHTML = '<span class="dashicons dashicons-fullscreen-alt"></span>';
613        // pdfjsFsBtn.querySelector("a.pdfjs-fullscreen").addEventListener("click", function (e) {
614        //   e.preventDefault();
615        //   const pdfjsIframe = document.querySelector(".pdfjs-iframe");
616        //   if (pdfjsIframe) {
617        //     pdfjsIframe.requestFullscreen();
618        //   }
619        // });
620      });
621    }
622    if (document.querySelector("iframe.pdfjs-iframe")) {
623      const iframes = document.querySelectorAll("iframe.pdfjs-iframe");
624      iframes.forEach(function (iframe) {
625        iframe.onload = function () {
626          const iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
627
628          // hide right bar
629          const addTextButton = iframeDoc.querySelector('#secondaryToolbarToggle');
630          if (addTextButton) {
631            addTextButton.style.display = "none";
632            addTextButton.style.visibility = "hidden";
633          }
634
635          // replace fullscreen
636          const toolbar = iframeDoc.querySelector('#toolbarViewerRight');
637          if (toolbar && !iframeDoc.querySelector('#uac-fullscreen-btn')) {
638            const btn = iframeDoc.createElement('button');
639            btn.id = 'uac-fullscreen-btn';
640            btn.title = 'Повний екран';
641            btn.className = 'toolbarButton';
642            btn.innerHTML = '<span class="toolbarLabel" style="min-width:28px; width:28px; height: 28px; font-size: 24px; line-height: 1; margin-top: 4px;">&#x26F6;</span>';
643            btn.style.cssText = 'min-width:28px;padding:0 4px;font-size:16px;cursor:pointer;';
644            btn.addEventListener('click', function () {
645              window.open(iframe.src, '_blank');
646            });
647            toolbar.insertBefore(btn, toolbar.firstChild);
648          }
649
650          // autoheight
651          const checkPageReady = setInterval(() => {
652            const firstPage = iframeDoc.querySelector('.page');
653            if (firstPage && firstPage.offsetHeight > 0) {
654              clearInterval(checkPageReady);
655              const padding = 24;
656              iframe.style.height = (firstPage.offsetHeight + padding) + "px";
657            }
658          }, 300);
659        };
660      });
661    }
662})

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.