Skip to content
This repository has been archived by the owner on Jan 23, 2019. It is now read-only.

Commit

Permalink
Added high and low alt temps [#29], added alt temp unit [#33], update…
Browse files Browse the repository at this point in the history
…d plugin url to the new domain, and updated jquery json.
  • Loading branch information
fleeting committed Apr 30, 2013
1 parent 1a8f5bd commit b5c7aaf
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 25 deletions.
6 changes: 3 additions & 3 deletions index.html
Expand Up @@ -57,7 +57,7 @@
<div class="container-narrow">
<div class="jumbotron">
<h1>Whoa, a weather plugin?</h1>
<p>A simple jQuery plugin to display the current weather information for any location using Yahoo! Weather. Developed by <a href="http://twitter.com/twofivethreetwo">James Fleeting</a>. Download the latest version, read the docs or browse the FAQ at <a href="http://simpleweather.monkeecreate.com">simpleweather.monkeecreate.com</a>. Below you will find three examples of using simpleWeather.js.</p>
<p>A simple jQuery plugin to display the current weather information for any location using Yahoo! Weather. Developed by <a href="http://twitter.com/twofivethreetwo">James Fleeting</a>. Download the latest version, read the docs or browse the FAQ at <a href="http://simpleweatherjs.com">simpleweather.js</a>. Below you will find three examples of using simpleWeather.js.</p>

This comment has been minimized.

Copy link
@fleeting

fleeting May 1, 2013

Author Member

Of course I would have a typo.

</div>
<hr>

Expand Down Expand Up @@ -96,9 +96,9 @@ <h2>Fancy Demo</h2>
<hr>
</div>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<script src="http:////cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.2.1/bootstrap.min.js"></script>
<script src="jquery.simpleWeather-2.1.2.min.js"></script>
<script src="jquery.simpleWeather-2.2.min.js"></script>
<script>
$(function() {
$.simpleWeather({
Expand Down
13 changes: 0 additions & 13 deletions jquery.simpleWeather-2.1.2.min.js

This file was deleted.

13 changes: 13 additions & 0 deletions jquery.simpleWeather-2.2.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 19 additions & 4 deletions jquery.simpleWeather.js
@@ -1,14 +1,14 @@
/*
* simpleWeather
* http://simpleweather.monkeecreate.com
* http://simpleweatherjs.com
*
* A simple jQuery plugin to display the current weather
* information for any location using Yahoo! Weather.
*
* Developed by James Fleeting <@twofivethreetwo>
* Developed by James Fleeting <@twofivethreetwo> <http://iwasasuperhero.com>
* Another project from monkeeCreate <http://monkeecreate.com>
*
* Version 2.1.2 - Last updated: January 25 2013
* Version 2.2 - Last updated: April 30 2013
*/
(function($) {
"use strict";
Expand Down Expand Up @@ -66,9 +66,19 @@
}

if(options.unit === "f") {
var unitAlt = "c";
var tempAlt = Math.round((5.0/9.0)*(result.item.condition.temp-32.0));
var highAlt = Math.round((5.0/9.0)*(result.item.forecast[0].high-32.0));
var lowAlt = Math.round((5.0/9.0)*(result.item.forecast[0].low-32.0));
var tomorrowHighAlt = Math.round((5.0/9.0)*(result.item.forecast[1].high-32.0));
var tomorrowLowAlt = Math.round((5.0/9.0)*(result.item.forecast[1].low-32.0));
} else {
var unitAlt = "f";
var tempAlt = Math.round((9.0/5.0)*result.item.condition.temp+32.0);
var highAlt = Math.round((9.0/5.0)*result.item.forecast[0].high+32.0);
var lowAlt = Math.round((9.0/5.0)*result.item.forecast[0].low+32.0);
var tomorrowHighAlt = Math.round((5.0/9.0)*(result.item.forecast[1].high+32.0));
var tomorrowLowAlt = Math.round((5.0/9.0)*(result.item.forecast[1].low+32.0));
}

var weather = {
Expand All @@ -81,11 +91,14 @@
temp: result.units.temperature,
distance: result.units.distance,
pressure: result.units.pressure,
speed: result.units.speed
speed: result.units.speed,
tempAlt: unitAlt
},
currently: result.item.condition.text,
high: result.item.forecast[0].high,
highAlt: highAlt,
low: result.item.forecast[0].low,
lowAlt: lowAlt,
forecast: result.item.forecast[0].text,
wind:{
chill: result.wind.chill,
Expand All @@ -104,7 +117,9 @@
image: "http://l.yimg.com/a/i/us/nws/weather/gr/"+result.item.condition.code+timeOfDay+".png",
tomorrow:{
high: result.item.forecast[1].high,
highAlt: tomorrowHighAlt,
low: result.item.forecast[1].low,
lowAlt: tomorrowLowAlt,
forecast: result.item.forecast[1].text,
code: result.item.forecast[1].code,
date: result.item.forecast[1].date,
Expand Down
10 changes: 5 additions & 5 deletions simpleweather.jquery.json
Expand Up @@ -10,7 +10,7 @@
"monkeecreate",
"weather-data"
],
"version": "2.1.2",
"version": "2.2",
"author": {
"name": "James Fleeting",
"email": "hello@jamesfleeting.com",
Expand All @@ -23,10 +23,10 @@
}
],
"bugs": "https://github.com/monkeecreate/jquery.simpleWeather/issues",
"homepage": "http://simpleweather.monkeecreate.com",
"docs": "http://simpleweather.monkeecreate.com",
"download": "http://simpleweather.monkeecreate.com",
"demo": "http://simpleweather.monkeecreate.com",
"homepage": "http://simpleweather.com",
"docs": "http://simpleweather.com",
"download": "http://simpleweather.com",
"demo": "http://simpleweather.com",
"dependencies": {
"jquery": ">=1.5"
},
Expand Down

0 comments on commit b5c7aaf

Please sign in to comment.