HEX
Server: Apache
System: Linux webm010.cluster103.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: iestorre (46869)
PHP: 8.0.30
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/iestorre/informatica/modules/mod_weatheraholic/js/jquery.flatWeatherPlugin.min.js
!function(t,e,s,a){function i(s,a){this.element=s,this.settings=t.extend({},c,a),this.settings.units&&"auto"!=this.settings.units||(this.settings.units=-1==["united states","usa","united states of america","us"].indexOf(this.settings.country.toLowerCase())?"metric":"imperial"),this.settings.forecast=Math.min(this.settings.forecast,5),e["echoDays"+this.settings.module]=[this.settings.sunday,this.settings.monday,this.settings.tuesday,this.settings.wednesday,this.settings.thursday,this.settings.friday,this.settings.saturday],displaySize=this.settings.locationSize,this._name=l,this.once=!1,this.init()}function n(t,e){var s={};if("openweathermap"==e.api){""!=t[0].name?(s.location=t[0].name+e.state+" - "+t[0].sys.country,s.city=t[0].name+e.state):""!=t[1].city.name?(s.location=t[1].city.name+e.state+", "+t[1].city.country,s.city=t[1].city.name+e.state):(s.location=e.location+e.state+", "+e.country,s.city=e.location+e.state),s.today={},s.today.temp={},s.today.temp.now=Math.round(t[0].main.temp),s.today.temp.min=Math.round(t[0].main.temp_min),s.today.temp.max=Math.round(t[0].main.temp_max),s.today.desc=t[0].weather[0].description.capitalize(),s.today.code=t[0].weather[0].id,s.today.wind=t[0].wind,s.today.humidity=t[0].main.humidity,s.today.pressure=t[0].main.pressure,s.today.sunrise=r(t[0].sys.sunrise),s.today.sunset=r(t[0].sys.sunset),"24"==e.timeDisplay&&(s.today.sunrise=d(t[0].sys.sunrise),s.today.sunset=d(t[0].sys.sunset)),s.today.day=o(new Date,e.module),s.forecast=[];for(var a=0;a<e.forecast;a++){var i={};i.day=o(new Date(1e3*t[1].list[a].dt),e.module),i.code=t[1].list[a].weather[0].id,i.desc=t[1].list[a].weather[0].description.capitalize(),i.temp={max:Math.round(t[1].list[a].temp.max),min:Math.round(t[1].list[a].temp.min)},s.forecast.push(i)}}else if("yahoo"==e.api){var n={0:"900",1:"901",2:"902",3:"212",4:"200",5:"616",6:"612",7:"611",8:"511",9:"301",10:"511",11:"521",12:"521",13:"600",14:"615",15:"601",16:"601",17:"906",18:"611",19:"761",20:"741",21:"721",22:"711",23:"956",24:"954",25:"903",26:"802",27:"802",28:"802",29:"802",30:"802",31:"800",32:"800",33:"951",34:"951",35:"906",36:"904",37:"210",38:"210",39:"210",40:"521",41:"602",42:"621",43:"602",44:"802",45:"201",46:"621",47:"210",3200:"951"};t=t.query.results.channel,s.location=t.location.city+e.state+" - "+t.location.country,s.city=t.location.city+e.state,s.today={},s.today.temp={},s.today.temp.now=Math.round(t.item.condition.temp),s.today.temp.min=Math.round(t.item.forecast[0].low),s.today.temp.max=Math.round(t.item.forecast[0].high),s.today.desc=t.item.condition.text.capitalize(),s.today.code=n[t.item.condition.code],s.today.wind={},s.today.wind.speed=t.wind.speed,s.today.wind.deg=t.wind.direction,s.today.humidity=t.atmosphere.humidity,s.today.pressure=t.atmosphere.pressure,"12"==e.timeDisplay&&(s.today.sunrise=t.astronomy.sunrise.toUpperCase(),s.today.sunset=t.astronomy.sunset.toUpperCase()),"24"==e.timeDisplay&&(s.today.sunrise=0+t.astronomy.sunrise.match(/\d+/)[0]+t.astronomy.sunrise.match(/:\d+/)[0],s.today.sunset=parseInt(t.astronomy.sunset.match(/\d+/)[0])+12+t.astronomy.sunset.match(/:\d+/)[0]),s.today.day=o(new Date,e.module),s.forecast=[];for(var a=0;a<e.forecast;a++){var i={};i.day=o(new Date(t.item.forecast[a].date),e.module),i.code=n[t.item.forecast[a].code],i.desc=t.item.forecast[a].text.capitalize(),i.temp={max:Math.round(t.item.forecast[a].high),min:Math.round(t.item.forecast[a].low)},s.forecast.push(i)}}return s}function o(t,s){return console.log(s),e["echoDays"+s][t.getDay()]}function r(t){t=new Date(1e3*t);var e=t.getHours(),s=t.getMinutes(),a=e>=12?"PM":"AM";e%=12,e=e?e:12,s=10>s?"0"+s:s;var i=e+":"+s+" "+a;return i}function d(t){t=new Date(1e3*t);var e=t.getHours(),s=t.getMinutes(),a="";e%=24,e=12>e?"0"+e:e,s=10>s?"0"+s:s;var i=e+":"+s+" "+a;return i}function p(t,e,s){var a=e;a>=0&&11.25>=a||a>348.75&&360>=a?a="N":a>11.25&&33.75>=a?a="NNE":a>33.75&&56.25>=a?a="NE":a>56.25&&78.75>=a?a="ENE":a>78.75&&101.25>=a?a="E":a>101.25&&123.75>=a?a="ESE":a>123.75&&146.25>=a?a="SE":a>146.25&&168.75>=a?a="SSE":a>168.75&&191.25>=a?a="S":a>191.25&&213.75>=a?a="SSW":a>213.75&&236.25>=a?a="SW":a>236.25&&258.75>=a?a="WSW":a>258.75&&281.25>=a?a="W":a>281.25&&303.75>=a?a="WNW":a>303.75&&326.25>=a?a="NW":a>326.25&&348.75>=a&&(a="NNW");var i="metric"==s?"km/h":"mph";return a+" "+t+" "+i}var l="flatWeatherPlugin",c={module:1,location:"Waterloo, ON",state:" ",country:"Canada",locationSize:"<h2/>",sunday:"Sunday",monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday",displayCityNameOnly:!1,timeDisplay:"12",api:"openweathermap",forecast:5,apikey:"",languageCode:"en",view:"full",render:!0,loadingAnimation:!0},u={openweathermap:["http://api.openweathermap.org/data/2.5/weather","http://api.openweathermap.org/data/2.5/forecast/daily"],yahoo:["https://query.yahooapis.com/v1/public/yql"]};t.extend(i.prototype,{init:function(){this.settings.render&&(this.settings.loadingAnimation&&!this.once&&(this.loading=t("<div/>",{id:"flatWeatherLoading","class":"wi loading"}),this.loading.appendTo(this.element)),this.fetchWeather().then(this.render,this.error)),this.once=!0},fetchWeather:function(){var e=this,s=new t.Deferred,a=[],i=this.settings.location+" "+this.settings.country;if("openweathermap"==this.settings.api){var o={};o.q=i,o.units=this.settings.units,this.settings.apikey&&(o.appid=this.settings.apikey),this.settings.languageCode&&(o.lang=this.settings.languageCode),a.push(o),o.cnt=this.settings.forecast+1,a.push(o)}else if("yahoo"==this.settings.api){var r="metric"==this.settings.units?"c":"f",o={};o.q="select * from weather.forecast where woeid in (select woeid from geo.places(1) where text='"+i+"') AND u='"+r+"'",o.env="store://datatables.org/alltableswithkeys",o.format="json",a.push(o)}for(var d=[],p=0;p<u[this.settings.api].length;p++)d.push(t.get(u[this.settings.api][p],a[p]));return t.when.apply(this,d).done(function(){var a=Array.prototype.slice.call(arguments);if(a=d.length>1?a.map(function(t){return t[0]}):a[0],"openweathermap"!=e.settings.api||"200"==a[0].cod&&"200"==a[1].cod)if("yahoo"!=e.settings.api||0!=a.query.count&&"Yahoo! Weather Error"!=a.query.results.channel.description){var i=n(a,e.settings);e._weather=i,t.data(e.element,"weather",i),s.resolve(i,e)}else console.log("Error interacting with the yahoo api see error object below for details:"),console.log(a),s.reject(a,e);else console.log("Error interacting with the openweathermap api see error object below for details:"),console.log(a),s.reject(a,e)}).fail(function(t){console.log("fail"),s.reject(t,e)}),s},error:function(e,s){s||(s=this),s.settings.loadingAnimation&&s.settings.render&&s.loading.remove(),"openweathermap"==s.settings.api?e="200"!=e[0].cod?e[0].cod+" "+e[0].message+". See console log for details.":e[1]+" See console log for details.":"yahoo"==s.settings.api&&(e=e.query.results?"Error: "+e.query.results.channel.item.title+". See console log for details.":"Error: no results. See console log for details.");var a=t("<div/>",{"class":"flatWeatherPlugin "+s.settings.view});return t("<h2/>").text("Error").appendTo(a),t("<p/>").text(e).appendTo(a),t(s.element).html(a),t(s.element)},render:function(e,s){s||(s=this,e=this._weather);var a="metric"==s.settings.units?"&#176;C":"&#176;F";s.settings.loadingAnimation&&s.settings.render&&s.loading.remove();var i=t("<div/>",{"class":"flatWeatherPlugin "+s.settings.view});if(s.settings.displayCityNameOnly?t(displaySize).text(e.city).appendTo(i):t(displaySize).text(e.location).appendTo(i),"forecast"!=s.settings.view){var n=t("<div/>",{"class":"wiToday"}),o=t("<div/>",{"class":"wiIconGroup"});t("<div/>",{"class":"wi wi"+e.today.code}).appendTo(o),t("<p/>",{"class":"wiText"}).text(e.today.desc).appendTo(o),o.appendTo(n),t("<p/>",{"class":"wiTemperature"}).html(e.today.temp.now+"<sup>"+a+"</sup>").appendTo(n),n.appendTo(i)}if("simple"!=s.settings.view){var r=t("<div/>",{"class":"wiDetail"});if("partial"==s.settings.view&&t("<p/>",{"class":"wiDay"}).text(e.today.day).appendTo(n),"partial"!=s.settings.view){"today"!=s.settings.view&&t("<p/>",{"class":"wiDay"}).text(e.today.day).appendTo(r);var d=t("<ul/>",{"class":"astronomy"}).appendTo(r);t("<li/>",{"class":"wi sunrise"}).text(e.today.sunrise).appendTo(d),t("<li/>",{"class":"wi sunset"}).text(e.today.sunset).appendTo(d);var l=t("<ul/>",{"class":"temp"}).appendTo(r);t("<li/>").html("Max : "+e.today.temp.max+"<sup>"+a+"</sup>").appendTo(l),t("<li/>").html("Min : "+e.today.temp.min+"<sup>"+a+"</sup>").appendTo(l);var c=t("<ul/>",{"class":"atmosphere"}).appendTo(r);t("<li/>",{"class":"wi humidity"}).text(e.today.humidity).appendTo(c),t("<li/>",{"class":"wi pressure"}).text(e.today.pressure).appendTo(c),t("<li/>",{"class":"wi wind"}).text(p(e.today.wind.speed,e.today.wind.deg,s.settings.units)).appendTo(c),r.appendTo(n)}if("today"!=s.settings.view||"forecast"==s.settings.view){for(var u=t("<ul/>",{"class":"wiForecasts"}),h="forecast"==s.settings.view?0:1,y=h;y<e.forecast.length;y++){var m=t("<li/>",{"class":"wiDay"}).html("<span>"+e.forecast[y].day+"</span>").appendTo(u),g=t("<ul/>",{"class":"wiForecast"}).appendTo(m);t("<li/>",{"class":"wi wi"+e.forecast[y].code}).appendTo(g),t("<li/>",{"class":"wiMax"}).html(e.forecast[y].temp.max+"<sup>"+a+"</sup>").appendTo(g),t("<li/>",{"class":"wiMin"}).html(e.forecast[y].temp.min+"<sup>"+a+"</sup>").appendTo(g)}u.appendTo(i)}}return t(s.element).html(i),t(s.element)}}),t.fn[l]=function(e,s){return t.isFunction(i.prototype[e])?this.data("plugin_"+l)[e](s):this.each(function(){if(!t.data(this,"plugin_"+l)){var s=new i(this,e);return t.data(this,"plugin_"+l,s)}})},String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)}}(jQuery,window,document);