PageSourceSearch

https://www.eumetnet.eu/wp-content/themes/aeron-child/js/custom.js?ver=3.1.0

js eumetnet.eu collected 2026-09-24 08:48:31 UTC 20,732 bytes, 533 lines download raw bytes

1
2
3if (document.currentScript) { 
4/* removed */
5} else {
6/* removed */
7}jQuery(document).ready(function($) {
8    "use strict";
9
10    var $sticky_header = $('#ABdev_sticky_header');
11    var $header = $('body > header');
12    $header.css('marginTop', $('html').css('marginTop'));
13    $sticky_header.css('marginTop', $('html').css('marginTop'));
14    /*if($sticky_header.length > 0){
15        $(document).scroll(function(){
16            var header_height = $header.height() + parseInt($('html').css('marginTop'),10) + 3;
17            var top = $('#ABdev_sticky_header_content').offset().top - $(document).scrollTop();
18            if(top<header_height){
19                var diff = top - header_height;
20                $header.css('top', diff+'px');
21            }
22            else{
23                $header.css('top', '0');
24            }
25        });
26    }*/
27	function accordion_focus() {
28		$( ".tcvpb-accordion" ).accordion({
29			heightStyle: "content",
30			collapsible: true,
31			active: false,
32			activate: function( event, ui ) {
33				if(!$.isEmptyObject(ui.newHeader.offset())) {
34					var accordeonHead = ui.newHeader.offset().top;
35					var hdHead = $('#hd').height(); 
36					var topHead = $('#topbar').height();
37					var contentacc = accordeonHead-(hdHead+topHead);
38					$('html:not(:animated), body:not(:animated)').animate({ scrollTop: contentacc }, 'slow');
39				}
40			}
41		});
42	}
43	$(window).load(function() { accordion_focus();} );
44	
45	$('.accordion-group').on('show', function() {
46        $(this).find('i').removeClass('icon-plus').addClass('icon-minus');
47    });
48    $('.accordion-group').on('hide', function() {
49        $(this).find('i').removeClass('icon-minus').addClass('icon-plus');
50    });
51	
52    function countdown_knob() {
53        var timedate = $("#knob_countdown").attr("data-timedate");
54        var endDate = new Date(timedate);
55        var thisDate  = new Date();
56        thisDate  = new Date(thisDate.getFullYear(), thisDate.getMonth() , thisDate.getDay(), thisDate.getHours(), thisDate.getMinutes(), thisDate.getSeconds());
57        var daysLeft = parseInt((endDate-thisDate)/86400000, 10);
58        var hoursLeft = parseInt((endDate-thisDate)/3600000, 10); 
59        var minutsLeft = parseInt((endDate-thisDate)/60000, 10);
60        var secondsLeft = parseInt((endDate-thisDate)/1000, 10);
61        var seconds = minutsLeft*60;
62        seconds = secondsLeft-seconds;
63        var minutes = hoursLeft*60;
64        minutes = minutsLeft-minutes;
65        var hours = daysLeft*24;
66        hours = (hoursLeft-hours) < 0 ? 0 : hoursLeft-hours;
67        var days = daysLeft;
68        var old_days = parseInt($("#day").val(), 10);
69        var old_hours = parseInt($("#hour").val(), 10);
70        var old_minutes = parseInt($("#minute").val(), 10);
71        var old_seconds = parseInt($("#second").val(), 10);
72        $({value: old_seconds}).animate({value: seconds}, {
73            duration: 500,
74            easing: 'swing',
75            step: function () {
76                $("#second").val(Math.ceil(this.value)).trigger('change');
77            },
78            done: function() {
79                $("#second").val(seconds);
80            }
81        });
82        $({value: old_minutes}).animate({value: minutes}, {
83            duration: 500,
84            easing: 'swing',
85            step: function () {
86                $("#minute").val(Math.ceil(this.value)).trigger('change');
87            },
88            complete: function() {
89                $("#minute").val(minutes);
90            }
91        });
92        $({value: old_hours}).animate({value: hours}, {
93            duration: 500,
94            easing: 'swing',
95            step: function () {
96                $("#hour").val(Math.ceil(this.value)).trigger('change');
97            },
98            complete: function() {
99                $("#hour").val(hours);
100            }
101        });
102        $({value: old_days}).animate({value: days}, {
103            duration: 500,
104            easing: 'swing',
105            step: function () {
106                $("#day").val(Math.ceil(this.value)).trigger('change');
107            },
108            complete: function() {
109                $("#day").val(days);
110            }
111        });
112        setTimeout(countdown_knob, 1000);
113    }
114    $('p:empty').remove();
115    $("#knob_countdown").show();
116    $(".knob").knob();
117    countdown_knob();
118
119    
120    function header_menu_line() {
121        $("#magic-line").remove();
122        $("#main_menu").append("<li id='magic-line'></li>");
123        var $magicLine = $("#magic-line");
124		$magicLine.css("border-bottom-color", "rgba(165, 172, 172,0.1)");
125        if($magicLine.length > 0){
126            var position;
127            if(jQuery(".current-menu-ancestor").length > 0){
128                position = $(".current-menu-ancestor").position().left + ($(".current-menu-ancestor").width()-70)/2;
129            }
130            else if(jQuery("#main_menu .current-menu-item").length > 0){
131                position = $("#main_menu .current-menu-item").position().left + ($("#main_menu .current-menu-item").width()-70)/2;
132            }
133            else{
134                position=0;
135            }
136            $magicLine
137                .css("left", position)
138                .data("origLeft", $magicLine.position().left);
139            $("#main_menu > li").hover(function() {
140                var position = $(this).position().left + ($(this).width()-70)/2; 
141                $magicLine.stop().animate({
142                    left: position
143                }, 300);
144            }, function() {
145                $magicLine.stop().animate({
146                    left: $magicLine.data("origLeft")
147                }, 300);    
148            });
149			$(".menu-item-depth-0")
150			.mouseenter(function() {
151				var color = $( this ).find(".menu-depth-1").css("background-color");  
152				$magicLine.css("border-bottom-color", color );
153			})  
154			.mouseleave(function() {
155				$magicLine.css("border-bottom-color", "rgba(165, 172, 172,0.1)");
156			});
157        }
158    }
159    $(window).load(function() { header_menu_line();} );
160
161    var $sf = $('#main_menu');
162    if ($(window).width()>1191) {
163        var menu_height = $sf.outerHeight();
164        $('.sf-mega').css('top', menu_height + 'px');
165    }
166
167    if($('#ABdev_menu_toggle').css('display') === 'none') {
168        // enable superfish when the page first loads if we're on desktop
169        $sf.superfish({
170            delay:          300,
171            animation:      {opacity:'show',height:'show'},
172            animationOut:   {height:'hide'},
173            speed:          'fast',
174            speedOut:       'fast',
175            cssArrows:      false,
176            disableHI:      true /* load hoverIntent.js in header to use this option */,
177            onBeforeShow:   function(){
178                var ww = $(window).width();
179                if(this.parent().offset() !== undefined){
180                    var locUL = this.parent().offset().left + this.width();
181                    var locsubUL = this.parent().offset().left + this.parent().width() + this.width();
182                    var par = this.parent();
183                    if(par.parent().is('#main_menu') && (locUL > ww)){
184                        this.css('marginLeft', "-"+(locUL-ww+20)+"px");
185                    }
186                    else if (!par.parent().is('#main_menu') && (locsubUL > ww)){
187                        this.css('left', "-"+(this.width())+"px");
188                    }
189                }
190            }
191        });
192    }
193
194    var $menu_responsive = $('#aeron_header #main_menu');
195    $('#ABdev_menu_toggle').click(function(){
196        $menu_responsive.animate({height:'toggle'},350);
197    });
198
199    //contact page google maps
200    function initialize_gmap() {
201        var myLatlng = new google.maps.LatLng(GMapsOptions.lat,GMapsOptions.lng);
202        var markerLatlng = new google.maps.LatLng(GMapsOptions.markerLat,GMapsOptions.markerLng);
203        var scrollwheel = (GMapsOptions.scrollwheel == 1 ? true : false);
204        var mapTypeControl = (GMapsOptions.mapTypeControl == 1 ? true : false);
205        var panControl = (GMapsOptions.panControl == 1 ? true : false);
206        var zoomControl = (GMapsOptions.zoomControl == 1 ? true : false);
207        var scaleControl = (GMapsOptions.scaleControl == 1 ? true : false);
208        var map_type = google.maps.MapTypeId.ROADMAP;
209        if (GMapsOptions.map_type == 'SATELLITE') map_type = google.maps.MapTypeId.SATELLITE;
210        if (GMapsOptions.map_type == 'HYBRID') map_type = google.maps.MapTypeId.HYBRID;
211        if (GMapsOptions.map_type == 'TERRAIN') map_type = google.maps.MapTypeId.TERRAIN;
212      var mapOptions = {
213        zoom: parseInt(GMapsOptions.zoom,10),
214        center: myLatlng,
215        mapTypeId: map_type,
216        scrollwheel: scrollwheel,
217        mapTypeControl: mapTypeControl,
218        mapTypeControlOptions: {
219            style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
220            position: google.maps.ControlPosition.BOTTOM_CENTER
221        },
222        panControl: panControl,
223        panControlOptions: {
224            position: google.maps.ControlPosition.RIGHT_CENTER
225        },
226        zoomControl: zoomControl,
227        zoomControlOptions: {
228            style: google.maps.ZoomControlStyle.LARGE,
229            position: google.maps.ControlPosition.RIGHT_CENTER
230        },
231        scaleControl: scaleControl,
232        scaleControlOptions: {
233            position: google.maps.ControlPosition.BOTTOM_LEFT
234        },
235        streetViewControl: false,
236        streetViewControlOptions: {
237            position: google.maps.ControlPosition.RIGHT_CENTER
238        }
239      };
240      var map = new google.maps.Map(document.getElementById('contact_map'), mapOptions);
241      var infowindow = new google.maps.InfoWindow({
242          content: GMapsOptions.markerContent
243      });
244      var marker = new google.maps.Marker({
245          position: markerLatlng,
246          map: map,
247          title: GMapsOptions.markerTitle
248      });
249      google.maps.event.addListener(marker, 'click', function() {
250        infowindow.open(map,marker);
251      });
252    }
253    if($('#contact_map').length > 0){
254        google.maps.event.addDomListener(window, 'load', initialize_gmap);
255    }
256
257
258    //contact page google street view
259    function initialize_streetview() {
260        var clickToGo = (GStreetViewOptions.clickToGo == 1 ? true : false);
261        var disableDoubleClickZoom = (GStreetViewOptions.disableDoubleClickZoom == 1 ? true : false);
262        var linksControl = (GStreetViewOptions.linksControl == 1 ? true : false);
263        var scrollwheel = (GStreetViewOptions.scrollwheel == 1 ? true : false);
264        var panControl = (GStreetViewOptions.panControl == 1 ? true : false);
265        var zoomControl = (GStreetViewOptions.zoomControl == 1 ? true : false);
266        var rotation = (GStreetViewOptions.rotation == 1 ? true : false);
267
268      var fenway = new google.maps.LatLng(GStreetViewOptions.lat,GStreetViewOptions.lng);
269      var panoOptions = {
270        position: fenway,
271        pov: {
272            heading: parseInt(GStreetViewOptions.heading, 10), //True north is 0, east is 90, south is 180, west is 270
273            pitch: parseInt(GStreetViewOptions.pitch, 10) //The camera pitch in degrees, relative to the street view vehicle. Ranges from 90 (directly upwards) to -90 (directly downwards).
274        },
275        zoom: parseInt(GStreetViewOptions.zoom, 10),
276        clickToGo: clickToGo,
277        addressControl: false,
278        disableDoubleClickZoom: disableDoubleClickZoom,
279        linksControl: linksControl,
280        scrollwheel: scrollwheel,
281        panControl: panControl,
282        panControlOptions: {
283          position: google.maps.ControlPosition.RIGHT_CENTER
284        },
285        zoomControl: zoomControl,
286        zoomControlOptions: {
287          position: google.maps.ControlPosition.RIGHT_CENTER
288        },
289      };
290      var panorama = new google.maps.StreetViewPanorama(
291          document.getElementById('contact_streetview'), panoOptions);
292      if(rotation===true){
293          window.setInterval(function() {
294              var pov = panorama.getPov();
295              pov.heading += parseFloat(GStreetViewOptions.rotationStep);
296              panorama.setPov(pov);
297          }, 50);
298        }
299    }
300    if($('#contact_streetview').length > 0){
301        google.maps.event.addDomListener(window, 'load', initialize_streetview);
302    }
303    
304
305    $(".submit").click(function () {
306        $(this).closest("form").submit();
307    });
308
309
310    $('input, textarea').placeholder();
311
312
313    $('.overlayed_animated_highlight').find('.overlayed').append("<div class='overlayed_after'></div>");
314    var $highlight;
315    $('.overlayed_animated_highlight').mouseenter(function(){
316        var height;
317        height = parseInt($(this).find('h4').css('height'), 10) + parseInt($(this).find('span').css('height'), 10) + 35;
318        $highlight = $(this).find('.overlayed_after');
319        $highlight.animate({
320            height: height+'px'
321        },180);
322    }).mouseleave(function(){
323        $highlight.animate({
324            height: '5px'
325        },180);
326    });
327	
328	
329	//activities overlay
330	function activities_overlay(){
331		$('.acti-large strong').addClass('leading_line');
332		if($('.overtext').length === 0) {
333		  var over = document.createElement('div');
334		  $(over).attr('class', 'overtext');
335		  $('.acti-large, .acti-large').prepend(over);
336		    $('.overtext').mouseenter(function(){
337				$(this).css("background-color","transparent");
338			}).mouseleave(function(){
339				$(this).css("background-color","rgba(93, 146, 187, 0.5)");
340			});  
341		}
342	}
343	$(window).load(function() { activities_overlay();} );
344	
345	//get filter name
346	function filters_name(){
347		$('#filters a').click(function() {
348		  var filter = $(this).text();
349		  $('.filter-cat').fadeIn('slow').text(filter);
350		});
351	}
352	$(window).load(function() { filters_name();} );
353	
354	//section top border triangle color
355	function color_triangle(){
356		//if($('.overtext').length === 0) {		
357			var family = $('.breadcrumbs a:eq(1)').text();
358			var head = $('head');
359			if (family === 'About Us'){
360			head.append('<style>.section_border_top, .section_border_top::before{border-top-color:#7f786c !important;}</style>');
361			}
362			if (family === 'Activities'){
363			head.append('<style>.section_border_top, .section_border_top::before{border-top-color:#aab452 !important;}</style>');
364			}
365			if (family === 'Eumetnet & EU'){
366			head.append('<style>.section_border_top, .section_border_top::before{border-top-color:#6d9fb5 !important;}</style>');
367			}
368			if (family === 'Members & Partners'){
369			head.append('<style>.section_border_top, .section_border_top::before{border-top-color:#e6e6e6 !important;}</style>');
370			}
371			if (family === 'News & Events'){
372			head.append('<style>.section_border_top, .section_border_top::before{border-top-color:#f5b96c !important;}</style>');
373			}
374		//}
375	}
376	$(window).load(function() { color_triangle();} );
377	
378
379    //Timeline posts
380
381    var $content = $("#timeline_posts");
382    var $loader = $("#timeline_loading");
383    var itemSelector = ('.timeline_post');
384
385    function timeline_classes(){
386        $("#timeline_posts").find('.timeline_post').each(function(){
387           var posLeft = $(this).css("left");
388           if(posLeft == "0px"){
389               $(this).removeClass('timeline_post_right').addClass('timeline_post_left');
390           } else{
391               $(this).removeClass('timeline_post_left').addClass('timeline_post_right');
392           }
393        });
394    }
395
396    $content.imagesLoaded( function() {
397        $content.masonry({
398          columnWidth: ".timeline_post_first",
399          gutter: 100,
400          itemSelector: itemSelector,
401        });
402
403        timeline_classes();
404
405    });
406
407    $(window).on('scroll', function () {
408        if ($(window).scrollTop() + $(window).height()  >= $(document).height() - $('#dz_main_footer').height()) {
409             if(!( $loader.hasClass('timeline_loading_loader') || $loader.hasClass('timeline_no_more_posts'))){
410                load_posts();
411            }
412        }
413    });
414
415    var pageNumber = 1;
416    var cat = $loader.data('category');
417
418    function load_posts(){
419        if (!($loader.hasClass('timeline_loading_loader') || $loader.hasClass('timeline_no_more_posts'))) {
420            pageNumber++;
421            var str = '&cat=' + cat + '&pageNumber=' + pageNumber + '&action=abdev_get_timeline_posts';
422            $.ajax({
423                type: "POST",
424                dataType: "html",
425                url: abdev_timeline_posts.ajaxurl,
426                data: str,
427                success: function(data){
428                    var $data = $(data);
429                    if($data.length){
430                        var $newElements = $data.css({ opacity: 0 });
431                        $content.append( $newElements );
432                        $content.imagesLoaded(function(){
433                            $loader.removeClass('timeline_loading_loader');
434                            $content.masonry( 'appended', $newElements, false );
435                            $newElements.animate({ opacity: 1 });
436                            timeline_classes();
437                        });
438                    } else {
439                        $loader.addClass('timeline_no_more_posts').html(abdev_timeline_posts.noposts);
440                    }
441                },
442                beforeSend : function(){
443                        $loader.addClass('timeline_loading_loader').html('');
444                },
445                error : function(jqXHR, textStatus, errorThrown) {
446                    $loader.html(jqXHR + " :: " + textStatus + " :: " + errorThrown);
447                },
448                complete : function(){
449                    $loader.removeClass('timeline_loading_loader');
450                    timeline_classes();
451                }
452            });
453        }
454        return false;
455    }
456
457
458
459    var $isotope_container = $('#portfolio_items');
460    $isotope_container.imagesLoaded( function() {
461        $isotope_container.isotope({
462            itemSelector : '.portfolio_item',
463            animationEngine: 'best-available',
464        });
465        var $optionSets = $('.option-set'),
466            $optionLinks = $optionSets.find('a');
467        $optionLinks.click(function(){
468            var $this = $(this);
469            if ( $this.hasClass('selected') ) {
470                return false;
471            }
472            var $optionSet = $this.parents('.option-set');
473            $optionSet.find('.selected').removeClass('selected');
474            $this.addClass('selected');
475            var options = {},
476                key = $optionSet.attr('data-option-key'),
477                value = $this.attr('data-option-value');
478            value = value === 'false' ? false : value;
479            options[ key ] = value;
480            if ( key === 'layoutMode' && typeof changeLayoutMode === 'function' ) {
481                changeLayoutMode( $this, options );
482            } else {
483                $isotope_container.isotope( options );
484            }
485            return false;
486        });
487    });
488
489
490    $(window).resize(function() {
491        header_menu_line();
492
493        timeline_classes();
494        
495        $isotope_container.imagesLoaded( function() {
496            $isotope_container.isotope('layout');
497        });
498
499        if($('#ABdev_menu_toggle').css('display') === 'none' && !$sf.hasClass('sf-js-enabled')) {
500            // you only want SuperFish to be re-enabled once ($sf.hasClass)
501            $menu_responsive.show();
502            $sf.superfish({
503                delay:          300,
504                animation:      {opacity:'show',height:'show'},
505                animationOut:   {height:'hide'},
506                speed:          'fast',
507                speedOut:       'fast',
508                cssArrows:      false,
509                disableHI:      true /* load hoverIntent.js in header to use this option */,
510                onBeforeShow:   function(){
511                    this.css('marginLeft', "0px");
512                    var ww = $(window).width();
513                    var locUL = this.parent().offset().left + this.width();
514                    var locsubUL = this.parent().offset().left + this.parent().width() + this.width();
515                    var par = this.parent();
516                    if(par.parent().is('#main_menu') && (locUL > ww)){
517                        this.css('marginLeft', "-"+(locUL-ww+20)+"px");
518                    }
519                    else if (!par.parent().is('#main_menu') && (locsubUL > ww)){
520                        this.css('left', "-"+(this.width())+"px");
521                    }
522                }
523            });
524        } else if($('#ABdev_menu_toggle').css('display') != 'none' && $sf.hasClass('sf-js-enabled')) {
525            // smaller screen, disable SuperFish
526            $sf.superfish('destroy');
527            $menu_responsive.hide();
528            $menu_responsive.find('.sf-mega').css('marginLeft','0');
529        }
530    });
531    
532
533});

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.