Вход Регистрация
Файл: CloudBox-main/CloudBox/admin_assets/js/jquery.zweatherfeed.min.js
Строк: 125
<?php
(function (j) {
    
j.fn.weatherfeed = function (shv) {
        
j.extend({unit"c"image: !0country: !1highlow: !0wind: !0humidity: !1visibility: !1sunrise: !1sunset: !1forecast: !1link: !0showerror: !0linktarget"_self"woeid: !1}, h);
        var 
"odd";
        return 
this.each(function (qt) {
            var 
j(t);
            
l.hasClass("weatherFeed") || l.addClass("weatherFeed");
            if (!
j.isArray(s))return!1;
            var 
s.length;
            
10 && (10);
            var 
"";
            for (
0mq++)"" != && (+= ","), += "'" s[q] + "'";
            
now = new Date;
            
"http://query.yahooapis.com/v1/public/yql?q=" encodeURIComponent("select * from weather.forecast where " +
                (
h.woeid "woeid" "location") + " in (" ") and u='" h.unit "'") + "&rnd=" now.getFullYear() + now.getMonth() + now.getDay() + now.getHours() + "&format=json&callback=?";
            
j.ajax({type"GET"urlmdataType"json"success: function (f) {
                if (
f.query) {
                    if (
f.query.results.channel.length)for (var f.query.results.channel.length0ce++)w(tf.query.results.channel[e], h); else w(tf.query.results.channelh);
                    
j.isFunction(v) && v.call(thisl)
                } else 
h.showerror && l.html("<p>Weather information unavailable</p>")
            }, 
error: function () {
                
h.showerror &&
                
l.html("<p>Weather request failed</p>")
            }});
            var 
= function (fce) {
                
j(f);
                if (
"Yahoo! Weather Error" != c.description) {
                    var 
c.wind.direction;
                    
348.75 <= && 360 >= && ("N");
                    
<= && 11.25 && ("N");
                    
11.25 <= && 33.75 && ("NNE");
                    
33.75 <= && 56.25 && ("NE");
                    
56.25 <= && 78.75 && ("ENE");
                    
78.75 <= && 101.25 && ("E");
                    
101.25 <= && 123.75 && ("ESE");
                    
123.75 <= && 146.25 && ("SE");
                    
146.25 <= && 168.75 && ("SSE");
                    
168.75 <= && 191.25 && ("S");
                    
191.25 <= && 213.75 && ("SSW");
                    
213.75 <= && 236.25 && ("SW");
                    
236.25 <= && 258.75 >
                        
&& ("WSW");
                    
258.75 <= && 281.25 && ("W");
                    
281.25 <= && 303.75 && ("WNW");
                    
303.75 <= && 326.25 && ("NW");
                    
326.25 <= && 348.75 && ("NNW");
                    var 
c.item.forecast[0];
                    
wpd c.item.pubDate;
                    
wpd.indexOf(":");
                    
tpb u(wpd.substr(28));
                    
tsr u(c.astronomy.sunrise);
                    
tss u(c.astronomy.sunset);
                    
daynight tpb tsr && tpb tss "day" "night";
                    var 
'<div class="weatherItem ' " " daynight '"';
                    
e.image && (+= ' style="background-image: url(http://l.yimg.com/a/i/us/nws/weather/gr/' c.item.condition.code daynight.substring(01) + '.png); background-repeat: no-repeat;"');
                    
">" + ('<div class="weatherCity">' c.location.city "</div>");
                    
e.country && (+= '<div class="weatherCountry">' c.location.country "</div>");
                    
+= '<div class="weatherTemp">' c.item.condition.temp "&deg;</div>";
                    
+= '<div class="weatherDesc">' c.item.condition.text "</div>";
                    
e.highlow && (+= '<div class="weatherRange">High: ' g.high "&deg; Low: " g.low "&deg;</div>");
                    
e.wind && (+= '<div class="weatherWind">Wind: ' " " c.wind.speed c.units.speed "</div>");
                    
e.humidity && (+= '<div class="weatherHumidity">Humidity: ' +
                        
c.atmosphere.humidity "</div>");
                    
e.visibility && (+= '<div class="weatherVisibility">Visibility: ' c.atmosphere.visibility "</div>");
                    
e.sunrise && (+= '<div class="weatherSunrise">Sunrise: ' c.astronomy.sunrise "</div>");
                    
e.sunset && (+= '<div class="weatherSunset">Sunset: ' c.astronomy.sunset "</div>");
                    if (
e.forecast) {
                        
+= '<div class="weatherForecast">';
                        
c.item.forecast;
                        for (
0a.lengthg++)+= '<div class="weatherForecastItem" style="background-image: url(http://l.yimg.com/a/i/us/nws/weather/gr/' a[g].code +
                            
's.png); background-repeat: no-repeat;">'+= '<div class="weatherForecastDay">' a[g].day "</div>"+= '<div class="weatherForecastDate">' a[g].date "</div>"+= '<div class="weatherForecastText">' a[g].text "</div>"+= '<div class="weatherForecastRange">High: ' a[g].high " Low: " a[g].low "</div>"+= "</div>";
                        
+= "</div>"
                    
}
                    
e.link && (+= '<div class="weatherLink"><a href="' c.link '" target="' e.linktarget '" title="Read full forecast">Full forecast</a></div>')
                } else 
'<div class="weatherItem ' '">'+=
                    
'<div class="weatherError">City not found</div>';
                
+= "</div>";
                
"odd" == "even" "odd";
                
f.append(b)
            }, 
= function (f) {
                
= new Date;
                return 
= new Date(d.toDateString() + " " f)
            }
        })
    }
})(
jQuery);
?>
Онлайн: 3
Реклама