PageSourceSearch

https://www.image.bzh/wp-content/themes/core-v6.3.installable/core/js/custom.js?ver=1791596627

js image.bzh collected 2026-10-10 01:44:37 UTC 9,507 bytes, 487 lines download raw bytes

1var $j = jQuery.noConflict();
2
3function isiPad(){
4    return (navigator.platform.indexOf("iPad") != -1);
5}
6
7/* jquery.imagefit 
8 *
9 * Version 0.2 by Oliver Boermans <http://www.ollicle.com/eg/jquery/imagefit/>
10 *
11 * Extends jQuery <http://jquery.com>
12 *
13 */
14(function($) {
15	$.fn.imagefit = function(options) {
16		var fit = {
17			all : function(imgs){
18				imgs.each(function(){
19					fit.one(this);
20					})
21				},
22			one : function(img){
23				$(img)
24					.width('100%').each(function()
25					{
26						$(this).height(Math.round(
27							$(this).attr('startheight')*($(this).width()/$(this).attr('startwidth')))
28						);
29					})
30				}
31		};
32		
33		this.each(function(){
34				var container = this;
35				
36				// store list of contained images (excluding those in tables)
37				var imgs = $('img', container).not($("table img"));
38				
39				// store initial dimensions on each image 
40				imgs.each(function(){
41					$(this).attr('startwidth', $(this).width())
42						.attr('startheight', $(this).height())
43						.css('max-width', $(this).attr('startwidth')+"px");
44				
45					fit.one(this);
46				});
47				// Re-adjust when window width is changed
48				$(window).bind('resize', function(){
49					fit.all(imgs);
50				});
51			});
52		return this;
53	};
54})(jQuery);
55
56
57$j.fn.getIndex = function(){
58	var $jp=$j(this).parent().children();
59    return $jp.index(this);
60}
61 
62jQuery.fn.extend({
63  slideRight: function() {
64    return this.each(function() {
65    	jQuery(this).show();
66    });
67  },
68  slideLeft: function() {
69    return this.each(function() {
70    	jQuery(this).hide();
71    });
72  },
73  slideToggleWidth: function() {
74    return this.each(function() {
75      var el = jQuery(this);
76      if (el.css('display') == 'none') {
77        el.slideRight();
78      } else {
79        el.slideLeft();
80      }
81    });
82  }
83});
84
85$j.fn.setNav = function(){
86	$j('#main_menu li ul').css({display: 'none'});
87
88	$j('#main_menu li').each(function()
89	{	
90		var $jsublist = $j(this).find('ul:first');
91		
92		$j(this).hover(function()
93		{	
94			$jsublist.css({opacity: 1});
95			
96			$jsublist.stop().css({overflow:'hidden', height:'auto', display:'none'}).fadeIn(200, function()
97			{
98				$j(this).css({overflow:'visible', height:'auto', display: 'block'});
99			});	
100		},
101		function()
102		{	
103			$jsublist.stop().css({overflow:'hidden', height:'auto', display:'none'}).fadeOut(200, function()
104			{
105				$j(this).css({overflow:'hidden', display:'none'});
106			});	
107		});	
108		
109	});
110	
111	$j('#main_menu li').each(function()
112	{
113		
114		$j(this).hover(function()
115		{	
116			$j(this).find('a:first').addClass('hover');
117		},
118		function()
119		{	
120			$j(this).find('a:first').removeClass('hover');
121		});	
122		
123	});
124	
125	$j('#menu_wrapper .nav ul li ul').css({display: 'none'});
126
127	$j('#menu_wrapper .nav ul li').each(function()
128	{	
129		
130		var $jsublist = $j(this).find('ul:first');
131		
132		$j(this).hover(function()
133		{	
134			$jsublist.css({opacity: 1});
135			
136			$jsublist.stop().css({overflow:'hidden', height:'auto', display:'none'}).fadeIn(200, function()
137			{
138				$j(this).css({overflow:'visible', height:'auto', display: 'block'});
139			});	
140		},
141		function()
142		{	
143			$jsublist.stop().css({overflow:'hidden', height:'auto', display:'none'}).fadeOut(200, function()
144			{
145				$j(this).css({overflow:'hidden', display:'none'});
146			});	
147		});	
148		
149	});
150	
151	$j('#menu_wrapper .nav ul li').each(function()
152	{
153		
154		$j(this).hover(function()
155		{	
156			$j(this).find('a:first').addClass('hover');
157		},
158		function()
159		{	
160			$j(this).find('a:first').removeClass('hover');
161		});	
162		
163	});
164}
165
166$j(document).ready(function(){ 
167
168	$j(document).setNav();
169
170	$j('.pp_gallery a').fancybox({
171		padding : 0, 
172		prevEffect	: 'fade',
173		nextEffect	: 'fade',
174		helpers	: {
175			title	: {
176				type: 'float'
177			},
178			overlay	: {
179				opacity : 1,
180				css : {
181					'background-color' : '#'+$j('#skin_color').val()
182				}
183			},
184			thumbs	: {
185				width	: 80,
186				height	: 80
187			}
188		}
189	});
190	
191	$j('.flickr li a').fancybox({
192		padding : 0, 
193		prevEffect	: 'fade',
194		nextEffect	: 'fade',
195		helpers	: {
196			title	: {
197				type: 'float'
198			},
199			overlay	: {
200				opacity : 1,
201				css : {
202					'background-color' : '#'+$j('#skin_color').val()
203				}
204			},
205			thumbs	: {
206				width	: 80,
207				height	: 80
208			}
209		}
210	});
211	
212	$j('a[rel=gallery]').fancybox({
213		padding : 0, 
214		prevEffect	: 'fade',
215		nextEffect	: 'fade',
216		helpers	: {
217			title	: {
218				type: 'float'
219			},
220			overlay	: {
221				opacity : 1,
222				css : {
223					'background-color' : '#'+$j('#skin_color').val()
224				}
225			},
226			thumbs	: {
227				width	: 80,
228				height	: 80
229			}
230		}
231	});
232	
233	$j('.img_frame').fancybox({
234		padding : 0, 
235		prevEffect	: 'fade',
236		nextEffect	: 'fade',
237		helpers	: {
238			title	: {
239				type: 'float'
240			},
241			overlay	: {
242				opacity : 1,
243				css : {
244					'background-color' : '#'+$j('#skin_color').val()
245				}
246			},
247			thumbs	: {
248				width	: 80,
249				height	: 80
250			}
251		}
252	});
253	
254	$j('.lightbox').fancybox({
255		padding : 0, 
256		prevEffect	: 'fade',
257		nextEffect	: 'fade',
258		helpers	: {
259			title	: {
260				type: 'float'
261			},
262			overlay	: {
263				opacity : 1,
264				css : {
265					'background-color' : '#'+$j('#skin_color').val()
266				}
267			},
268			thumbs	: {
269				width	: 80,
270				height	: 80
271			}
272		}
273	});
274	
275	$j('.lightbox_youtube').fancybox({
276		padding : 0, 
277		prevEffect	: 'fade',
278		nextEffect	: 'fade',
279		helpers	: {
280			title	: {
281				type: 'float'
282			},
283			overlay	: {
284				opacity : 1,
285				css : {
286					'background-color' : '#'+$j('#skin_color').val()
287				}
288			},
289			thumbs	: {
290				width	: 80,
291				height	: 80
292			}
293		}
294	});
295	
296	$j('.lightbox_vimeo').fancybox({
297		padding : 0, 
298		prevEffect	: 'fade',
299		nextEffect	: 'fade',
300		helpers	: {
301			title	: {
302				type: 'float'
303			},
304			overlay	: {
305				opacity : 1,
306				css : {
307					'background-color' : '#'+$j('#skin_color').val()
308				}
309			},
310			thumbs	: {
311				width	: 80,
312				height	: 80
313			}
314		}
315	});
316	
317	$j('.lightbox_iframe').fancybox({
318		padding : 0, 
319		prevEffect	: 'fade',
320		nextEffect	: 'fade',
321		helpers	: {
322			title	: {
323				type: 'float'
324			},
325			overlay	: {
326				opacity : 1,
327				css : {
328					'background-color' : '#'+$j('#skin_color').val()
329				}
330			},
331			thumbs	: {
332				width	: 80,
333				height	: 80
334			}
335		}
336	});
337	
338	$j('#content_slider_wrapper').fadeOut();
339	$j('#move_next').fadeOut();
340	$j('#move_prev').fadeOut();
341	
342	VideoJS.setupAllWhenReady({
343      controlsBelow: false, // Display control bar below video instead of in front of
344      controlsHiding: true, // Hide controls when mouse is not over the video
345      defaultVolume: 0.85, // Will be overridden by user's last volume if available
346      flashVersion: 9, // Required flash version for fallback
347      linksHiding: true // Hide download links when video is supported
348    });
349    
350    $j('.img_nofade').hover(function(){  
351			$j(this).animate({opacity: .5}, 300);
352 		}  
353  		, function(){  
354  			$j(this).animate({opacity: 1}, 300);
355  		}  
356
357	);
358	
359	if(BrowserDetect.browser != 'Explorer')
360 	{
361		$j('#slider_wrapper').hover(function(){  
362				$j('.nivo-controlNav').fadeIn();
363 			}  
364  			, function(){  
365  				$j('.nivo-controlNav').fadeOut();
366  			}  
367  			
368		);
369		
370		$j('.nivo_border').hover(function(){  
371				$j('.nivo-controlNav').fadeIn();
372 			}  
373  			, function(){  
374  				$j('.nivo-controlNav').fadeOut();
375  			}  
376  			
377		);
378	}
379	else
380	{
381		$j('#slider_wrapper').hover(function(){  
382				$j('.nivo-controlNav').show();
383 			}  
384  			, function(){  
385  				$j('.nivo-controlNav').hide();
386  			}  
387  			
388		);
389		
390		$j('.nivo_border').hover(function(){  
391				$j('.nivo-controlNav').show();
392 			}  
393  			, function(){  
394  				$j('.nivo-controlNav').hide();
395  			}  
396  			
397		);
398	}
399	
400	$j('input[title!=""]').hint();
401	
402	$j('textarea[title!=""]').hint();
403	
404	// Create the dropdown base
405	$j("<select />").appendTo("#menu_border_wrapper");
406	
407	// Create default option "Go to..."
408	$j("<option />", {
409	   "selected": "selected",
410	   "value"   : "",
411	   "text"    : "- Main Menu -"
412	}).appendTo("#menu_border_wrapper select");
413	
414	// Populate dropdown with menu items
415	$j(".nav li").each(function() {
416	 var current_item = $j(this).hasClass('current-menu-item'); 
417	 var el = $j(this).children('a');
418	 var menu_text = el.text();
419
420	 if($j(this).parent('ul.sub-menu').length > 0)
421	 {
422	 	menu_text = "- "+menu_text;
423	 }
424	 
425	 if($j(this).parent('ul.sub-menu').parent('li').parent('ul.sub-menu').length > 0)
426	 {
427	 	menu_text = el.text();
428	 	menu_text = "- - "+menu_text;
429	 }
430	 
431	 if(current_item)
432	 {
433	 	$j("<option />", {
434	 		 "selected": "selected",
435	    	 "value"   : el.attr("href"),
436	    	 "text"    : menu_text
437		 }).appendTo("#menu_border_wrapper select");
438	 }
439	 else
440	 {
441	 	$j("<option />", {
442	     	"value"   : el.attr("href"),
443	     	"text"    : menu_text
444	 	}).appendTo("#menu_border_wrapper select");
445	 }
446	});
447	
448	$j("#menu_border_wrapper select").change(function() {
449  		window.location = $j(this).find("option:selected").val();
450	});
451	
452	$j.validator.setDefaults({
453		submitHandler: function() { 
454		    var actionUrl = $j('#contact_form_widget').attr('action');
455		    
456		    $j.ajax({
457  		    	type: 'GET',
458  		    	url: actionUrl,
459  		    	data: $j('#contact_form_widget').serialize(),
460  		    	success: function(msg){
461  		    		$j('#contact_form_widget').hide();
462  		    		$j('#reponse_msg').html(msg);
463  		    	}
464		    });
465		    
466		    return false;
467		}
468	});
469		    
470		
471	$j('#contact_form_widget').validate({
472		rules: {
473		    your_name: "required",
474		    email: {
475		    	required: true,
476		    	email: true
477		    },
478		    message: "required"
479		},
480		messages: {
481		    your_name: "Please enter your name",
482		    email: "Please enter a valid email address",
483		    message: "Please enter some message"
484		}
485	});
486	
487});

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.