1$(document).ready(function () { 2 init(); 3}); 4 5function init() { 6 7 var container = $('.weather:not(.loaded)'); 8 $(container).addClass('weather--loaded'); 9 10 $.ajax({ 11 type: "POST", 12 url: "/fileadmin/templates/elements/el-weather/el-weather.php", 13 cache: true, 14 success: function(data) 15 { 16 17 data = jQuery.parseJSON(data); 18 var content = '<div class="weather__forecast">'; 19 20 content += '<div class="weather__labels">\ 21 <div class="weather__label weather__label--weekday"></div>\ 22 <div class="weather__label weather__label--icon">Aussichten</div>\ 23 <div class="weather__label weather__label--temp">°C Tag/Nacht</div>\ 24 <div class="weather__label weather__label--rainfall">Niederschlagsrisiko<br>Vor/Nachmittag (in %)</div>\ 25 <div class="weather__label weather__label--sunhours">Sonnenstunden</div>\ 26 <div class="weather__label weather__label--freezing-level">Nullgradgrenze</div>\ 27 </div>'; 28 29 30 var forecast = data.forecast; 31 content += '<div class="weather__days"><div class="weather__days__wrapper">'; 32 $.each(forecast, function(key, value) { 33 content += '<div class="weather__day weather__day--'+key+'">\ 34 <div class="weather__day__info weather__day__info--weekday">'+readableDate(forecast[key]['@attributes'].date)+'</div>\ 35 <img class="weather__day__info weather__day__info--icon" src="/fileadmin/templates/elements/el-weather/images/'+forecast[key].symbol+'.png">\ 36 <div class="weather__day__info weather__day__info--temp">'+forecast[key]['temp-day']+' / '+forecast[key]['temp-night']+'</div>\ 37 <div class="weather__day__info weather__day__info--rainfall">'+forecast[key]['rainfall-risk-am']+' / '+forecast[key]['rainfall-risk-pm']+'</div>\ 38 <div class="weather__day__info weather__day__info--sunhours">'+forecast[key]['hours-of-sunshine']+'</div>\ 39 <div class="weather__day__info weather__day__info--freezing-level">'+forecast[key]['below-zero-border']+'</div>\ 40 </div>'; 41 }); 42 content += "</div></div></div>" 43 container.append(content); 44 45 container.find('.weather__days').bhSwiper({pagination: 1, slideMinWidth: '100px',spaceBetween: '10px'}); 46 var description = data.description; 47 container.append('<div class="weather__description">'+description+'</div>'); 48 49 } 50 }); 51 52} 53 54 55 56function readableDate(string) { 57 var date = string.split('+'); 58 date = date[0].split('-'); 59 date1 = new Date(); 60 date1.setDate(date[2]); 61 date1.setMonth(date[1]-1); 62 date1.setYear(date[0]); 63 64 var Wochentag = new Array("Sonntag", "Montag", "Dienstag", "Mittwoch","Donnerstag", "Freitag", "Samstag"); 65 return Wochentag[date1.getDay()]; 66}
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.