Skip to content

Commit

Permalink
added support for mojito 4&&5
Browse files Browse the repository at this point in the history
  • Loading branch information
diervo committed Oct 10, 2012
1 parent 2fbcf62 commit bbe79c9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
4 changes: 3 additions & 1 deletion .gitignore
@@ -1,2 +1,4 @@
.DS_Store
tmp
tmp
lesson1/myWeatherApp/autoload/compiled/shaker-meta.common.js
lesson1/myWeatherApp/assets/compiled/
9 changes: 7 additions & 2 deletions lesson1/myWeatherApp/application.json
Expand Up @@ -6,7 +6,7 @@
"type": "Weather"
},
"htmlframe": {
"type": "HTMLFrameMojit",
"type": "ShakerHTMLFrameMojit",
"config": {
"deploy": true,
"title": "MyWeather - Yahoo!",
Expand Down Expand Up @@ -34,5 +34,10 @@
"forceUpdate": false,
"maxAge": 600000
}
}
},
{ "settings": ["environment:stage"],
"shaker": {
"task": "local"
}
}
]
8 changes: 5 additions & 3 deletions lesson1/myWeatherApp/mojits/Weather/controller.server.js
Expand Up @@ -35,7 +35,8 @@ YUI.add('Weather', function(Y, NAME) {
yqlModel;

if (geoParams.longitude && geoParams.latitude) {
yqlModel = ac.models.get('WeatherModelYQL');
//we do this || for backwards compatibility
yqlModel = ac.models.WeatherModelYQL || ac.models.get('WeatherModelYQL');
//Call YQLModel to retrieve the Weather for that location
yqlModel.getData(geoParams, function (err, data) {
if (err) {
Expand All @@ -62,9 +63,10 @@ YUI.add('Weather', function(Y, NAME) {
*/
twitter: function(ac) {

var query = ac.params.getFromMerged('query');
var query = ac.params.getFromMerged('query'),
twitterModel = ac.models.WeatherModelTwitter || ac.models.get('WeatherModelTwitter');

ac.models.get('WeatherModelTwitter').search(query, function (json) {
twitterModel.search(query, function (json) {
var results = json.results || {};
ac.done(results, 'json');
});
Expand Down
3 changes: 2 additions & 1 deletion lesson1/myWeatherApp/package.json
Expand Up @@ -18,7 +18,8 @@
}
],
"dependencies": {
"mojito": "0.3.26"
"mojito": "0.4.4",
"mojito-shaker": "2.0.x"
},
"engines": {
"node": ">= 0.6.0"
Expand Down

0 comments on commit bbe79c9

Please sign in to comment.