Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
weather
Commits
b34c4948
Commit
b34c4948
authored
Nov 16, 2016
by
Manuel Gauto
Browse files
Start on making tabs work
parent
8638d616
Changes
6
Hide whitespace changes
Inline
Side-by-side
weather/.meteor/packages
View file @
b34c4948
...
...
@@ -8,7 +8,7 @@ meteor-base@1.0.4 # Packages every Meteor app needs to have
mobile-experience@1.0.4 # Packages for a great mobile UX
mongo@1.1.12 # The database Meteor supports right now
blaze-html-templates@1.0.4 # Compile .html files into Meteor Blaze views
session
@1.1.6
# Client-side reactive dictionary for your app
session # Client-side reactive dictionary for your app
jquery@1.11.9 # Helpful client-side library
tracker@1.1.0 # Meteor's client-side reactive programming library
...
...
weather/client/main.html
View file @
b34c4948
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"description"
content=
"SRCT Weather beautifully displays live weather and forecasts for Mason's campuses."
>
<title>
SRCT Weather
•
76
°
F
</title>
<title>
SRCT Weather
</title>
<link
rel=
"stylesheet"
href=
"weather.css"
>
<link
rel=
"icon"
type=
"image/x-icon"
href=
"lib/favicon.ico"
/>
</head>
...
...
weather/client/views/home/home.js
View file @
b34c4948
Template
.
home
.
events
({
'
click
.locationTab
'
(
event
)
{
'
click
'
(
event
)
{
console
.
log
(
event
);
}
});
weather/client/views/weather/weather.js
View file @
b34c4948
...
...
@@ -31,9 +31,16 @@ Template.weather.helpers({
var
weatherData
=
{};
var
weatherDataDependency
=
new
Tracker
.
Dependency
;
Template
.
weather
.
onCreated
(
function
(){
Meteor
.
call
(
'
getWeather
'
,
38.830295
,
-
77.307717
,
function
(
error
,
result
)
{
weatherData
=
result
;
weatherDataDependency
.
changed
();
Session
.
set
(
"
locationName
"
,
"
FAIRFAX
"
);
Tracker
.
autorun
(
function
()
{
var
locName
=
Session
.
get
(
"
locationName
"
);
var
location
=
LOCATIONS
[
locName
];
Meteor
.
call
(
'
getWeather
'
,
location
.
lat
,
location
.
long
,
function
(
error
,
result
)
{
weatherData
=
result
;
document
.
title
=
"
SRCT Weather •
"
+
Math
.
round
(
result
.
data
.
currently
.
temperature
)
+
"
° F
"
weatherDataDependency
.
changed
();
});
});
});
...
...
weather/
server/
locations.js
→
weather/locations.js
View file @
b34c4948
File moved
weather/server/methods.js
View file @
b34c4948
...
...
@@ -33,6 +33,7 @@ function getWeather(latitude, longitude) {
return
curWeatherData
;
}
}
else
{
console
.
log
(
"
Returning cached data.
"
)
//The data is still valid, return it
return
curWeatherData
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment