PageSourceSearch

https://www.octo.md/theme/default.js?v=41748418142-102731339-4.317

js octo.md collected 2026-10-04 03:50:28 UTC 6,861 bytes, 211 lines download raw bytes

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.