1// TECHNIQ ====== 2$(document).ready(function () { 3 4 if ($('.main-header .FH').length){ 5 // BASE MENU 6 $('ul.base-menu').show(); 7 }; 8 9 // LEVEL DEPTH FOR MOBILE 10 if($(window).width() < 1090) { 11 var fullMenu = ''; 12 $('ul.base-menu li.ifDrop').each(function(){ 13 fullMenu = fullMenu + '<li class="hidden-desk">'+$(this).html()+'</li>'; 14 }); 15 $('ul.base-menu li.all-product-button').remove(); 16 $('.nav-menu.base-menu').prepend(fullMenu); 17 } 18 19 // FIXED HEADER 20 function fixNav(){ 21 if (!$('.cart-menu').length && !$('.-g-template-black-friday').length){ 22 var nav = $('.main-header'); 23 var pos = nav.height(); 24 var posDelay = nav.height()*2; 25 var prevScroll = 0; 26 27 nav.addClass('fix-nav'); 28 29 $(window).on('scroll', function () { 30 var fix = ($(this).scrollTop() > posDelay) ? true : false; 31 if(fix){ 32 nav.addClass('fade-menu', fix); 33 setTimeout(function() { 34 nav.addClass('animate-menu'); 35 }, 250); 36 $('body').css('margin-top', pos); 37 if($(this).scrollTop() > prevScroll){ 38 nav.removeClass('active-menu'); 39 }else{ 40 nav.addClass('active-menu'); 41 } 42 }else{ 43 $('body').css('margin-top', 0); 44 nav.removeClass('fade-menu active-menu animate-menu', fix); 45 } 46 prevScroll = $(this).scrollTop(); 47 }); 48 } 49 } 50 $.Gomag.bind('Widget/Add/After', function(){ 51 fixNav(); 52 53 // BF SIDEBAR + MENU STICKY 54 if($('.-g-template-black-friday').length){ 55 $('.main-header').css({'top' : '-' + ($('.discount-tape').height() + $('.top-head-bg').height()) + 'px'}); 56 } 57 if($( window ).width() > 991 && $('.-g-template-black-friday').length){ 58 $('.landing-h .side-menu.fixed').css({'top' : $('#navigation').outerHeight() + 20 + 'px'}); 59 } 60 }) 61 62 // ITC MENU ========== 63 function buildMenu(){ 64 $('.main-header .__ignoreSubmenu').each(function() { 65 var $this = $(this); 66 if ($this.find('li').length > 20){ 67 $this.addClass('col3'); 68 }else if ($this.find('li').length >= 11){ 69 $this.addClass('col2'); 70 }else if ($this.find('li').length < 10){ 71 $this.addClass('col1'); 72 }else{} 73 }); 74 }; 75 buildMenu(); 76 77 $('.main-header .menu-drop').on('mouseenter', function() { 78 $(this).find('.menu-dd').addClass('visible'); 79 80 if ( $('.slide-item-menu').length ) { 81 $('.slide-item-menu').owlCarousel({items:1,navigation:!0,pagination:!1}); 82 var owl = $('.slide-item-menu'); // get owl element 83 var owlInstance = owl.data('owlCarousel'); // get owl instance from element 84 if(owlInstance != null) // if instance is existing 85 owlInstance.reinit(); 86 $.Gomag.eqProductRow(); 87 }; 88 }).on('mouseleave', function() { 89 $(this).find('.menu-dd').removeClass('visible'); 90 }); 91 92 $('.main-header ul.nav-menu li.ifDrop').has('ul.drop-list').addClass('drop-parent'); 93 94 $('.main-header .drop-parent').on('mouseenter', function() { 95 $(this).find('.drop-list').addClass('visible'); 96 $(this).find('.drop-list').show(); 97 var itemNumber = $(this).find('.col').length, 98 itemWidth = $(this).find('.col').outerWidth(), 99 elemCount = $(this).find('.drop-list li a').length, 100 imgCount = $(this).find('.drop-list .image').length; 101 102 if(elemCount < 10 && imgCount == 0){ 103 $('.menu-dd').css({"padding-right" : "0px", "width" : /*itemWidth + 258 + */"500px"}); 104 } 105 else{ 106 $('.menu-dd').css({"padding-right" : "0px", "width" : itemNumber * itemWidth + 258 + "px"}); 107 } 108 }).on('mouseleave', function() { 109 $(this).find('.drop-list').removeClass('visible'); 110 $(this).find('.drop-list').hide(); 111 $('.menu-dd').css({"width" : 255 + "px"}); 112 }); 113 114 if($(window).width() > 1090 && $('#main-bnn img').length && $('#main-bnn').outerHeight() > 250){ 115 $('.main-header .menu-dd ul.FH').css('max-height', ($('#main-bnn').outerHeight() - 20) + 'px').css('height', ($('#main-bnn').outerHeight() - 20) + 'px'); 116 $('.main-header .menu-dd').css('min-height','unset!important'); 117 } 118 119}); 120 121try { 122/** 123 * Scrie aici codul tau Javascript... 124 */ 125 126$(document).ready(function() { 127 // âââ RedirecÈionare /ru/ru/... â /ru/... âââ 128 (function(){ 129 var p = window.location.pathname; 130 var prefix = '/ru/ru/'; 131 if (p.startsWith(prefix)) { 132 var rest = p.substring(prefix.length); 133 var target = window.location.origin + '/ru/' + rest; 134 window.location.replace(target); 135 return; 136 } 137 })(); 138 // âââ PânÄ aici âââ 139 140 141 // Restul codului tÄu de validare telefon: 142 143 var errorPhone2 = $('.errorPhone2'); 144 145 // FuncÈia pentru afiÈarea mesajului de eroare 146 function showErrorMessage(message) { 147 errorPhone2.text(message); 148 errorPhone2.css("display", "block"); 149 errorPhone2.css("color", "red"); 150 console.log("EROARE:", message); 151 } 152 153 // FuncÈia pentru ascunderea mesajului de eroare 154 function clearErrorMessage() { 155 errorPhone2.text(''); 156 errorPhone2.css("display", "none"); 157 console.log("Eroarea a fost eliminatÄ"); 158 } 159 160 const phoneInput = document.querySelector("input[name='phone']"); 161 162 // FuncÈia pentru validarea Èi corectarea numÄrului de telefon 163 function validatePhoneNumber(elem) { 164 let phoneValue = elem.value.trim(); 165 const prefix = "+373"; 166 167 // AdaugÄ prefixul dacÄ lipseÈte 168 if (!phoneValue.startsWith(prefix)) {
169 phoneValue = prefix + phoneValue; 170 } 171 172 // EliminÄ zero-ul de dupÄ prefix dacÄ existÄ 173 const prefixWithZero = prefix + "0"; 174 if (phoneValue.startsWith(prefixWithZero)) { 175 phoneValue = prefix + phoneValue.substring(prefixWithZero.length); 176 } 177 178 // ActualizeazÄ valoarea câmpului cu numÄrul corectat 179 elem.value = phoneValue; 180 181 // Extrage doar cifrele pentru validare 182 const digitsOnly = phoneValue.replace(/D/g, ''); 183 184 const expectedLength = 11; // 3 cifre pentru 373 Èi 8 pentru restul numÄrului 185 console.log("NumÄr de cifre total (doar cifre):", digitsOnly.length); 186 187 if (digitsOnly.length < expectedLength) { 188 showErrorMessage("NumÄrul de telefon trebuie sÄ conÈinÄ exact 8 cifre dupÄ prefixul +373 (11 cifre în total)."); 189 } else if (digitsOnly.length > expectedLength) { 190 showErrorMessage("NumÄrul de telefon are prea multe cifre dupÄ prefixul +373."); 191 } else { 192 clearErrorMessage(); // NumÄrul este corect 193 } 194 } 195 196 if (phoneInput) { 197 phoneInput.addEventListener("input", function() { 198 validatePhoneNumber(phoneInput); 199 }); 200 201 phoneInput.addEventListener("change", function() { 202 validatePhoneNumber(phoneInput); 203 }); 204 205 phoneInput.addEventListener("blur", function() { 206 validatePhoneNumber(phoneInput); 207 }); 208 } 209}); 210} catch (e) { console.log(e); } 211
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.