PageSourceSearch

https://www.operaprint.com/inc/js/template.js?t=1791330875

js operaprint.com collected 2026-10-06 23:54:42 UTC 7,772 bytes, 270 lines download raw bytes

1$(document).ready(function() {
2
3	$('.mainNav li.anchor').click(function() {
4		var cnr = $(this).data('index'),
5			$bloc = $('[data-c="'+cnr+'"]');
6			
7		if ($bloc.length>0)
8			{
9			 $('html, body').animate({scrollTop: $bloc.offset().top - $('.mainNav').height()}, 'slow');
10			}
11	});
12
13	$('.scrollDown').on('click', function(){
14		$('html, body').animate({scrollTop: $('body > header').height()}, 'slow');
15	});
16	
17	$(".openConnect").on('click', function() {
18		var $modal = $(".connect-popin");
19		if (!$modal.length)
20			{
21			 _.getHtmlBloc('/inc/modal/connect.php', function(res) {
22			 	$('body').append(res);
23			 	$(".connect-popin").show().addClass('on');
24			 });
25			}
26			else $(".connect-popin").show().addClass('on');
27	});
28	
29	$(document).on('click', '.siteLogIn', function() {
30		var $form = $(this).closest('form'),
31			datas = $form.serialize(),
32			url = '/inc/ajax/compte.php';
33		datas+= '&act=logIn';
34		$.ajax({
35			type: 'POST',
36			url: url,
37			data: datas,
38			dataType: 'json',
39			cache:false,
40			timeout:10000,
41			success: function (res) {
42				if (res.error)
43					{
44					 $(".message div", $form).html("<ul class='error'></ul>");
45					 $.each(res.error, function(k,v) {
46					 	$(".message div ul", $form).append('<li>'+v.msg+'</li>');
47					 });
48					}
49					else
50					{
51					 $(".message", $form).addClass('ok');
52					 $(".message div", $form).html("Votre authentification a réussi");
53					 document.location.href = document.location.href;
54					}
55			}
56		});
57		
58	});
59	
60	$(document).on('click', ".close", function() {
61		$(this).closest(".modal").removeClass('on').hide();
62	});
63	
64	$(document).on('click', ".forgetPwd", function() {
65		var forget = $(".forgetPass").slideDown()
66		$("input[name='email_forget']", forget).val($(".connect-popin input[name='contactLogin']").val());
67		$("form", forget).show();
68		$(".message", forget).hide();
69	});
70	
71	$(document).on('click', ".sendPwd", function() {
72		var forget = $(this).closest('.forgetPass'),
73			url = '/inc/ajax/compte.php',
74			params = 'act=sendPwd&email='+encodeURIComponent($("input[name='email_forget']", forget).val());
75		$.ajax({
76			type: 'GET',
77			url: url,
78			data: params,
79			dataType: 'json',
80			cache:false,
81			timeout:10000,
82			success: function (res) {
83				$(".message", forget).show();
84				
85				if (res.error)
86					{
87					 $(".message div", forget).html("<ul class='errors'></ul>");
88					 $.each(res.error, function(k,v) {
89					 	$(".message div ul", forget).append('<li>'+v.msg+'</li>');
90					 });
91					}
92					else
93					{
94					 $("form", forget).hide();
95					 $(".message div", forget).html("Votre mot de passe vient de vous être envoyé");
96					}
97			}
98		});
99		
100	});
101	
102	$(document).on('click', '.addAddress,.editAddress', function() {
103		
104		var wh = $(window).height();
105		var addCt = $.modalPanel({code:'editAddress', urlsite:'inc/modal/editAddress.php', sync:true});
106		var o = $(this).data('o');
107		var addressnr = $(this).data('anr');
108		var type = $(this).data('type');
109		var act = $(this).hasClass('addAddress')? 'add' : 'edit';
110
111		$(addCt.modal).addClass('on');
112
113		$('iframe', addCt.modal).attr('src', '/order/form-address.php?type='+type+'&act='+act+'&addressnr='+addressnr+'&o='+o);
114
115	});
116
117	$(document).on('click', '.openAddressChoice', function() {
118		
119		var wh = $(window).height();
120		var type = $(this).data('type');
121		var addCt = $.modalPanel({code:'openAddressChoice', urlsite:'inc/modal/chooseAddress.php?type='+type, sync:true});
122
123		$(addCt.modal).addClass('on');
124
125	});
126
127	$(document).on('click', '.validAddressChoice', function() {
128		var $modal = $(this).closest('.modal'),
129			type = $('[name="type"]', $modal).val(),
130			addressnr = parseInt($('[name="addressnr"]:checked', $modal).val());
131		actionCall("chooseAddress", {type:type, addressnr:addressnr}, "/basket.php", function(res) {
132			if (res.status=='ok')
133				{
134			 	 $modal.hide().removeClass('on');
135			 	 window.parent.location.href = window.parent.location.href;
136				}
137		});
138
139	});
140	
141	// Tabs: show related content (CETTE VERSION PERMET D'AVOIR DES TABS DANS DES TABS)
142	$('.gabarit.tabs > .tabs-block li:first-child').addClass('active');
143	$('.tabs-block input').each((i, item) => {
144		$(item).change(function() {
145			let dataTabs = $(this).val();
146			let dataBlock = $(this).attr('data-block');
147			
148			$('.tabs-block[data-block="'+dataBlock+'"] > li').removeClass('active');
149			$(this).parent().addClass('active');
150
151			$('.tabs-content[data-block="'+dataBlock+'"] > article').removeClass('active');
152			$('.tabs-content[data-block="'+dataBlock+'"] > article[data-tabs="'+dataTabs+'"]').addClass('active');
153		});
154	});
155	
156	$(".menuSmart").click(function() {
157		if (!$(this).hasClass('active'))
158			{
159			 $("nav .menu").slideDown('fast');
160			 $(this).addClass('active');
161			}
162			else
163			{
164			 $("nav .menu").slideUp('fast');
165			 $(this).removeClass('active');
166			}
167			
168	});
169	
170	$('.bloc-collapse > ul > li > label').on('click', function() {
171		var $ul = $(this).closest('ul');
172		var $li = $(this).closest('li');		
173		if (!$li.hasClass('on'))
174			{
175			 $('>article', $li).slideDown();
176			 $li.addClass('on');
177			}
178			else
179			{
180			 $li.removeClass('on');
181			 $('> article', $li).slideUp();
182			}
183	});
184
185	$(".payModes label").click(function() {
186		$(".payModes li").removeClass('select');
187		$(this).closest('li').addClass('select');
188	});
189
190	$(window).load(function() {
191		var $mainNav = $("nav.mainNav");
192		var $overHead = $(".overHead");
193		if ($mainNav.length)
194			{
195			 var navHeight = $mainNav.outerHeight(true),
196				 navOffset = $mainNav.offset();
197				 
198			 if ($('body').height()>$(window).height()+100)
199		 		{
200				 $(window).scroll(function() {
201					var scroll = $(window).scrollTop();
202					if (scroll>navOffset.top && !this.menuSmall)
203						{
204						 this.menuSmall = true;
205						 $mainNav.addClass('scroll');
206						 $overHead.addClass('scroll');
207						}
208						else if ((scroll<=navOffset.top || scroll==0) && this.menuSmall )
209						{
210						 this.menuSmall = false;
211						 $mainNav.removeClass('scroll');
212						 $overHead.removeClass('scroll');
213						}
214				 });
215				}
216			}
217	});
218	
219		
220	var isIE11 = !!window.MSInputMethodContext && !!document.documentMode;
221	var isIE = /*@cc_on!@*/false || !!document.documentMode;
222	var read = "no";
223	read = getCookie("read");
224	
225	if(isIE && !isIE11)
226		{//SI IE EST DETECTE
227         //AFFICHAGE SUR LA PAGE
228         $('nav').after('<div style="text-align : center; margin : 5px; border: 1px solid red;">Vous utilisez Internet Explorer, ce navigateur est obsolète et ne permet pas de profiter pleinement de ce site.<div>');
229         $('body').after('<div style="text-align : center; margin : 5px; border: 1px solid red;">Vous utilisez Internet Explorer, ce navigateur est obsolète et ne permet pas de profiter pleinement de ce site.<div>');
230    	 if(read != "oui")
231    	 	{
232    		 // SI C'EST UNE VIEILLE VERSION
233    		 if(!document.addEventListener)
234    		 	{
235    			 //ALERT ET COOKIE
236				 alert('Vous utilsez Internet Explorer 8 ou version antérieure.\nCe navigateur est antique et obsolète... !\nNous vous conseillons de mettre à jour votre navigateur ou d\'utiliser FireFox ou Chrome.');
237				 var today = new Date();
238 				 var expire = new Date();
239 				 expire.setTime(today.getTime() + 3600000*1);
240        		 document.cookie = "read = oui; expires="+expire.toGMTString()
241    			}
242			}
243		}
244});
245
246function getCookie(name) {
247  	return (name = (document.cookie + ';').match(new RegExp(name + '=.*;'))) && name[0].split(/=|;/)[1];
248}
249
250
251function actionCall(act, param, urlPoint, success, btn)
252{
253 var data = "act="+act+"&"+param,
254	 url = "/inc/ajax"+urlPoint;
255 
256 if (btn) $(btn).prepend('<i class="fa fa-spin fa-spinner"></i>&nbsp;');
257 
258 $.ajax({
259	type: 'GET',
260	url: url,
261	data: data,
262	dataType: 'json',
263	cache:false,
264	timeout:10000,
265	success: function(res) {
266		if (btn) $('.fa-spin', btn).remove();
267		success(res);
268	}
269 });	 
270}

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.