Skip to content

Commit

Permalink
code prettifying
Browse files Browse the repository at this point in the history
  • Loading branch information
martinkadlec0 committed Mar 14, 2012
1 parent 5a7becc commit 59da18a
Show file tree
Hide file tree
Showing 7 changed files with 470 additions and 451 deletions.
52 changes: 26 additions & 26 deletions config.xml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" id="http://my.opera.com/BS-Harou/blog/weather-in-speeddial" defaultlocale="en" viewmodes="minimized">
<name short="Weather by Wundergound">Weather by Wundergound</name>
<description>Get the weather in your Speed Dial</description>
<author href="http://my.opera.com/BS-Harou/blog/">BS-Harou (Martin Kadlec)</author>
<icon src="icons/icon64.png"/>

<access origin="*" subdomains="true" />
<name short="Weather by Wundergound">Weather by Wundergound</name>
<description>Get the weather in your Speed Dial</description>
<author href="http://my.opera.com/BS-Harou/blog/">BS-Harou (Martin Kadlec)</author>
<icon src="icons/icon64.png"/>

<access origin="*" subdomains="true" />

<feature name="opera:speeddial" required="true">
<param name="url" value="http://my.opera.com/"/>
</feature>

<preference name="interval" value="60" />
<preference name="city" value="Oslo, Norway" />
<preference name="deg" value="celsius" />
<preference name="format" value="YYYY-MM-DD" />
<preference name="lang" value="en" />
<preference name="special" value="" />
<preference name="redirect" value="http://my.opera.com/" />
<preference name="background" value="-o-linear-gradient(top, #bbeedd , white 20%)" />
<preference name="textColor" value="black" />
<preference name="hideLocation" value="false" />
<preference name="iconSet" value="Default" />
<feature name="opera:speeddial" required="true">
<param name="url" value="http://my.opera.com/"/>
</feature>

<preference name="transInterval" value="5" />
<preference name="transDuration" value="500" />
<preference name="transFunc" value="ease" />
<preference name="transType" value="none" />
<preference name="interval" value="60" />
<preference name="city" value="Oslo, Norway" />
<preference name="deg" value="celsius" />
<preference name="format" value="YYYY-MM-DD" />
<preference name="lang" value="en" />
<preference name="special" value="" />
<preference name="redirect" value="http://my.opera.com/" />
<preference name="background" value="-o-linear-gradient(top, #bbeedd , white 20%)" />
<preference name="textColor" value="black" />
<preference name="hideLocation" value="false" />
<preference name="iconSet" value="Default" />

<preference name="cache" value="{}" />
<preference name="cacheEnabled" value="false" />
<preference name="transInterval" value="5" />
<preference name="transDuration" value="500" />
<preference name="transFunc" value="ease" />
<preference name="transType" value="none" />

<preference name="cache" value="{}" />
<preference name="cacheEnabled" value="false" />
</widget>
59 changes: 30 additions & 29 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Weather by Wunderground</title>
<link rel="stylesheet" href="styles/sd.css">
<script src="lib/ajax/ajax.mod.js"></script>
<script src="scripts/lang.js"></script>
<script src="scripts/atlases.js"></script>
<script src="scripts/native-extend.js"></script>
<script src="scripts/background.js"></script>
</head>
<body>
<table rules="none">
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><img src='images/unknown.gif'></td>
<td><img src='images/unknown.gif'></td>
<td><img src='images/unknown.gif'></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</body>
<head>
<meta charset="utf-8">
<title>Weather by Wunderground</title>
<link rel="stylesheet" href="styles/sd.css">
<script src="lib/ajax/ajax.mod.js"></script>
<script src="scripts/lang.js"></script>
<script src="scripts/atlases.js"></script>
<script src="scripts/native-extend.js"></script>
<script src="scripts/core.js"></script>
<script src="scripts/background.js"></script>
</head>
<body>
<table rules="none">
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><img src='images/unknown.gif'></td>
<td><img src='images/unknown.gif'></td>
<td><img src='images/unknown.gif'></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</body>
</html>
32 changes: 16 additions & 16 deletions scripts/atlases.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ var Atlases = {
"Atlas 2": {
name: "atlas2.jpg",
weather: {
chancerain: {x: 0, y: 225, w: 190, h: 190},
sunny: {x: 0, y: 0, w: 190, h: 190},
clear: {x: 0, y: 0, w: 190, h: 190},
cloudy: {x: 710, y: 225, w: 282, h: 190},
partlycloudy: {x: 250, y: 0, w: 190, h: 190},
mostlycloudy: {x: 250, y: 0, w: 190, h: 190},
thunderstorm: {x: 250, y: 225, w: 190, h: 190},
storm: {x: 750, y: 0, w: 190, h: 190},
tstorms: {x: 250, y: 225, w: 190, h: 190},
rain: {x: 0, y: 225, w: 190, h: 190},
mostlysunny: {x: 500, y: 0, w: 190, h: 190},
snow: {x: 500, y: 225, w: 190, h: 190},
chanceofsnow: {x: 500, y: 225, w: 190, h: 190},
partlysunny: {x: 500, y: 0, w: 190, h: 190},
hazy: {x: 0, y: 450, w: 190, h: 190},
chancesnow: {x: 500, y: 225, w: 190, h: 190}
chancerain: { x: 0, y: 225, w: 190, h: 190 },
sunny: { x: 0, y: 0, w: 190, h: 190 },
clear: { x: 0, y: 0, w: 190, h: 190 },
cloudy: { x: 710, y: 225, w: 282, h: 190 },
partlycloudy: { x: 250, y: 0, w: 190, h: 190 },
mostlycloudy: { x: 250, y: 0, w: 190, h: 190 },
thunderstorm: { x: 250, y: 225, w: 190, h: 190 },
storm: { x: 750, y: 0, w: 190, h: 190 },
tstorms: { x: 250, y: 225, w: 190, h: 190 },
rain: { x: 0, y: 225, w: 190, h: 190 },
mostlysunny: { x: 500, y: 0, w: 190, h: 190 },
snow: { x: 500, y: 225, w: 190, h: 190 },
chanceofsnow: { x: 500, y: 225, w: 190, h: 190 },
partlysunny: { x: 500, y: 0, w: 190, h: 190 },
hazy: { x: 0, y: 450, w: 190, h: 190 },
chancesnow: { x: 500, y: 225, w: 190, h: 190 }
}
}
};
4 changes: 2 additions & 2 deletions scripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ function imageErrorHandler() {

/* interval callback */
function getWeatherInfo() {
var cities = (new SemiArray(w.preferences.city)).items;
var cities = (new SemiArray(w.preferences.city)).items, i;
Transitions.reset();
try {
c.abort();
for (var i = 0, j = cities.length; i < j; i++) {
for (i = 0, j = cities.length; i < j; i++) {
c.getData('http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml?query=' + window.encodeURIComponent(cities[i]), handleWeatherSuccess, handleError, true);
}
} catch(e) {
Expand Down
Loading

0 comments on commit 59da18a

Please sign in to comment.