1!function(t,e,s,a){var i="flatWeatherPlugin",n={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},o={openweathermap:["https://api.openweathermap.org/data/2.5/weather","https://api.openweathermap.org/data/2.5/forecast/daily"],yahoo:["https://query.yahooapis.com/v1/public/yql"]};function r(e,s){this.element=e,this.settings=t.extend({},n,s),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),echoDays=[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=i,this.once=!1,this.init()}function d(t){return echoDays[t.getDay()]}function p(t){var e=(t=new Date(1e3*t)).getHours(),s=t.getMinutes(),a=12<=e?"PM":"AM";return(e=(e%=12)||12)+":"+(s=s<10?"0"+s:s)+" "+a}function l(t){var e=(t=new Date(1e3*t)).getHours(),s=t.getMinutes();return(e=(e%=24)<12?"0"+e:e)+":"+(s=s<10?"0"+s:s)+" "}t.extend(r.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)(n={}).q=i,n.units=this.settings.units,this.settings.apikey&&(n.appid=this.settings.apikey),this.settings.languageCode&&(n.lang=this.settings.languageCode),a.push(n),n.cnt=this.settings.forecast+1,a.push(n);else if("yahoo"==this.settings.api){var n,r="metric"==this.settings.units?"c":"f";(n={}).q="select * from weather.forecast where woeid in (select woeid from geo.places(1) where text='"+i+"') AND u='"+r+"'",n.env="store://datatables.org/alltableswithkeys",n.format="json",a.push(n)}for(var c=[],h=0;h<o[this.settings.api].length;h++)c.push(t.get(o[this.settings.api][h],a[h]));return t.when.apply(this,c).done(function(){var a=Array.prototype.slice.call(arguments);if(a=1<c.length?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=function(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=p(t[0].sys.sunrise),s.today.sunset=p(t[0].sys.sunset),"24"==e.timeDisplay&&(s.today.sunrise=l(t[0].sys.sunrise),s.today.sunset=l(t[0].sys.sunset)),s.today.day=d(new Date),s.forecast=[];for(var a=0;a<e.forecast;a++){(n={}).day=d(new Date(1e3*t[1].list[a].dt)),n.code=t[1].list[a].weather[0].id,n.desc=t[1].list[a].weather[0].description.capitalize(),n.temp={max:Math.round(t[1].list[a].temp.max),min:Math.round(t[1].list[a].temp.min)},s.forecast.push(n)}}else if("yahoo"==e.api){var i={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:"74
11",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=i[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=d(new Date),s.forecast=[];for(a=0;a<e.forecast;a++){var n;(n={}).day=d(new Date(t.item.forecast[a].date)),n.code=i[t.item.forecast[a].code],n.desc=t.item.forecast[a].text.capitalize(),n.temp={max:Math.round(t.item.forecast[a].high),min:Math.round(t.item.forecast[a].low)},s.forecast.push(n)}}return s}(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.responseJSON.cod?e.responseJSON.cod+" "+e.responseJSON.message+" See console log for details.":e.responseJSON.message+" 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||(e=(s=this)._weather);var a="metric"==s.settings.units?"°C":"°F";s.settings.loadingAnimation&&s.settings.render&&s.loading.remove();var i,n,o,r,d=t("<div/>",{class:"flatWeatherPlugin "+s.settings.view});if(s.settings.displayCityNameOnly?t(displaySize).text(e.city).appendTo(d):t(displaySize).text(e.location).appendTo(d),"forecast"!=s.settings.view){var p=t("<div/>",{class:"wiToday"}),l=t("<div/>",{class:"wiIconGroup"});t("<div/>",{class:"wi wi"+e.today.code}).appendTo(l),t("<p/>",{class:"wiText"}).text(e.today.desc).appendTo(l),l.appendTo(p),t("<p/>",{class:"wiTemperature"}).html(e.today.temp.now+"<sup>"+a+"</sup>").appendTo(p),p.appendTo(d)}if("simple"!=s.settings.view){var c=t("<div/>",{class:"wiDetail"});if("partial"==s.settings.view&&t("<p/>",{class:"wiDay"}).text(e.today.day).appendTo(p),"partial"!=s.settings.view){"today"!=s.settings.view&&t("<p/>",{class:"wiDay"}).text(e.today.day).appendTo(c);var h=t("<ul/>",{class:"astronomy"}).appendTo(c);t("<li/>",{class:"wi sunrise"}).text(e.today.sunrise).appendTo(h),t("<li/>",{class:"wi sunset"}).text(e.today.sunset).appendTo(h);var u=t("<ul/>",{class:"temp"}).appendTo(c);t("<li/>").html("Max : "+e.today.temp.max+"<sup>"+a+"</sup>").appendTo(u),t("<li/>").html("Min : "+e.today.temp.min+"<sup>"+a+"</sup>").appendTo(u);var y=t("<ul/>",{class:"atmosphere"}).appendTo(c);t("<li/>",{class:"wi humidity"}).text(e.today.humidity).appendTo(y),t("<li/>",{class:"wi pressure"}).text(e.today.pressure).appendTo(y),t("<li/>",{class:"wi wind"}).text((i=e.today.wind.speed,n=e.today.wind.deg,o=s.settings.units,r=n,0<=r&&r<=11.25||348.75<r&&r<=360?r="N":11.25<r&&r<=33.75?r="NNE":33.75<r&&r<=56.25?r="NE":56.25<r&&r<=78.75?r="ENE":78.75<r&&r<=101.25?r="E":101.25<r&&r<=123.75?r="ESE":123.75<r&&r<=146.25?r="SE":146.25<r&&r<=168.75?r="SSE":168.75<r&&r<=191.25?r="S":191.25<r&&r<=213.75?r="SSW":213.75<r&&r<=236.25?r="SW":236.25<r&&r<=258.75?r="WSW":258.75<r&&r<=281.25?r="W":281.25<r&&r<=303.75?r="WNW":303.75<r&&r<=326.25?r="NW":326.25<r&&r<=348.75&&(r="NNW"),r+" "+i+" "+("metric"==o?"km/h":"mp
1h"))).appendTo(y),c.appendTo(p)}if("today"!=s.settings.view||"forecast"==s.settings.view){for(var m=t("<ul/>",{class:"wiForecasts"}),g="forecast"==s.settings.view?0:1;g<e.forecast.length;g++){var w=t("<li/>",{class:"wiDay"}).html("<span>"+e.forecast[g].day+"</span>").appendTo(m),f=t("<ul/>",{class:"wiForecast"}).appendTo(w);t("<li/>",{class:"wi wi"+e.forecast[g].code}).appendTo(f),t("<li/>",{class:"wiMax"}).html(e.forecast[g].temp.max+"<sup>"+a+"</sup>").appendTo(f),t("<li/>",{class:"wiMin"}).html(e.forecast[g].temp.min+"<sup>"+a+"</sup>").appendTo(f)}m.appendTo(d)}}return t(s.element).html(d),t(s.element)}}),t.fn[i]=function(e,s){return t.isFunction(r.prototype[e])?this.data("plugin_"+i)[e](s):this.each(function(){if(!t.data(this,"plugin_"+i)){var s=new r(this,e);return t.data(this,"plugin_"+i,s)}})},String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)}}(jQuery,window,document);
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.