|
|
@ -156,10 +156,6 @@ WeatherMenuButton.prototype = { |
|
|
|
// Show weather
|
|
|
|
// Show weather
|
|
|
|
this.refreshWeather(true); |
|
|
|
this.refreshWeather(true); |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
noCity : function() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
loadConfig : function() |
|
|
|
loadConfig : function() |
|
|
@ -643,18 +639,10 @@ WeatherMenuButton.prototype = { |
|
|
|
|
|
|
|
|
|
|
|
refreshWeather: function(recurse) { |
|
|
|
refreshWeather: function(recurse) { |
|
|
|
if(!this._city) |
|
|
|
if(!this._city) |
|
|
|
{ |
|
|
|
|
|
|
|
this.noCity(); |
|
|
|
|
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
this.load_json_async(this.get_weather_url(), function(json) { |
|
|
|
this.load_json_async(this.get_weather_url(), function(json) { |
|
|
|
if(!json) |
|
|
|
if(!json) |
|
|
|
{ |
|
|
|
|
|
|
|
Mainloop.timeout_add_seconds(2, Lang.bind(this, function() { |
|
|
|
|
|
|
|
this.refreshWeather(recurse); |
|
|
|
|
|
|
|
})); |
|
|
|
|
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
let weather = json.query.results.channel; |
|
|
|
let weather = json.query.results.channel; |
|
|
|
let many = 0; |
|
|
|
let many = 0; |
|
|
|
if(typeof weather[0] != "undefined") |
|
|
|
if(typeof weather[0] != "undefined") |
|
|
|