PageSourceSearch

https://mairy-sur-marne.fr/webacappella_menu.js?v=1lh9

js mairy-sur-marne.fr collected 2026-10-02 23:49:31 UTC 14,385 bytes, 805 lines download raw bytes

1<!--
2
3
4
5waJSQuery(function() {
6	
7
8	var _itemsRoot = waJSQuery(".waDynmenu-root");
9	_itemsRoot.each(function(){
10		
11			waJSQuery(this).css("cursor","pointer")
12	})
13	
14	
15	
16	//
17	var _items = waJSQuery(".waDynmenu-item");
18	_items.each(function(){
19		
20		if (isMSIE())
21		{
22			waJSQuery(this).css("background","url(wa_transparent.gif)")
23		}
24	})
25	
26	
27	_items.hover(function(){
28			var _cl = waJSQuery(this).attr("class");
29			var _arr2;
30			var _arr = splitClassParameters(_cl,'[',']')
31			if (_arr['param']!=undefined)
32			{
33				_arr2 = wa_evaluate("["+_arr['param']+"]");
34				waDynMenuOver(waJSQuery(this),_arr2);
35			}
36			else
37			{
38				waDynMenuOver(waJSQuery(this));
39			}
40			
41			
42		},
43		function(){
44	//alert('out')
45		}
46	)
47	
48	
49	
50});
51
52
53
54function _waDynMenuContenair()
55{
56	return waJSQuery("#dynmenu-container");
57}
58
59function waGetJsonCss(_o,_name)
60{
61	var _s = _waParseJsonCss(_o,_name)
62	_s = _s.replace(/''/g,"\"")
63	return waJSQuery.parseJSON( _s )
64}
65
66function _waParseJsonCss(_o,_name)
67{
68	var _cl = _o.attr("class");
69	if (_cl==undefined) return ""
70//	alert(_cl)
71	var _key = "json['"+_name+"']"
72	
73	var _n = _cl.indexOf(_key)
74	if (_n>-1)
75	{
76		_n = _n + _key.length
77		var _bracketCount = 0;
78		var _started = false;
79		for (var i=_n;i<_cl.length;i++)
80		{
81			var _c = _cl.charAt(i)
82			if (_c == "{")
83			{
84				if (_started==false)
85				{
86					_started = true;
87				}
88				_bracketCount++;
89			}
90			if (_c == "}")
91			{
92				_bracketCount--;
93				
94				if (_started && (_bracketCount==0))
95				{
96					return _cl.substring(_n, i+1)
97				}
98			}
99		}
100	}
101	return "";	
102}
103
104
105function _waDynMenuGetRootItem(_o)
106{
107	var i = 0;
108	var _item = _o
109	var _newitem = null;
110	do
111	{
112		_newitem = null;
113		
114		var _objMenu = _item.parents(".wa-menu-div")
115		
116		
117		if (_objMenu.length==1)
118		{
119			_newitem = _objMenu.data("menu-item-parent")
120		}
121		if ((_newitem!=null)&& (_newitem.length>0))
122		{
123			_item = _newitem;
124		}
125		i++
126	}
127	while ((_newitem!=null)&&(_newitem.length>0))
128	return _item
129}
130
131
132function _waDynMenuConfig(_o)
133{
134	var _menu = _o.parents(".wa-dynmenu")
135	var _config = null
136	if (_menu.length==1)
137	{
138		_config = waGetJsonCss(_menu,"config");
139	}
140
141	if (_config==null)
142	{
143		var _it = _waDynMenuGetRootItem(_o)
144		_menu = _it.parents(".wa-dynmenu")
145		_config = waGetJsonCss(_menu,"config");
146	}
147	return _config;
148	
149}
150
151function waDynMenuOver(_o,_menuStruct)
152{	
153
154	//alert(_o.html())
155	var _cont = _waDynMenuContenair()
156	
157	
158	var _config =  _waDynMenuConfig(_o)
159	var _hasSub = (_menuStruct!=undefined) 
160	
161	if (_hasSub)
162	{
163		var _builded = _o.data("menu-builded")
164		if (_builded != true)
165		{
166
167			_o.data("menu-builded",true)
168			var _indexMenu = _cont.data("index-menu")
169			if (_indexMenu==undefined)
170			{
171				_indexMenu= 0;
172			}
173			else
174			{
175				_indexMenu++;
176			}
177			_cont.data("index-menu",_indexMenu)
178
179			var _rootIndex = "root"
180			_waBuildMenu(_o,_config,_indexMenu,true,_menuStruct)
181			_waActivatedItemWithSubMenu(_o,_config,_indexMenu,null,_menuStruct);	
182		}
183	}
184	else
185	{
186		_waActivatedSingleItem(_o)
187	}
188
189	
190	var _currentObjMenu = _cont.data("current-raised-obj-menu")
191	if (_currentObjMenu!=undefined)
192	{
193		_waMenuHide(_currentObjMenu,true)
194	}
195	var _objMenu = _o.data("obj-menu")
196	_cont.data("current-raised-obj-menu",_objMenu)
197	///
198	_waMenuHover(_o)
199}
200
201function _waMenuGetParentMenu(_o)
202{
203	var _objParent = _o.parents(".wa-menu-div")
204	if (_objParent.length>0)
205	{
206		return _objParent;
207	}
208	var _parentItemMenu = _o.data("menu-item-parent")
209	if (_parentItemMenu!=undefined)
210	{
211		var _objParent = _parentItemMenu.parents(".wa-menu-div")
212		if (_objParent.length>0)
213		{
214			return _objParent;
215		}
216	}
217	return null
218}
219
220function _waMenuTopPositionRoot()
221{
222	return 0-document.webaca_banner_height
223}
224
225function _waMenuHover(_o)
226{
227	var _config = _waDynMenuConfig(_o)
228	var _xDec = 0;
229	if (document.webaca_page_is_centered)
230	{
231		if (waJSQuery(window).width()>document.webaca_width_page)
232		{
233
234			//
235			/*
236			if (isWindowsMobile()==true)
237			{
238				_xDec = Math.max(0,(waJSQuery(window).width()-document.webaca_width_page)/2)
239				
240				var _bgOffsetX = 0;
241				var _lxWin=getDocumentSize().width()
242				var _lxPage=document.webaca_width_page
243				if (_lxWin>_lxPage)_bgOffsetX=(_lxWin-_lxPage)/2;
244				
245				var _bgOffsetX2 = waJSQuery(window).scrollLeft(); 
246				
247				if (_bgOffsetX2 > _bgOffsetX)
248				{
249					_xDec += _bgOffsetX2
250				}
251				
252				
253			}
254			else
255			*/
256			{
257				_xDec = (waJSQuery(window).width()-document.webaca_width_page)/2
258			}
259		}
260	}
261	
262	var _objParent = _o.parents(".wa-menu-div")
263	var _isRoot = (_objParent.length==0)
264	
265	///
266	var _href = _o.find("a")
267	if (_href.length==0)
268	{
269		_href = _o
270	}
271	
272	var _cssInitialized = _o.data("cssInitialized")
273	if (_cssInitialized!=true)
274	{
275		_o.data("cssInitialized",true)
276		var _oldCssHref = {
277			color:_href.css("color"),
278			"text-decoration":_href.css("text-decoration")
279		}
280		var _oldCss = {
281			backgroundColor:_o.css("backgroundColor")	
282		}	
283		// 
284		_o.data("oldCssHref",_oldCssHref)
285		_o.data("oldCss",_oldCss)
286	}
287	
288	
289	//alert(_o.css("color"))
290	
291	//alert(_href.length)
292	if (_isRoot)
293	{
294		_href.css("color",_config.root_col_text_over)
295		_href.css("text-decoration",(_config.root_text_u_over)?"underline":"none")
296		_o.css("backgroundColor",compliantColor(_config.root_col_bg_over))
297
298		if (false)
299		{
300			if (_o.position().left==0)
301			{
302				_o.css({borderLeft:"1px solid "+_config.root_col_border})
303			}
304			_o.css({borderTop:"1px solid "+_config.root_col_border})
305			_o.css({borderBottom:"1px solid "+_config.root_col_border})
306		}
307	}
308	else
309	{
310		_href.css("color",_config.sub_col_text_over)
311		_href.css("text-decoration",(_config.sub_text_u_over)?"underline":"none")
312		_o.css("backgroundColor",compliantColor(_config.sub_col_bg_over))
313	}
314	
315	
316	//alert(_config.sub_col_bg_over)
317	//alert(_config.sub_style_text)
318	
319	//
320	
321	///
322
323	var _objMenu = _o.data("obj-menu")
324
325	_waMenuClearHide(_objParent)
326	_waMenuClearHide(_objMenu)
327
328	//if (_objMenu!=undefined)
329	{
330		
331		if (_objParent.length>0)
332		{
333			var _curSubObjMenu = _objParent.data("current-sub-obj-menu")
334			if (_curSubObjMenu!=null)
335			{
336				_waMenuHide(_curSubObjMenu,true)
337			}
338			
339			//if (_objMenu!=undefined)
340			_objParent.data("current-sub-obj-menu",_objMenu)
341		}
342	}
343
344	if (_objMenu!=undefined)
345	{
346		
347		var _x = 0;
348		var _y = 0;
349		if (_isRoot)
350		{
351			
352			if (_config.vertical)
353			{
354				var _menu = _o.parents(".wa-dynmenu")
355				_x = _o.offset().left + _menu.outerWidth(true) -_xDec;
356				_y = _o.offset().top;
357			}
358			else
359			{
360				_x = _o.offset().left -_xDec;
361				_y = _o.offset().top+_o.height()+3;
362			}
363			
364
365		}
366		else
367		{
368			var _parentMenu = _waMenuGetParentMenu(_o)
369			_x = _parentMenu.offset().left + _parentMenu.outerWidth(true)-_xDec;
370			_y = _o.offset().top;	
371		}
372
373		var _margin = 10;
374		_x = Math.max(_x,waJSQuery(window).scrollLeft())
375		_x = Math.min(_x,waJSQuery(window).scrollLeft()+waJSQuery(window).width()-_objMenu.width()-_margin)
376
377		_y = Math.min(_y,waJSQuery(window).scrollTop()+waJSQuery(window).height()-_objMenu.height()-_margin)
378		_y = Math.max(_y,waJSQuery(window).scrollTop())
379		
380		_y+=_waMenuTopPositionRoot()
381
382		_objMenu.stop(true, true).fadeIn();
383		_objMenu.css({"left":_x,"top":_y})	
384	}
385	
386}
387
388
389function _waMenuHout(_o)
390{
391	//return;
392	var _href = _o.find("a")
393	if (_href.length==0)
394	{
395		_href = _o
396	}
397	var _oldCss = _o.data("oldCss")
398	var _oldCssHref = _o.data("oldCssHref")
399	
400	_href.css(_oldCssHref)
401	_o.css(_oldCss)
402	
403	var _objMenu = _o.data("obj-menu")
404	
405	var _objParent = _o.parents(".wa-menu-div")
406//	console.log("_waMenuHout "+_objMenu.attr("id"))
407	_waMenuWantHide(_objParent)
408	if (_objParent.length==0)
409	{
410		_waMenuWantHide(_objMenu)
411	}
412	
413
414}
415
416
417function _waMenuClearHide(_objMenu)
418{
419
420	if (_objMenu==undefined) return;
421	
422	if (_objMenu.length>0)
423	{
424		var _timer = _objMenu.data("timer-menu-out")
425		clearTimeout(_timer)
426		_objMenu.show();
427	}
428//	alert(_objMenu.html())
429	
430	var _objParent =_waMenuGetParentMenu(_objMenu)
431	_waMenuClearHide(_objParent)
432}
433
434
435function _waMenuHide(_objMenu,_bFast)
436{
437	
438	var _childItemMenu = _objMenu.children(".wa-menu-item-div")
439	_childItemMenu.each(function(){
440		
441		var _objParent= waJSQuery(this).data("obj-menu")
442		if (_objParent!=null)
443		_objParent.stop(true, true).fadeOut();
444	})
445	
446	if (_bFast)
447	{
448		_objMenu.hide();
449	}
450	else
451	{
452		_objMenu.stop(true, true).fadeOut();
453	}
454	
455}
456
457function _waMenuWantHide(_objMenu)
458{
459	
460	if (_objMenu==undefined) return;
461	if (_objMenu.length==0) return;
462	
463
464	
465	var _time = 600;
466	if (_objMenu.length>0)
467	{
468		var _timer = wa_timeout(function()
469		{
470			_waMenuHide(_objMenu)
471			
472		},_time)
473		_objMenu.data("timer-menu-out",_timer)
474	}
475
476///
477	var _objParent =_waMenuGetParentMenu(_objMenu)
478	_waMenuWantHide(_objParent)
479}
480
481
482function _waMenuParent(_obj)
483{
484	return _o.parents(".wa-menu-div");
485}
486
487function _waBuildMenu(_o,_config,_indexMenu,_isRoot,_menuStruct)
488{
489	var _cont = _waDynMenuContenair()
490
491	var _indexSubMenu = _cont.data("id-menu")
492	if (_indexSubMenu==undefined)
493	{
494		_indexSubMenu = 0;
495		_cont.data("id-menu",_indexSubMenu)
496	}
497	
498
499	if (_isRoot)
500	{
501		_o.data("id-menu",_indexSubMenu)
502	}
503	
504	var _html ="";
505
506	var _idMenu = "wa-sub-menu-"+_indexMenu+"-"+_indexSubMenu
507
508	_html += "<div class='wa-menu-div' id='"+_idMenu+"' style='position:absolute;left:0px;top:0px;width:1000px;text-align:"+_config.sub_align_text+";background-color:"+compliantColor(_config.sub_col_bg)+";";
509
510	_html += "z-index:"+_indexSubMenu+";"
511
512	if (_config.sub_menu_shadow)
513	{
514		_html += "-webkit-box-shadow: 1px 1px 12px #555555;-moz-box-shadow:1px 1px 12px #555555; box-shadow:1px 1px 12px #555555; ;";
515	}
516	
517	_html += "padding-top:3px;padding-bottom:3px;;"
518	//_html += "padding:0px;"
519
520
521	_html += "border:1px solid "+_config.sub_col_border+";' >"
522	
523	
524	//_config
525	for (var i=0;i<_menuStruct.length;i++)
526	{
527		var _sub = _menuStruct[i]
528		
529		//
530		var _idSubMenu =""
531		var _haveSubMenu = (_sub.length>1)
532		if (_haveSubMenu)
533		{
534			_indexSubMenu = _cont.data("id-menu")
535			_indexSubMenu++;
536			_cont.data("id-menu",_indexSubMenu)
537		}
538		
539		
540		if (_sub.length>0)
541		{
542			var _subDef=_sub[0]
543			var _label=_subDef[0]
544			var _url=_subDef[1]
545			var _target=_subDef[2]
546var _js=_subDef[4]
547			var _idMenuBis = ""
548			
549			var _class="wa-menu-item-div wa-sub-item-menu"
550	
551			if (_haveSubMenu)
552			{
553				_class+= " param[index_sub_menu("+_indexSubMenu+")]"
554			}
555
556			
557			_html += "<div class='"+_class+"' style='position:absolute;overflow:auto;left:0px;"
558			_html += "'>"
559			
560			var _cssText="position:relative;"+_config.sub_style_text
561
562			if (_config.sub_text_u)
563			{
564				_cssText += "text-decoration:underline;"
565			}
566			
567			else
568			{
569				_cssText += "text-decoration:none;"
570			}
571			
572			var _hasActionOnLink = false;
573			if (_url.length==0)
574			{
575				//_url = "#"
576				_url = "javascript:void(0)"
577				
578				
579				//_cssText += "cursor:default;"
580			}
581			else
582			{
583				_hasActionOnLink = true;
584			}
585			_html += "<a href=\""+_url+"\" ";
586			
587			
588			if (_js!=undefined)
589			{
590				_html += "onclick=waLaunchFunction("+_js+") ";
591				_hasActionOnLink = true;
592			}
593			
594			//cursor
595			if (_hasActionOnLink)
596			{
597				_cssText += "cursor:pointer;"
598			}
599			else
600			{
601				_cssText += "cursor:default;"
602			}
603	
604			
605			
606			
607			
608			
609			_html +="style=\""+_cssText
610
611			
612			_html += "\" target=\""+_target+"\">"
613
614			_html += _label
615			
616			if (_haveSubMenu)
617			{
618				_html += " <b>&rsaquo;</b>"
619			}
620			else
621			{
622				//_html += " &nbsp;"
623			}
624			_html += "</a>"
625			_html += "</div>"
626		}
627
628		///
629
630		///
631
632		if (_haveSubMenu)
633		{
634			var _subMenuStruct = _sub[1]
635			_waBuildMenu(_o,_config,_indexMenu,false,_subMenuStruct)
636		}
637	}
638
639	_html += "</div>"
640	
641	_cont.append(_html)
642}
643
644
645
646function _waActivatedItemWithSubMenu(_o,_config,_indexMenu,_indexSubMenu,_menuStruct)
647{
648	if (_indexSubMenu==null)
649	{
650		_indexSubMenu = _o.data("id-menu")
651	}
652	
653	_o.hover(function(){
654			_waMenuHover(waJSQuery(this),_config)
655		},
656		function(){
657
658			_waMenuHout(waJSQuery(this),_config)
659
660		}
661	)
662	////
663
664	var _maxWidth = 0;
665	var _maxHeight = 0;
666	var _yCur = 3;
667	
668	if (_menuStruct!=undefined)
669	{
670		var _objMenu = waJSQuery("#wa-sub-menu-"+_indexMenu+"-"+_indexSubMenu);
671		_o.data("obj-menu",_objMenu)
672
673		if (_objMenu.length>0)
674		{
675			_objMenu.data("menu-item-parent",_o)
676		}
677		
678	//		alert("_waActivatedMenu "+_o+"  "+_indexSubMenu)
679		var _subObjects = new Array()
680		_objMenu.find(".wa-sub-item-menu").each(function(i) 
681		{
682			_subObjects.push(waJSQuery(this))
683		 });
684
685		for (var i=0;i<_menuStruct.length;i++)
686		{
687			var _sub = _menuStruct[i]
688			if (_sub.length>0)
689			{
690					var _subDef=_sub[0]
691					///
692					var _label=_subDef[0]
693
694					var _subObj = _subObjects[i]
695
696					var _w = _subObj.outerWidth(true)*1.2
697					
698
699					
700					
701
702					
703					var _h = _subObj.outerHeight(true)*1.5
704					var _heightSub = _h+4
705					
706
707					var _margin = _heightSub*0.5
708					_margin = Math.max(_margin,3)
709					
710					var _widthSub = _w+5+_margin;//+10
711					//_widthSub = Math.max(_widthSub,70)
712					
713					
714					var _yOffset = (_heightSub-_subObj.height())/2
715	
716					_subObj.css({top:_yCur,width:_widthSub,height:_heightSub})
717
718					var _href = _subObj.find("a")
719
720					_href.css({top:_yOffset})
721					
722					
723					
724					_maxWidth = Math.max(_maxWidth,_widthSub)
725					_maxHeight += _heightSub
726
727					_yCur+=_heightSub;
728					
729					
730					//////
731					if (_config.sub_align_text=="center")
732					{
733						_href.css({"marginLeft":0,"marginRight":0})
734					}
735					else
736					if (_config.sub_align_text=="right")
737					{
738						_href.css({"marginLeft":0,"marginRight":_margin})
739
740						//_html += "margin-right:"+_margin+"px;"
741					}
742					else
743					{
744						_href.css({"marginLeft":_margin,"marginRight":0})
745						//_html += "margin-left:"+_margin+"px;"	
746					}
747
748
749					
750					///
751					
752					if (_sub.length>1)
753					{
754						
755						var _subMenuStruct = _sub[1]
756						
757						var _indexSubMenu = extractParamInfo(_subObj,"index_sub_menu")
758						_waActivatedItemWithSubMenu(_subObj,_config,_indexMenu,_indexSubMenu,_subMenuStruct)
759					}
760					else
761					{
762						_waActivatedSingleItem(_subObj,_indexMenu,_config)
763					}
764					
765		
766			}
767			
768
769		}
770
771		for (var i=0;i<_menuStruct.length;i++)
772		{
773			var _sub = _menuStruct[i]
774			if (_sub.length>0)
775			{
776				var _subObj = _subObjects[i];
777				//
778				_subObj.css({"width":_maxWidth})
779			}
780
781		}
782		
783		
784		var _corner = _config.sub_corner
785		_objMenu.css({"-webkit-border-radius":_corner,"-moz-border-radius":_corner,"border-radius":_corner})
786
787		_objMenu.css({width:_maxWidth,height:_maxHeight})
788		_objMenu.hide()	
789	}
790}
791
792function _waActivatedSingleItem(_o,_config,_indexMenu)
793{
794	_o.hover(function(){
795	//	alert('over')
796			_waMenuHover(waJSQuery(this))
797		},
798		function(){
799
800			_waMenuHout(waJSQuery(this))
801
802		}
803	)
804}1
805-->

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.