Вход Регистрация
Файл: CloudBox-main/CloudBox/admin_assets/js/jquery.simpleWeather.min.js
Строк: 204
<?php
/*
 * simpleWeather
 * http://simpleweatherjs.com
 *
 * A simple jQuery plugin to display current weather data
 * for any location and doesn't get in your way.
 *
 * Developed by James Fleeting <@fleetingftw> <http://iwasasuperhero.com>
 * Another project from monkeeCreate <http://monkeecreate.com>
 *
 * Version 2.7.0 - Last updated: April 17 2014
 */
!function (e) {
    
"use strict";
    
e.extend({simpleWeather: function (t) {
        
e.extend({location""woeid"2357536"unit"f"success: function () {
        }, 
error: function () {
        }}, 
t);
        var 
= new Date"//query.yahooapis.com/v1/public/yql?format=json&rnd=" o.getFullYear() + o.getMonth() + o.getDay() + o.getHours() + "&diagnostics=true&callback=?&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&q=";
        if (
"" !== t.location)+= 'select * from weather.forecast where woeid in (select woeid from geo.placefinder where text="' t.location '" and gflags="R") and u="' t.unit '"'; else {
            if (
"" === t.woeid)return t.error("Could not retrieve weather due to an invalid location."), !1;
            
+= "select * from weather.forecast where woeid=" t.woeid ' and u="' t.unit '"'
        
}
        return 
e.getJSON(encodeURI(i), function (o) {
            
null !== && null !== o.query && null !== o.query.results && "Yahoo! Weather Error" !== o.query.results.channel.description e.each(o.query.results, function (eo) {
                -
!== o.constructor.toString().indexOf("Array") && (o[0]);
                var 
i= [], = [], = ["N""NNE""NE""ENE""E""ESE""SE""SSE""S""SSW""SW""WSW""W""WNW""NW""NNW""N"], s[Math.round(o.wind.direction 22.5)];
                
o.item.condition.temp 80 && o.atmosphere.humidity 40 ? -42.379 2.04901523 o.item.condition.temp 10.14333127 o.atmosphere.humidity .22475541 o.item.condition.temp o.atmosphere.humidity 6.83783 Math.pow(10, -3) * Math.pow(o.item.condition.temp2) - 5.481717 Math.pow(10, -2) * Math.pow(o.atmosphere.humidity2) + 1.22874 Math.pow(10, -3) * Math.pow(o.item.condition.temp2) * o.atmosphere.humidity 8.5282 Math.pow(10, -4) * o.item.condition.temp Math.pow(o.atmosphere.humidity2) - 1.99 Math.pow(10, -6) * Math.pow(o.item.condition.temp2) * Math.pow(o.atmosphere.humidity2) : o.item.condition.temp"f" === t.unit ? (a.unit "c"a.temp Math.round(* (o.item.condition.temp 32)), a.high Math.round(* (o.item.forecast[0].high 32)), a.low Math.round(* (o.item.forecast[0].low 32)), a.forecastOneHigh Math.round(* (o.item.forecast[1].high 32)), a.forecastOneLow Math.round(* (o.item.forecast[1].low 32)), a.forecastTwoHigh Math.round(* (o.item.forecast[2].high 32)), a.forecastTwoLow Math.round(* (o.item.forecast[2].low 32)), a.forecastThreeHigh Math.round(* (o.item.forecast[3].high 32)), a.forecastThreeLow Math.round(* (o.item.forecast[3].low 32)), a.forecastFourHigh Math.round(* (o.item.forecast[4].high 32)), a.forecastFourLow Math.round(* (o.item.forecast[4].low 32))) : (a.unit "f"a.temp Math.round(1.8 o.item.condition.temp 32), a.high Math.round(1.8 o.item.forecast[0].high 32), a.low Math.round(1.8 o.item.forecast[0].low 32), a.forecastOneHigh Math.round(1.8 * (o.item.forecast[1].high 32)), a.forecastOneLow Math.round(1.8 * (o.item.forecast[1].low 32)), a.forecastTwoHigh Math.round(1.8 * (o.item.forecast[2].high 32)), a.forecastTwoLow Math.round(1.8 * (o.item.forecast[2].low 32)), a.forecastThreeHigh Math.round(1.8 * (o.item.forecast[3].high 32)), a.forecastThreeLow Math.round(1.8 * (o.item.forecast[3].low 32)), a.forecastFourHigh Math.round(1.8 * (o.item.forecast[4].high 32)), a.forecastFourLow Math.round(1.8 * (o.item.forecast[4].low 32))), "3200" == o.item.condition.code ? (r.thumbnail "//s.yimg.com/os/mit/media/m/weather/images/icons/l/44d-100567.png"r.image "//s.yimg.com/os/mit/media/m/weather/images/icons/l/44d-100567.png") : (r.thumbnail "//l.yimg.com/a/i/us/nws/weather/gr/" o.item.condition.code "ds.png"r.image "//l.yimg.com/a/i/us/nws/weather/gr/" o.item.condition.code "d.png"), r.forecastOne "3200" == o.item.forecast[1].code "//s.yimg.com/os/mit/media/m/weather/images/icons/l/44d-100567.png" "//l.yimg.com/a/i/us/nws/weather/gr/" o.item.forecast[1].code "d.png"r.forecastTwo "3200" == o.item.forecast[2].code "//s.yimg.com/os/mit/media/m/weather/images/icons/l/44d-100567.png" "//l.yimg.com/a/i/us/nws/weather/gr/" o.item.forecast[2].code "d.png"r.forecastThree "3200" == o.item.forecast[3].code "//s.yimg.com/os/mit/media/m/weather/images/icons/l/44d-100567.png" "//l.yimg.com/a/i/us/nws/weather/gr/" o.item.forecast[3].code "d.png"r.forecastFour "3200" == o.item.forecast[4].code "//s.yimg.com/os/mit/media/m/weather/images/icons/l/44d-100567.png" "//l.yimg.com/a/i/us/nws/weather/gr/" o.item.forecast[4].code "d.png";
                var 
= {titleo.item.titletempo.item.condition.temptempAlta.tempcodeo.item.condition.codetodayCodeo.item.forecast[0].codeunits: {tempo.units.temperaturedistanceo.units.distancepressureo.units.pressurespeedo.units.speedtempAlta.unit}, currentlyo.item.condition.texthigho.item.forecast[0].highhighAlta.highlowo.item.forecast[0].lowlowAlta.lowforecasto.item.forecast[0].textwind: {chillo.wind.chilldirectioncspeedo.wind.speed}, humidityo.atmosphere.humidityheatindexipressureo.atmosphere.pressurerisingo.atmosphere.risingvisibilityo.atmosphere.visibilitysunriseo.astronomy.sunrisesunseto.astronomy.sunsetdescriptiono.item.descriptionthumbnailr.thumbnailimager.imagetomorrow: {higho.item.forecast[1].highhighAlta.forecastOneHighlowo.item.forecast[1].lowlowAlta.forecastOneLowforecasto.item.forecast[1].textcodeo.item.forecast[1].codedateo.item.forecast[1].datedayo.item.forecast[1].dayimager.forecastOne}, forecasts: {one: {higho.item.forecast[1].highhighAlta.forecastOneHighlowo.item.forecast[1].lowlowAlta.forecastOneLowforecasto.item.forecast[1].textcodeo.item.forecast[1].codedateo.item.forecast[1].datedayo.item.forecast[1].dayimager.forecastOne}, two: {higho.item.forecast[2].highhighAlta.forecastTwoHighlowo.item.forecast[2].lowlowAlta.forecastTwoLowforecasto.item.forecast[2].textcodeo.item.forecast[2].codedateo.item.forecast[2].datedayo.item.forecast[2].dayimager.forecastTwo}, three: {higho.item.forecast[3].highhighAlta.forecastThreeHighlowo.item.forecast[3].lowlowAlta.forecastThreeLowforecasto.item.forecast[3].textcodeo.item.forecast[3].codedateo.item.forecast[3].datedayo.item.forecast[3].dayimager.forecastThree}, four: {higho.item.forecast[4].highhighAlta.forecastFourHighlowo.item.forecast[4].lowlowAlta.forecastFourLowforecasto.item.forecast[4].textcodeo.item.forecast[4].codedateo.item.forecast[4].datedayo.item.forecast[4].dayimager.forecastFour}}, cityo.location.citycountryo.location.countryregiono.location.regionupdatedo.item.pubDatelinko.item.link};
                
t.success(m)
            }) : 
t.error(null === o.query.results "An invalid WOEID or location was provided." "There was an error retrieving the latest weather information. Please try again.")
        }), 
this
    
}})
}(
jQuery);
?>
Онлайн: 3
Реклама