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