PageSourceSearch

https://lighthouse-foundation.org/frontend/js/projectfinder.1769185015.js

js lighthouse-foundation.org collected 2026-10-02 10:05:59 UTC 7,044 bytes, 198 lines download raw bytes

1var earth = null;
2var oToResizeProjectSearchArticles = null;
3
4
5function loadMarkers() {
6    resizeProjectSearchArticle();
7
8    if (earth) {
9        for (var i in earth.markers) {
10            earth.markers[i].removeFrom(earth);
11        }
12        earth.markers = [];
13
14        $('div.marker-position[data-longitude]').each(function(){
15            $this = $(this);
16            var long = $(this).data('longitude');
17            var lat = $(this).data('latitude');
18            var marker = WE.marker([long, lat], '/frontend/img/earth-marker.png').addTo(earth);
19            var label = $this.find('h2').html();
20            var a = $this.find('a');
21            marker.bindPopup('<a href="' + a.attr('href') + '">' + label + '</a>', {maxWidth: 300, closeButton: true});
22            earth.markers.push(marker);
23        });
24    }
25}
26
27
28function initProjectfinder() {
29    $('footer').appendTo($('#content'));
30    $('#project-search-timescale').removeClass('js-only');
31    jQuery('#display-start').appendTo($('.min-slider-handle'));
32    jQuery('#display-end').appendTo($('.max-slider-handle'));
33    
34    resizeProjectSearchArticle(); //vor Initialisierung von Earth, falls diese fehlschlägt
35    
36
37    jQuery(window).resize(function () {
38        clearTimeout(oToResizeProjectSearchArticles);
39        oToResizeProjectSearchArticles = setTimeout(resizeProjectSearchArticle, 100);
40    });
41    
42    var $form = jQuery('#project-search-form');
43
44    $form.on('submitFormSuccessful', function(event, html){
45        $body = $(html.replace(/^[\s\S]*<body.*?>|<\/body>[\s\S]*$/ig, '')).children();
46        $('#projectsearch-results').html($body.find('#projectsearch-results').html());
47        $form.find("input, select").prop('disabled', false);
48        loadMarkers();
49        $('#projectsearch .circular-progress').fadeOut(950);
50    });
51
52    var nSubmitTimeout = 1000;
53    var oSubmitTimeout = null;
54    var fnSubmitTimeout = function(){
55        clearTimeout (oSubmitTimeout);
56        $form.submit();
57    };
58
59    $form.find("input, select").on('change', function(){
60        clearTimeout (oSubmitTimeout);
61        oSubmitTimeout = setTimeout (fnSubmitTimeout, nSubmitTimeout);
62        $('#projectsearch .circular-progress').fadeIn(950);
63    });
64
65
66    var oProjectTimerangeSlider = new Slider('#project-timerange input', {
67        tooltip: 'hide',
68    });
69
70    oProjectTimerangeSlider.on('change', function(event) {
71        clearTimeout (oSubmitTimeout);
72        oSubmitTimeout = setTimeout (fnSubmitTimeout, nSubmitTimeout);
73        $('#projectsearch .circular-progress').fadeIn(950);
74
75        if ((event.newValue[1] - event.newValue[0]) <= 3 && (event.newValue[1] - event.newValue[0]) > 0 && $(window).innerWidth() < 560) {
76            $('#display-end').css('margin-left', '75%');
77            $('#display-start').css('margin-left', '-85%');
78        }
79        else {
80            $('#display-end').css('margin-left', '');
81            $('#display-start').css('margin-left', '');
82        }
83
84        jQuery('#display-start').appendTo($('.min-slider-handle'));
85        jQuery('#display-end').appendTo($('.max-slider-handle'));
86        jQuery('#display-start').text(event.newValue[0])
87        jQuery('#display-end').text(event.newValue[1])
88    });
89
90
91    checkTimerangeHandler();
92    
93    jQuery('#display-start').appendTo($('.min-slider-handle'));
94    jQuery('#display-end').appendTo($('.max-slider-handle'));
95
96
97    var options = {atmosphere: false, center: [0, 0], zoom: 1.5, zooming: false};
98    earth = new WE.map('earth-wrapper', options);
99    earth.markers = [];
100    WE.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',{
101        attribution: '© OpenStreetMap contributors'
102    }).addTo(earth);
103
104
105    // Rotation earth
106    var before = null;
107    requestAnimationFrame(function animate(now) {
108        var c = earth.getPosition();
109        var elapsed = before? now - before: 0;
110        before = now;
111        earth.setCenter([c[0], c[1] - 0.25*(elapsed/30)]);
112        requestAnimationFrame(animate);
113    });
114
115
116    loadMarkers();
117    
118    $('span.cesium-credit-textContainer').parents().first().appendTo('#projectsearch-right-wrapper');
119    $('span.cesium-credit-textContainer').parents().first().css('right', '0');
120    $('span.cesium-credit-textContainer').parents().first().css('bottom', '0');
121    
122
123}
124
125function checkTimerangeHandler() {
126    if (($('#project-timerange .max-slider-handle').attr('aria-valuenow') - $('#project-timerange .min-slider-handle').attr('aria-valuenow')) <= 3 && ($('#project-timerange .max-slider-handle').attr('aria-valuenow') - $('#project-timerange .min-slider-handle').attr('aria-valuenow')) > 0 && $(window).innerWidth() < 560) {
127            $('#display-end').css('margin-left', '75%');
128            $('#display-start').css('margin-left', '-85%');
129    }
130    else {
131        $('#display-end').css('margin-left', '');
132        $('#display-start').css('margin-left', '');
133    }
134}
135
136function resizeProjectSearchArticle() {
137    clearTimeout(oToResizeProjectSearchArticles);
138
139    var articleWidth;
140    var oneEm = parseFloat($('body').css('font-size'));
141    
142    articleWidthOriginal = $('#projectsearch-results article').first().width();
143    articleWidth = 0;
144    
145    $('#projectsearch-results article').each(function (index) {
146       articleWidth = articleWidthOriginal;
147       $(this).css('height', articleWidth);
148        articleWidth -= oneEm; 
149       $(this).find('img').css('height', articleWidth);
150    });
151    
152    var earthWidth;
153    
154    if (earth) {
155        //auf Standard zurücksetzen
156        earth.setZoom(1.5);
157        $('#earth-wrapper').css('position', 'relative');
158        $('#earth-wrapper').css('top', '');
159        $('#earth-wrapper').css('overflow', 'hidden');
160        $('#earth-wrapper canvas').css('width', '');
161        $('#earth-wrapper canvas').css('height', '');
162        
163        earthWidth = Math.round($('#earth-wrapper').width());
164        $('#earth-wrapper canvas').attr('width', earthWidth);
165        earthWidth = Math.round(earthWidth/2);
166        $('#earth-wrapper canvas').attr('height', earthWidth);
167
168        //Einstellungen nach Bildschirmbreite
169        if ($(window).innerWidth() >= 1140 && $(window).innerWidth() < 1440) {
170            earth.setZoom(1.35);
171            $('#earth-wrapper').css('position', 'absolute');
172            $('#earth-wrapper').css('top', '5%');
173            $('#earth-wrapper').css('overflow', 'visible');
174        }
175
176        if ($(window).innerWidth() >= 747 && $(window).innerWidth() < 1140) {
177            earth.setZoom(1);
178            $('#earth-wrapper').css('position', 'absolute');
179            $('#earth-wrapper').css('top', '10%');
180            $('#earth-wrapper').css('overflow', 'visible');
181        }
182
183        if ($(window).innerWidth() >= 560 && $(window).innerWidth() < 747) {
184            earth.setZoom(1.45);
185            $('#earth-wrapper').css('overflow', 'visible');
186        }
187
188        if ($(window).innerWidth() < 560) {
189            earth.setZoom(1);
190            $('#earth-wrapper').css('overflow', 'visible');
191        }
192    }
193    
194    checkTimerangeHandler();
195    
196}
197
198

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.