PageSourceSearch

https://www.sisronline.it/modules/mod_s5_accordion_menu/js/s5_accordion_menu_jquery.js

js sisronline.it collected 2026-10-04 20:14:27 UTC 13,447 bytes, 282 lines download raw bytes

1/*function (tmp){
2	tmp.parents('.s5_am_innermenu').each(function(i,d){
3		jQuer(d).css('height','auto');
4		console.log(d);
5		jQuery(d).animate({'height' :jQuery(d).height()},{duration:1000,'queue':false});
6	});
7}
8*/
9
10jQuery(document).ready(function(){
11		jQuery('.handleopen').each(function(i,d){
12			if(toolbar.visible){
13				jQuery(d).click(function(e){
14							e.preventDefault();
15							if(jQuery(d).attr('href2')!='javascript:;' && jQuery(d).attr('href2'))window.open(jQuery(d).attr('href2'),'targetWindow','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
16				});
17			}else{
18				d.href=d.getAttribute('href2');
19			}
20		});
21		jQuery('.handleopenx').each(function(i,d){
22			jQuery(d).click(function(e){
23						e.preventDefault();
24						var onclickx = jQuery(d).attr('onclickx');
25						if(onclickx)eval(onclickx);
26			});
27		});
28	});
29
30function s5_am_click_handle_inner(j, tmp){
31	if(console)console.log(jQuery('a', jQuery(tmp).prev())[0].href);
32	//if(jQuery('a', jQuery(tmp).prev())[0].href!='javascrit:;') return;
33	var flag = false;
34	if(jQuery(tmp).hasClass('.s5_innermenu_current')) flag = true;
35	if(jQuery(tmp).parents('.s5_innermenu_current').length==0 && jQuery('.s5_innermenu_current',tmp).length==0)
36		jQuery('.s5_innermenu_current').animate({'height':0,opacity:0}, {duration:1000,'queue':false}).removeClass('s5_innermenu_current');
37	if(flag) return;
38	if(tmp.height() > 0){
39	tmp.animate({'height':0,opacity:0}, {duration:1000,'queue':false,complete:function (){
40	tmp.parents('.s5_am_innermenu').each(function(i,d){
41		jQuery(d).css('height','auto');
42		jQuery(d).animate({'height' :jQuery(d).height()},{duration:1000,'queue':false});
43	});
44}});
45	}else{
46		tmp.css('height','auto');
47		tmp.animate({'height' :tmp.height(), opacity:1}, {duration:1000,'queue':false,complete:function (){
48		tmp.parents('.s5_am_innermenu').each(function(i,d){
49				jQuery(d).css('height','auto');
50				jQuery(d).animate({'height' :jQuery(d).height()},{duration:1000,'queue':false});
51			});
52		}}).addClass('s5_innermenu_current');
53	}
54	/*
55	console.log(tmp.parents('.s5_am_innermenu'));
56	tmp.parents('.s5_am_innermenu').each(function(i,d){
57		jQuery(d).animate({'height' :jQuery(d).height()},{duration:1000,'queue':false});
58		});
59		*/ 
60}
61jQuery(document).ready((function ($) {
62    if (s5_am_parent_link_enabled == "0") {
63        var s5_am_parent_link = document.getElementById("s5_accordion_menu").getElementsByTagName("A");
64        for (var s5_am_parent_link_y = 0; s5_am_parent_link_y < s5_am_parent_link.length; s5_am_parent_link_y++) {
65            if (s5_am_parent_link[s5_am_parent_link_y].parentNode.parentNode.tagName == "H3") {
66                s5_am_parent_link[s5_am_parent_link_y].href = "javascript:;";
67            }
68        }
69    }
70    function s5_am_h3_background_load() {
71        var s5_am_h3_close = document.getElementById("s5_accordion_menu").getElementsByTagName("H3");
72        for (var s5_am_h3_close_y = 0; s5_am_h3_close_y < s5_am_h3_close.length; s5_am_h3_close_y++) {
73            if (s5_am_h3_close[s5_am_h3_close_y].nextSibling.innerHTML == "" || s5_am_h3_close[s5_am_h3_close_y].nextSibling.innerHTML == " ") {
74                s5_am_h3_close[s5_am_h3_close_y].className = "s5_am_toggler s5_am_not_parent";
75            }
76            if (s5_am_h3_close[s5_am_h3_close_y].nextSibling.innerHTML != "" && s5_am_h3_close[s5_am_h3_close_y].nextSibling.innerHTML != " ") {
77                s5_am_h3_close[s5_am_h3_close_y].className = "s5_am_toggler s5_am_parent";
78            }
79        }
80        if (this.nextSibling.innerHTML == "" || this.nextSibling.innerHTML == " ") {
81            this.className = "s5_am_toggler s5_am_open s5_am_not_parent";
82        }
83        if (this.nextSibling.innerHTML != "" && this.nextSibling.innerHTML != " ") {
84            this.className = "s5_am_toggler s5_am_open s5_am_parent";
85        }
86    }
87    var s5_am_h3_background = document.getElementById("s5_accordion_menu").getElementsByTagName("H3");
88    for (var s5_am_h3_background_y = 0; s5_am_h3_background_y < s5_am_h3_background.length; s5_am_h3_background_y++) {
89        s5_am_h3_background[s5_am_h3_background_y].onclick = s5_am_h3_background_load;
90    }
91    var s5_am_element = document.getElementById("s5_accordion_menu").getElementsByTagName("DIV");
92    for (var s5_am_element_y = 0; s5_am_element_y < s5_am_element.length; s5_am_element_y++) {
93        if (s5_am_element[s5_am_element_y].className == "s5_accordion_menu_element") {
94            if (s5_am_element[s5_am_element_y].innerHTML != "") {
95                s5_am_element[s5_am_element_y].style.display = s5_accordion_menu_display;
96            }
97            if (s5_am_element[s5_am_element_y].innerHTML == " " || s5_am_element[s5_am_element_y].innerHTML == "") {
98                s5_am_element[s5_am_element_y].previousSibling.className = "s5_am_toggler s5_am_not_parent";
99            }
100            if (s5_am_element[s5_am_element_y].innerHTML != " " && s5_am_element[s5_am_element_y].innerHTML != "") {
101                s5_am_element[s5_am_element_y].previousSibling.className = "s5_am_toggler s5_am_parent";
102            }
103        }
104    }
105    var s5_am_current_level = 0;
106    var s5_am_h3_current = document.getElementById("s5_accordion_menu").getElementsByTagName("H3");
107    for (var s5_am_h3_current_y = 0; s5_am_h3_current_y < s5_am_h3_current.length; s5_am_h3_current_y++) {
108        if (s5_am_h3_current[s5_am_h3_current_y].id == "current") {
109            s5_am_current_level = s5_am_h3_current_y;
110        }
111    }
112    var s5_am_li_current = document.getElementById("s5_accordion_menu").getElementsByTagName("LI");
113    for (var s5_am_li_current_y = 0; s5_am_li_current_y < s5_am_li_current.length; s5_am_li_current_y++) {
114        if (s5_am_li_current[s5_am_li_current_y].id == "current") {
115            if (s5_am_li_current[s5_am_li_current_y].parentNode.parentNode.className == "s5_accordion_menu_element") {
116                s5_am_li_current[s5_am_li_current_y].parentNode.parentNode.id = "s5_am_parent_div_current";
117            } else if (s5_am_li_current[s5_am_li_current_y].parentNode.parentNode.parentNode.className == "s5_accordion_menu_element") {
118                s5_am_li_current[s5_am_li_current_y].parentNode.parentNode.parentNode.id = "s5_am_parent_div_current";
119            } else if (s5_am_li_current[s5_am_li_current_y].parentNode.parentNode.parentNode.parentNode.className == "s5_accordion_menu_element") {
120                s5_am_li_current[s5_am_li_current_y].parentNode.parentNode.parentNode.parentNode.id = "s5_am_parent_div_current";
121            } else if (s5_am_li_current[s5_am_li_current_y].parentNode.parentNode.parentNode.parentNode.parentNode.className == "s5_accordion_menu_element") {
122                s5_am_li_current[s5_am_li_current_y].parentNode.parentNode.parentNode.parentNode.parentNode.id = "s5_am_parent_div_current";
123            } else if (s5_am_li_current[s5_am_li_current_y].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.className == "s5_accordion_menu_element") {
124                s5_am_li_current[s5_am_li_current_y].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id = "s5_am_parent_div_current";
125            } else if (s5_am_li_current[s5_am_li_current_y].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.className == "s5_accordion_menu_element") {
126                s5_am_li_current[s5_am_li_current_y].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id = "s5_am_parent_div_current";
127            }
128            var s5_am_div_current = document.getElementById("s5_accordion_menu").getElementsByTagName("DIV");
129            for (var s5_am_div_current_y = 0; s5_am_div_current_y < s5_am_div_current.length; s5_am_div_current_y++) {
130                if (s5_am_div_current[s5_am_div_current_y].id == "s5_am_parent_div_current") {
131                    s5_am_current_level = s5_am_div_current_y - 1;
132                }
133            }
134        }
135    }
136    var togglers = $('h3.s5_am_toggler');
137  //  var elms = $('div.s5_accordion_menu_element');
138    var elms = $('div.s5_accordion_menu_element');
139    $(togglers).each(function (i, d) {
140       /* if (i == 0) {
141            elms.eq(0).css({
142                'height': $(this).children(0).height(),
143                'opacity': 1
144            });
145        } else*/ {
146            $(d).removeClass('s5_am_open');
147            elms.eq(i).css({
148                'height': 0,
149                'opacity': 0
150            });
151        }
152        $(d).click(function (e) {
153            var flag = togglers.index(e.target) != elms.index($('div.vacurrentmenu'));
154            $('div.vacurrentmenu').removeClass('vacurrentmenu').animate({
155                'height': 0,
156                'opacity': 0
157            }, {
158                'duration': 1600,
159                'queue': false,
160                'easing': 'easeOutExpo'
161            });
162            $(this).removeClass('s5_am_open');
163            for(var tmp = e.target; tmp.nodeName != 'A' && tmp.nodeName != 'BODY'; tmp = tmp.parentNode);
164            if (tmp.nodeName == 'A' && tmp.href != 'javascript:;' && tmp.target!='_blank' && tmp.onclick==null) {
165                self.location.href = e.target.parentNode.href;
166                return false;
167            }
168            if (flag) {
169                if (elms.eq(i).children(0).length > 0) h = elms.eq(i).children(0).outerHeight();
170                else h = elms.eq(i).outerHeight();
171                $(this).addClass('s5_am_open');
172                elms.eq(i).addClass('vacurrentmenu').animate({
173                    'height': h,
174                    'opacity': 1
175                }, {
176                    'duration': 1600,
177                    'queue': false,
178                    'easing': 'easeOutExpo'
179                });
180            }
181        });
182    });;
183    
184	
185
186    $('.s5_accordion_menu_left').each(function (i, d) {
187        $(d).click(function (e) {
188            var tmp = $(e.target).parent()[0];
189			//for(var tmp = e.target; tmp.nodeName != 'A' && tmp.nodeName != 'BODY'; tmp = tmp.parentNode);
190            if(console) console.log(e.target);
191            var j = togglers.index(d.parentNode);
192            for(var tmp2 = e.target; tmp2.className!='s5_accordion_menu_left';tmp2=tmp2.parentNode);
193            
194			// causing spacing issue in IE9 if enabled
195			// if(console)console.log(tmp2);
196            if(console)console.log($(tmp2).next().hasClass('s5_am_innermenu'));
197            if(/*tmp.nodeName=='A' && tmp.href=='javascript:;' &&*/ $(tmp2).next().hasClass('s5_am_innermenu')){
198				tmp = $(tmp2).next();
199			}
200			 if(console)console.log($(tmp).hasClass('s5_am_innermenu'));
201            if(tmp.nodeName == 'A'){
202				if(console) console.log(1);
203				s5_am_click_handle(j,tmp);
204			}else if($(tmp).hasClass('s5_am_innermenu')){
205				s5_am_click_handle(j,tmp);
206			}else{  
207				if(console) console.log(2,e.target);
208				//if($('a', tmp).size() > 0 ){
209						s5_am_click_handle(j,tmp);
210				/*}else{
211						for(; tmp.nodeName!='A'; tmp=tmp.parentNode	);
212						s5_am_click_handle(j,tmp);
213				}*/
214			}
215        });
216    });;
217    /**
218     * i == index
219     * tmp == A tag
220     */
221    function s5_am_click_handle(i,tmp){
222		if($(tmp).hasClass('s5_am_innermenu')){
223			s5_am_click_handle_inner(i,tmp);
224			return ;
225		}
226		// causing spacing issue in IE9 if enabled
227		//if(console)console.log(tmp);
228		if(tmp.href == 'javascript:;' || tmp.nodeName=='H3'){
229					 var flag = i !== elms.index($('div.vacurrentmenu'));
230					$('div.vacurrentmenu').removeClass('vacurrentmenu').animate({
231						'height': 0,
232						'opacity': 0
233					}, {
234						'duration': 1600,
235						'queue': false,
236						'easing': 'easeOutExpo'
237					});
238					if (flag) {
239						if (elms.eq(i).children(0).length > 0) h = elms.eq(i).children(0).outerHeight();
240						else h = elms.eq(i).outerHeight();
241						$(this).addClass('s5_am_open');
242						elms.eq(i).addClass('vacurrentmenu').animate({
243							'height': h,
244							'opacity': 1
245						}, {
246							'duration': 1600,
247							'queue': false,
248							'easing': 'easeOutExpo'
249						});
250					}
251		}else{
252					if(console) console.log(tmp.nodeName!='H3' && tmp.nodeName == 'A' && tmp.target != '_blank' &&tmp.onclick == null);
253					 if(tmp.nodeName!='H3' && tmp.nodeName == 'A' && tmp.target != '_blank' &&tmp.onclick == null)
254						self.location.href=tmp.href;
255		}
256	}
257	
258	
259    var s5_am_h3_first = document.getElementById("s5_accordion_menu").getElementsByTagName("H3");
260    for (var s5_am_h3_first_y = 0; s5_am_h3_first_y < s5_am_h3_first.length; s5_am_h3_first_y++) {
261        if (s5_am_h3_first_y == s5_am_current_level) {
262            if (s5_am_h3_first[s5_am_h3_first_y].nextSibling.innerHTML == "" || s5_am_h3_first[s5_am_h3_first_y].nextSibling.innerHTML == " ") {
263                s5_am_h3_first[s5_am_h3_first_y].className = "s5_am_toggler s5_am_open s5_am_not_parent";
264            }
265			if (s5_closed_or_open == "open") {
266				if (s5_am_h3_first[s5_am_h3_first_y].nextSibling.innerHTML != "" && s5_am_h3_first[s5_am_h3_first_y].nextSibling.innerHTML != " ") {
267					s5_am_h3_first[s5_am_h3_first_y].className = "s5_am_toggler s5_am_open  s5_am_parent";
268					if (elms.eq(s5_am_h3_first_y).children(0).length > 0) h = elms.eq(s5_am_h3_first_y).children(0).outerHeight();
269					else h = elms.eq(s5_am_h3_first_y).outerHeight();
270					elms.eq(s5_am_h3_first_y).addClass('vacurrentmenu').animate({
271						'height': h,
272						'opacity': 1
273					}, {
274						'duration': 1900,
275						'queue': false,
276						'easing': 'easeOutExpo'
277					});
278				}
279			}
280        }
281    }
282})(jQuery));

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.