PageSourceSearch

https://www.ehu.eus/o/upv-ehu-global-theme/js/main.js?browserId=ch…=js&languageId=es_ES&t=1790331544000

js ehu.eus collected 2026-10-01 09:09:28 UTC 10,689 bytes, 352 lines download raw bytes

1/*1790331542000*/
2/* 
3 * UPV/EHU - Menu lateral izquierdo
4 * 	Para des/plegarlo al pulsar sobre el icono de des/plegar
5 *  Para mantener desplegada la opción que tenga una pagina hija seleccionada  
6 */  
7 
8AUI().use(
9		'anim',
10		'transition',
11		function(A) {
12			
13			var toggleClass = function(event) {
14				event.stopPropagation();
15
16				var currentTargetNode = event.currentTarget;
17
18				var baseClassName = 'class-toggle-';
19
20				var targetClass = currentTargetNode.attr('data-target-class');
21				
22				if (targetClass) {
23					var className = baseClassName + targetClass;						
24				}else{
25					var className = baseClassName + 'active';					
26				}
27
28				var nodes = currentTargetNode.attr('data-target-node');
29				if (nodes) {
30					nodes = A.all(nodes);
31				}else{
32					nodes = A.NodeList.create();
33					nodes.push(currentTargetNode);
34				}
35
36				nodes.each(
37					function(node) {
38						node.toggleClass(className);
39						
40						// Al clickar el icono para plegar/desplegar paginas hijos, varia su los estilos del icono asociado  
41						if (node.hasClass("has-sub-nav")){
42							var nodeChildren = node.attr('children');
43							nodeChildren.each(
44								function(nodeChild) {
45									if (nodeChild.hasClass("children-marker")){
46										if (nodeChild.hasClass("icon-chevron-down")){
47											nodeChild.replaceClass("icon-chevron-down","icon-chevron-up");
48										} else {
49											nodeChild.replaceClass("icon-chevron-up","icon-chevron-down");
50										}										
51									} 
52								}		
53							);
54						}
55
56						if (!currentTargetNode.hasAttribute('data-transition-property')) {
57							return;
58						}
59
60						var transitionProperty = currentTargetNode.getAttribute('data-transition-property');
61
62						var transitionDuration = parseInt(currentTargetNode.getAttribute('data-transition-duration'));
63
64						if (!transitionDuration) {
65							transitionDuration = 0.5;
66						}
67
68						var transitionStart = currentTargetNode.getAttribute('data-transition-start');
69
70						if (!transitionStart) {
71							var transitionStart = 0;
72						}
73
74						var transitionEnd = currentTargetNode.getAttribute('data-transition-end');
75
76						if (!transitionEnd) {
77							transitionEnd = parseInt(node.one('.' + baseClassName + 'content').get('clientHeight'));
78						}
79
80						var config = [];
81
82						if (node.hasClass(className)) {
83							config[transitionProperty] = transitionEnd;
84						}
85						else {
86							config[transitionProperty] = transitionStart;
87						}
88
89						config["duration"] = transitionDuration;
90
91						node.transition(config);
92
93						node.setStyle(transitionProperty, config[transitionProperty]);
94					}
95				);
96			};
97
98			A.all('.class-toggle').on('click', toggleClass);
99			A.all('.class-toggle').on('keypress', toggleClass);			
100		}
101	);
102
103/*-- UPV/EHU --*/
104
105AUI().ready(
106		
107	/*
108	This function gets loaded when all the HTML, not including the portlets, is
109	loaded.
110	*/	
111		
112	'aui-carousel', 'liferay-navigation-interaction', 'aui-toggler',
113	function(A) {
114		
115		/*---------------*/
116		/*-- Carrusel  --*/
117		/*---------------*/
118		/*-- Si existe el carrusel, el primer nodo del menu del carrusel es siempre el nodo de Play/Pause,
119		 * el cual cambia de icono asociado al pulsar sobre él teniendo en cuenta el estado anterior 
120		 */
121		var carousel = A.one('#carousel');
122		if (carousel) {
123			var menuItems = A.all("#carousel menu li a");
124			var playPauseItem = menuItems.first(); 
125			playPauseItem.on(
126				'click',
127				function(event){
128					if (playPauseItem.hasClass("carousel-menu-play")){
129						playPauseItem.replaceClass("icon-play","icon-pause");						
130					} else {
131						playPauseItem.replaceClass("icon-pause","icon-play");
132					}					
133				}
134			);		
135		}	
136		
137		
138		/*-------------------------------*/
139		/*-- Menu Responsive Principal --*/
140		/*-------------------------------*/
141		
142		/*-- Al clickar el boton del menu responsivo se pliega/despliega el menu responsivo si existe --*/
143		var menuResponsive = A.one('#menu-responsive');
144		var btnResponsive = A.one('#btn-responsive');
145		if ((menuResponsive) && (btnResponsive)) {
146			btnResponsive.on(
147					'click', 
148					function(event){
149						btnResponsive.toggleClass('open');
150						menuResponsive.toggleClass('open');						
151					}
152			);
153		}
154		
155		/*--------------------------------*/
156		/*-- Menu Responsive del sitio  --*/
157		/*--------------------------------*/
158		
159		/*-- Al clickar el boton (#side-btn) del menu de navegacion del sitio en responsivo (por defecto plegado class="icon-chevron-down"),
160		 *  se muestra/oculta el menu de navegacion del sitio (#side-menu)  --*/
161		var menuSite = A.one('#side-menu');
162		var btnSite = A.one('#side-menu #side-btn');
163		var iconSite = A.one('#side-menu #side-btn #icon-chevron');
164		if ((menuSite) && (btnSite) && (iconSite)) {
165			btnSite.on(
166				'click',
167				function(event){
168					btnSite.toggleClass('class-toggle-active');
169					menuSite.toggleClass('open');
170					A.one("body").toggleClass("menu-opened");
171					if (iconSite.hasClass("icon-chevron-down")){
172						iconSite.replaceClass("icon-chevron-down","icon-chevron-up");						
173					} else {
174						iconSite.replaceClass("icon-chevron-up","icon-chevron-down");						
175					}					
176				}
177			);
178		}	
179		
180		/*--------------------------------*/
181		/*--  TogglerAui: Acordeon   --*/
182		/*--------------------------------*/
183		if(document.getElementById("myToggler") != null){
184			
185			new A.TogglerDelegate({
186		        animated: true,
187		        closeAllOnExpand: true,
188		        container: '#myToggler',
189		        content: '.content',
190		        expanded: false,
191		        header: '.header',
192		        transition: {
193		        	duration: 0.2,
194		        	easing: 'cubic-bezier(0, 0.1, 0, 1)'
195		        }
196			});
197		}
198		
199		/*-- Hay que usar el marcado de manera que facilite la accesibilidad y en elementos no estándar de HTML 
200		 * (acordeones, ventanas modales, carruseles, desplegables…) hay que usar WAI-ARIA.  --*/
201		var menuItems = document.querySelectorAll("#myToggler .header.toggler-header");
202		for (i = 0; i < menuItems.length; i++) {
203			menuItems[i].addEventListener("click",
204				function(event){
205					for (j = 0; j < menuItems.length; j++) {
206						menuItems[j].removeAttribute('aria-disabled');
207						menuItems[j].setAttribute("aria-expanded","false");
208					}
209					if (this.classList.contains("toggler-header-collapsed")){
210						this.setAttribute("aria-disabled","true");
211						this.setAttribute("aria-expanded","true");
212					}
213				}
214			);
215		}
216	}
217);
218
219Liferay.Portlet.ready(
220
221	/*
222	This function gets loaded after each and every portlet on the page.
223
224	portletId: the current portlet's id
225	node: the Alloy Node object of the current portlet
226	*/
227
228	function(portletId, node) {
229	}
230);
231
232Liferay.on(
233	'allPortletsReady',
234
235	/*
236	This function gets loaded when everything, including the portlets, is on
237	the page.
238	*/
239
240	function() {
241		//Nuevo acordeon
242		var acc = document.getElementsByClassName("own-accordion");
243		
244		for (var i = 0; i < acc.length; i++) {
245		  acc[i].addEventListener("click", function() {
246		    this.classList.toggle("active");
247		    var panel = $(this).parent().next()[0];
248		    if (panel.style.maxHeight) {
249		      panel.style.maxHeight = null;
250		    } else {
251		      panel.style.maxHeight = panel.scrollHeight + "px";
252		    } 
253		  });
254		}		
255	}
256);
257
258$(document).ready(function() {
259	accessibility();
260
261	$("body").on("click", ".yui3-calendar-pane table tbody tr td.evento a", function(){
262		$(this).closest('.column-right-calendar').find('.listadoCal > ul > li:first-child a').focus();
263	});
264
265	$('.filterCal .form-check input').change(function() {
266        $('.tbodyAux a:first-child').focus();        
267    });
268
269    /* DOMSubtreeModified comentado Deprecation
270	$(".yui3-widget-mask").one("DOMSubtreeModified",function() {
271		if ($(this).hasClass('hide')) {
272		  	$("body").removeClass("image-gallery");
273		}
274		else {
275			$("body").addClass("image-gallery");
276		}
277	}); */
278
279	/* Hamburguer icon */
280	$('.hamburguer-icon').on('click', function () {
281		$('.hamburguer-icon-animated').toggleClass('open');
282	});
283
284/* 	$('.featured_article-image .owl-carousel').owlCarousel({
285		loop:false,
286		nav:false,
287		items:1,
288		dots:false,
289		autoplay:true,
290		autoplayTimeout: 6000
291	}); */
292
293	/* tooltip */
294	var is_touch_device = 'ontouchstart' in document.documentElement;
295    if(!is_touch_device) { /* touch is enabled */
296		var tooltips = document.querySelectorAll('#content a:not([title]) span.sr-only');
297		tooltips.forEach((tooltip) => {
298			if(tooltip.parentNode.getAttribute("data-original-title")) {/* all sr-only exist in a link */
299				tooltip.parentElement.setAttribute("data-original-title", tooltip.parentNode.getAttribute("data-original-title") + "<br>" + tooltip.innerHTML);
300			}else{
301				tooltip.parentElement.setAttribute("data-toggle-upv", "tooltip");
302				tooltip.parentElement.setAttribute("data-placement", "auto");
303				tooltip.parentElement.setAttribute("data-html", "true");
304				tooltip.parentElement.setAttribute("data-original-title", tooltip.innerHTML);
305			}
306		});
307		$(function () {
308			$('[data-toggle-upv="tooltip"]').tooltip()
309		});
310	}
311
312
313
314});
315
316	
317
318
319function accessibility(){
320	//Liferay input hide
321	if($("#hrefFm input").length>0) {
322		$("#hrefFm input").val("hide accesible");
323	}
324	//owl dotted accesibility
325	if($(".owl-carousel").length>0) {
326		var cont=0;
327		$(".owl-carousel .owl-dots button").each(function(){
328		    $(this).find("span").html(""+cont);
329		    cont++;
330		});
331	}
332	if($("button.close.image-viewer-base-control.image-viewer-close.hide").length>0) {
333		$('<span class="sr-only">close</span>').appendTo($("button.close.image-viewer-base-control.image-viewer-close.hide"));
334	}
335	if($("a.carousel-control.right.image-viewer-base-control.image-viewer-base-control-right").length>0) {
336		$('<span class="sr-only">right</span>').appendTo($("a.carousel-control.right.image-viewer-base-control.image-viewer-base-control-right"));
337	}
338	if($("a.carousel-control.left.image-viewer-base-control.image-viewer-base-control-left").length>0) {
339	   $('<span class="sr-only">left</span>').appendTo($("a.carousel-control.left.image-viewer-base-control.image-viewer-base-control-left"));
340	}
341
342	$("button.btn-search").focus(function(){
343		setTimeout(function(){ $("input.search-bar-keywords-input").focus();}, 100);
344	});
345
346	$(".nav-link,li.dropdown.language a").focus(function(){
347	    $(".focusin").removeClass("focusin");
348	});
349	$(".header__top-menu__sign-in > a").focus(function(){
350		$(".focusin").removeClass("focusin");
351	});
352}

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.