PageSourceSearch

https://synexlogistics.com/wp-content/themes/ndc_new/assets/js/work.js?ver=1.0.2

js synexlogistics.com collected 2026-10-04 19:36:19 UTC 16,003 bytes, 414 lines download raw bytes

1function ValidateEmail(mail)
2{
3    if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.emailAddr.value))
4    {
5        return (true)
6    }
7    return (false)
8}
9document.addEventListener( 'wpcf7submit', function( event ) {
10    var pageTitle = document.title;
11    document.querySelector( 'input[name="page-title"]' ).value = pageTitle + '( ' + window.location.href + ')';
12}, false );
13document.addEventListener( 'wpcf7mailsent', function( event ) {
14    var pageTitle = document.title;
15    jQuery('.click-to-thank').trigger('click');
16}, false );
17function changeRightPopup(){
18    let w_c = jQuery('.header__top>.container').width();
19    let r = (window.innerWidth - w_c)/2;
20    jQuery('.wrapper-tabs-content-l').css('right', r+'px');
21}
22window.onresize = changeRightPopup;
23jQuery( document ).ready(function($) {
24changeRightPopup();
25    $(document).on('click', '.lang-btn-popup', function(e){
26        e.preventDefault();
27        $('.wrapper-tabs-content-l').toggleClass('hidden');
28    });
29    $(document).mouseup( function(e){
30        var div = $( ".wrapper-tabs-content-l" );
31        if ( !div.is(e.target)
32            && div.has(e.target).length === 0 ) {
33            $('.wrapper-tabs-content-l').addClass('hidden');
34        }
35    });
36    /*$(document).on('bind', '.wpcf7-form input', function(e){
37        e.preventDefault();
38        alert('y');
39    });*/
40    $(".wpcf7-form input").on("change", function(e){
41        e.preventDefault();
42        //alert("The paragraph was clicked.");
43    });
44    $(document).on('click', '.click_go_wrapper', function(e){
45        e.preventDefault();
46        window.location.href = $(this).attr('data-url');
47    });
48    /*jQuery('.telephone_input_class').each(function(index, value) {
49
50        var name =  jQuery(this).attr("name");
51        var enable_dropdown =  jQuery(this).attr("enable_dropdown");
52
53        var inputa = document.querySelector("input[name="+ name +"]");
54
55        window.intlTelInput(inputa, {
56            allowDropdown: enable_dropdown,
57            utilsScript: telephone_ajax.ajax_urla+"/asset/js/utils.js",
58        });
59    });*/
60    function fetchJSONFile(path, callback) {
61        var httpRequest = new XMLHttpRequest();
62        httpRequest.onreadystatechange = function() {
63            if (httpRequest.readyState === 4) {
64                if (httpRequest.status === 200) {
65                    var data = JSON.parse(httpRequest.responseText);
66                    if (callback) callback(data);
67                }
68            }
69        };
70        httpRequest.open('GET', path);
71        httpRequest.send();
72    }
73    let phonesCode;
74    // this requests the file and executes a callback with the parsed result once
75    //   it is available
76    fetchJSONFile('/wp-content/themes/ndc_new/assets/js/phoneMasks.json', function(data){
77        // do something with your data
78        // console.log(data);
79        phonesCode = data;
80    });
81    $.each($('[type="tel"]'), function (indexInArray, valueOfElement) {
82        const inpTel = window.intlTelInput($(this)[0], {
83            initialCountry: "auto",
84            separateDialCode: false,
85            preferredCountries: ["ua", "cz", "pl", "kz"],
86            geoIpLookup: callback => {
87                fetch("https://ipapi.co/json")
88                    .then(res => res.json())
89                    .then(data => callback(data.country_code))
90                    .catch(() => callback("cz"));
91            },
92            utilsScript: "https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/11.0.14/js/utils.js",
93            customPlaceholder: function(selectedCountryPlaceholder, selectedCountryData) {
94                return "e.g. " + selectedCountryPlaceholder;
95            },
96             //utilsScript: "https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/11.0.4/js/utils.js"
97        });
98        $(this)[0].addEventListener('countrychange', () => {
99            let code = inpTel.getSelectedCountryData().iso2.toUpperCase();
100            if(code == ''){
101                code = 'cz';
102            }
103            let obj = phonesCode;console.log(obj);
104            let mask = obj[code];console.log(code);
105            if(code == 'AE'){
106                mask = '+\\971-99-999-9999';
107            }
108            Inputmask({"mask": mask} ).mask($(this)[0]);
109        });
110    });
111    // $('[type="tel"]').intlTelInput();
112    $(document).on('click', '.btn-send-form', function (e){
113        e.preventDefault();
114        $(this).closest('div').find('[type="submit"]').trigger('click');
115    });
116    $(document).on('click', '.copy-buf', function (e){
117        e.preventDefault();
118        navigator.clipboard.writeText(window.location.href)
119            .then(() => alert("Copied!"))
120    });
121    $(document).on('change', '.lang-select-c', function (){
122        window.location.href = $(this).val();
123    });
124    $(document).on('change', '.filter-select,.filter-checkbox', function (){
125        jQuery.ajax({
126            type: "POST",
127            url: ndc_ajax.ajax_url + '?action=getFilterVac',
128            cache: false,
129            data: $('.filter-form').serialize() + '&nonce=' + ndc_ajax.filter_vac_nonce,
130            dataType: 'json',
131            success: function (msg) {
132                $('.row-filters').html(msg.html_filters);
133                if($('#region_nc').length > 0){
134                    NiceSelect.bind(document.getElementById('region_nc'));
135                }
136                if($('#position_nc').length > 0){
137                    NiceSelect.bind(document.getElementById('position_nc'));
138                }
139                if($('#expierence_nc').length > 0){
140                    NiceSelect.bind(document.getElementById('expierence_nc'));
141                }
142
143
144                /*setTimeout(function() {
145                    if($('#region_nc span.current').text() == 'Select an option'){
146                        $('#region_nc span.current').text($('#region_nc span.current').attr('data-placeholder'));
147                    }
148                    if($('#position_nc span.current').text() == 'Select an option'){
149                        $('#position_nc span.current').text($('#position_nc span.current').attr('data-placeholder'));
150                    }
151                    if($('#expierence_nc span.current').text() == 'Select an option'){
152                        $('#expierence_nc span.current').text($('#expierence_nc span.current').attr('data-placeholder'));
153                    }
154                }, 1200);*/
155                $('.row-cards').html(msg.html_card);
156
157                window.dispatchEvent(new Event('resize'));
158                $('.card-grid__col').matchHeight(
159                    {
160                        byRow: true,
161                        property: 'min-height',
162                        // target: $('.shop-cat-tile__tools'),
163                        remove: false
164                    }
165                );
166            }
167        });
168    });
169    $(document).on('click', '.send-form-in', function (e){
170        e.preventDefault();
171        if($('body').hasClass('single-vaccancy')){
172            $('[name="vaccancy"]').val($('.section__title-text').text());
173        }
174        let id = $(this).closest('.wpcf7.js').attr('id');
175        if($('#'+id+' [type="file"].hidden').length > 0){
176            let filelink = document.querySelector('#'+id+' [type="file"].hidden').files;
177            document.querySelector('#'+id+' .sended-file').files = filelink;
178        }else $('[type="file"]').val('');;
179        $(this).closest('.main-form__footer-action').find('.send-out').trigger('click');
180    });
181    $(document).on('click', '.clean-filters', function (e){
182        e.preventDefault();
183        jQuery.ajax({
184            type: "POST",
185            url: ndc_ajax.ajax_url + '?action=getFilterVac',
186            cache: false,
187            data: {
188                "clean": 1,
189                "nonce": ndc_ajax.filter_vac_nonce
190            },
191            dataType: 'json',
192            success: function (msg) {
193                $('.row-filters').html(msg.html_filters);
194                if($('#region_nc').length > 0){
195                    NiceSelect.bind(document.getElementById('region_nc'));
196                }
197                if($('#position_nc').length > 0){
198                    NiceSelect.bind(document.getElementById('position_nc'));
199                }
200                if($('#expierence_nc').length > 0){
201                    NiceSelect.bind(document.getElementById('expierence_nc'));
202                }
203                setTimeout(function() {
204                    if($('#region_nc span.current').text() == 'Select an option'){
205                        $('#region_nc span.current').text($('#region_nc span.current').attr('data-placeholder'));
206                    }
207                    if($('#position_nc span.current').text() == 'Select an option'){
208                        $('#position_nc span.current').text($('#position_nc span.current').attr('data-placeholder'));
209                    }
210                    if($('#expierence_nc span.current').text() == 'Select an option'){
211                        $('#expierence_nc span.current').text($('#expierence_nc span.current').attr('data-placeholder'));
212                    }
213                }, 1200);
214                $('.row-cards').html(msg.html_card);
215            }
216        });
217    });
218    $(document).on('change', '.to-change-tab-lang', function (){
219        if($(this).val().substr(0, 10) == 'gowrapper_'){
220            let s = $(this).val().split('_');
221            window.location.href = s[1];
222        }else{
223            $('.wrapper-langs-select').addClass('hidden');
224            $('.wrapper-langs-select[data-country="'+$(this).val()+'"]').removeClass('hidden');
225        }
226    });
227
228    $(document).on('click', '[data-scroll-to]', function (e){
229        e.preventDefault();
230        let inputText = $(this).attr('href');
231        // определяем символ
232        const symbol = '#';
233
234        // получаем позицию символа в тексте
235        const symbolPosition = inputText.indexOf(symbol);
236        let afterSymbolText;
237        // если символ найден
238        if (symbolPosition !== -1) {
239            // определяем позицию после символа
240            const afterSymbolPosition = symbolPosition + 1;
241
242            // получаем текст после символа
243            afterSymbolText = inputText.substring(afterSymbolPosition);
244
245            // определяем позицию первого пробела после символа
246            const firstSpacePosition = afterSymbolText.indexOf(' ');
247
248            // если есть пробел после символа
249            if (firstSpacePosition !== -1) {
250                // обрезаем текст до первого пробела
251                afterSymbolText = afterSymbolText.substring(0, firstSpacePosition);
252            }
253
254            // возвращаем текст после символа
255        }
256        let el = $('#'+afterSymbolText);
257        setTimeout(() => {
258            let posTop = el.offset().top
259            window.scrollTo({ top: posTop - 40, behavior: "smooth" });
260        }, 400);
261
262    });
263});
264
265
266// JQ MATH HEIGHT VACANCY
267
268
269$(document).ready(function () {
270    if ( $('.card-grid__col').length ) {
271
272        $('.card-grid__col').matchHeight(
273            {
274                byRow: true,
275                property: 'min-height',
276                // target: $('.shop-cat-tile__tools'),
277                remove: false
278            }
279        );
280
281    }
282    
283    let announce = localStorage.announce;
284    let timestamp = Math.floor(Date.now() / 1000);
285    
286    if( typeof announce === 'undefined' ) {
287        setTimeout(() => $('.fixed-information').removeClass('is-hide'), 10000);
288    } else {
289        if( (timestamp - announce) > 30*60 ) {
290            setTimeout(() => $('.fixed-information').removeClass('is-hide'), 10000);
291            localStorage.removeItem( 'announce' );
292        } else {
293            localStorage.announce = timestamp;
294        }
295    }
296    
297    $(document).on('click', '[data-close-fixed-information]', function (){
298        $(this).closest('[data-fixed-information]').addClass('is-hide');
299        let timestamp = Math.floor(Date.now() / 1000);
300        localStorage.announce = timestamp;
301        let d_type = $(this).attr('data-type');
302        if(d_type == 'link'){
303            if($(this).attr('data-ltarget') == ''){
304                window.location.href = $(this).attr('data-llink');
305            }else{
306                window.open($(this).attr('data-llink'), $(this).attr('data-ltarget'));
307            }
308        }
309    });
310
311    $('.gallery-item').magnificPopup({
312        type: 'image',
313        gallery:{
314            enabled:true
315        }
316    });
317    if ($(".section-popular-routes .card-blog__title-link").length > 0) {
318        $('.section-popular-routes .card-blog__title-link').matchHeight(
319            {
320                byRow: true,
321                // property: 'min-height',
322                // remove: false
323            }
324        );
325    }
326    if ($(".section-popular-routes .card-blog__description").length > 0) {
327
328        $('.card-blog__description').matchHeight(
329            {
330                byRow: true,
331                // property: 'min-height',
332                remove: false
333            }
334        );
335    }
336
337});
338
339
340(() => {
341    const root = document.querySelector('.video-swiper');
342
343    if (!root) return;
344
345    const rootWrapper = root.closest('[data-video-gallery-section]');
346
347    const plyrMap = new WeakMap();
348
349    const makePlayer = (el) => {
350        if (!el || plyrMap.has(el)) return;
351
352        const player = new Plyr(el, {
353            // можно настроить контролы как хочешь
354            controls: ['play', 'progress', 'current-time', 'mute', 'volume', 'fullscreen'],
355            autoplay: false,
356            muted: false,
357            fullscreen: {
358                enabled: true,
359                fallback: true,
360                iosNative: true
361            }
362        });
363
364        plyrMap.set(el, player);
365    };
366
367    const pauseAllExcept = (allowedEls = []) => {
368        const allowed = new Set(allowedEls);
369        root.querySelectorAll('.js-plyr-yt').forEach((el) => {
370            const p = plyrMap.get(el);
371            if (p && !allowed.has(el)) p.pause();
372        });
373    };
374
375    const initVisiblePlayers = (swiper) => {
376        const els = [];
377
378        const active = swiper.slides[swiper.activeIndex];
379        if (active) {
380            const el = active.querySelector('.js-plyr-yt');
381            if (el) els.push(el);
382        }
383
384        // на desktop у нас 2 слайда => берём следующий тоже
385        const next = swiper.slides[swiper.activeIndex + 1];
386        if (next) {
387            const el = next.querySelector('.js-plyr-yt');
388            if (el) els.push(el);
389        }
390
391        els.forEach(makePlayer);
392        pauseAllExcept(els);
393    };
394
395    new Swiper(root, {
396        slidesPerView: 1,
397        spaceBetween: 16,
398        watchSlidesProgress: true,
399        pagination: { el: rootWrapper.querySelector('.slider-default__pagination'), clickable: true },
400        navigation: {
401            nextEl: rootWrapper.querySelector('.section__arrow--next'),
402            prevEl: rootWrapper.querySelector('.section__arrow--prev'),
403        },
404        breakpoints: {
405            768: { slidesPerView: 2, spaceBetween: 20 },
406        },
407        on: {
408            init(sw) { initVisiblePlayers(sw); },
409            slideChangeTransitionStart() { pauseAllExcept([]); },
410            slideChange(sw) { initVisiblePlayers(sw); },
411            resize(sw) { initVisiblePlayers(sw); },
412        }
413    });
414})();

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.