diff --git a/src/extension.js b/src/extension.js index 8bcf8f9..22c9028 100644 --- a/src/extension.js +++ b/src/extension.js @@ -5,7 +5,7 @@ * - Displays a small weather information on the top panel. * - On click, gives a popup with details about the weather. * - * Copyright (C) 2011 - 2014 + * Copyright (C) 2011 - 2015 * ecyrbe , * Timur Kristof , * Elad Alfassa , @@ -1294,104 +1294,6 @@ const OpenweatherMenuButton = new Lang.Class({ })); }, - // fcParseWeatherForecast: function() { - // if (this.forecastWeatherCache === undefined) { - // this.refreshWeatherCurrent(); - // return; - // } - // - // let forecast = this.forecastWeatherCache; - // let beginOfDay = new Date(new Date().setHours(0, 0, 0, 0)); - // let cnt = Math.min(this._days_forecast, forecast.length); - // if (cnt != this._days_forecast) - // this.rebuildFutureWeatherUi(cnt); - // - // // Refresh forecast - // for (let i = 0; i < cnt; i++) { - // let forecastUi = this._forecast[i]; - // let forecastData = forecast[i]; - // if (forecastData === undefined) - // continue; - // - // let t_low = forecastData.temperatureMin; - // let t_high = forecastData.temperatureMax; - // - // switch (this._units) { - // case WeatherUnits.FAHRENHEIT: - // t_low = this.toFahrenheit(t_low); - // t_high = this.toFahrenheit(t_high); - // break; - // - // case WeatherUnits.CELSIUS: - // t_low = t_low.toFixed(this._decimal_places); - // t_high = t_high.toFixed(this._decimal_places); - // break; - // - // case WeatherUnits.KELVIN: - // t_low = this.toKelvin(t_low); - // t_high = this.toKelvin(t_high); - // break; - // - // case WeatherUnits.RANKINE: - // t_low = this.toRankine(t_low); - // t_high = this.toRankine(t_high); - // break; - // - // case WeatherUnits.REAUMUR: - // t_low = this.toReaumur(t_low); - // t_high = this.toReaumur(t_high); - // break; - // - // case WeatherUnits.ROEMER: - // t_low = this.toRoemer(t_low); - // t_high = this.toRoemer(t_high); - // break; - // - // case WeatherUnits.DELISLE: - // t_low = this.toDelisle(t_low); - // t_high = this.toDelisle(t_high); - // break; - // - // case WeatherUnits.NEWTON: - // t_low = this.toNewton(t_low); - // t_high = this.toNewton(t_high); - // break; - // } - // let comment = forecastData.summary; - // let forecastDate = new Date(forecastData.time * 1000); - // let dayLeft = Math.floor((forecastDate.getTime() - beginOfDay.getTime()) / 86400000); - // - // let date_string = _("Today"); - // - // let sunrise = new Date(forecastData.sunriseTime * 1000); - // let sunset = new Date(forecastData.sunsetTime * 1000); - // - // if (dayLeft === 0) { - // if (this._clockFormat == "24h") { - // sunrise = sunrise.toLocaleFormat("%R"); - // sunset = sunset.toLocaleFormat("%R"); - // } else { - // sunrise = sunrise.toLocaleFormat("%I:%M %p"); - // sunset = sunset.toLocaleFormat("%I:%M %p"); - // } - // this._currentWeatherSunrise.text = sunrise; - // this._currentWeatherSunset.text = sunset; - // } else if (dayLeft == 1) - // date_string = _("Tomorrow"); - // else if (dayLeft > 1) - // date_string = _("In %d days").format(dayLeft); - // else if (dayLeft == -1) - // date_string = _("Yesterday"); - // else if (dayLeft < -1) - // date_string = _("%d days ago").format(-1 * dayLeft); - // - // forecastUi.Day.text = date_string + ' (' + this.getLocaleDay(forecastDate.getDay()) + ')\n' + forecastDate.toLocaleDateString(); - // forecastUi.Temperature.text = '\u2193 ' + parseFloat(t_low).toLocaleString() + ' ' + this.unit_to_unicode() + ' \u2191 ' + parseFloat(t_high).toLocaleString() + ' ' + this.unit_to_unicode(); - // forecastUi.Summary.text = comment; - // forecastUi.Icon.icon_name = this.getWeatherIcon(forecastData.icon); - // } - // }, - reloadWeatherForecast: function(interval) { if (this._timeoutForecast) { Mainloop.source_remove(this._timeoutForecast); diff --git a/src/forecast_io.js b/src/forecast_io.js index 38be403..2f90cd2 100644 --- a/src/forecast_io.js +++ b/src/forecast_io.js @@ -1,4 +1,39 @@ /* jshint esnext:true */ +/* + * + * Weather extension for GNOME Shell + * - Displays a small weather information on the top panel. + * - On click, gives a popup with details about the weather. + * + * Copyright (C) 2011 - 2015 + * ecyrbe , + * Timur Kristof , + * Elad Alfassa , + * Simon Legner , + * Christian METZLER , + * Mark Benjamin weather.gnome.Markie1@dfgh.net, + * Mattia Meneguzzo odysseus@fedoraproject.org, + * Meng Zhuo , + * Jens Lody + * + * + * This file is part of gnome-shell-extension-openweather. + * + * gnome-shell-extension-openweather is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * gnome-shell-extension-openweather is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with gnome-shell-extension-openweather. If not, see . + * + */ + const WEATHER_URL_HOST = 'api.forecast.io'; const WEATHER_URL_BASE = 'http://' + WEATHER_URL_HOST + '/forecast/'; diff --git a/src/openweathermap_org.js b/src/openweathermap_org.js index bb68512..7d83bf4 100644 --- a/src/openweathermap_org.js +++ b/src/openweathermap_org.js @@ -1,4 +1,39 @@ /* jshint esnext:true */ +/* + * + * Weather extension for GNOME Shell + * - Displays a small weather information on the top panel. + * - On click, gives a popup with details about the weather. + * + * Copyright (C) 2011 - 2015 + * ecyrbe , + * Timur Kristof , + * Elad Alfassa , + * Simon Legner , + * Christian METZLER , + * Mark Benjamin weather.gnome.Markie1@dfgh.net, + * Mattia Meneguzzo odysseus@fedoraproject.org, + * Meng Zhuo , + * Jens Lody + * + * + * This file is part of gnome-shell-extension-openweather. + * + * gnome-shell-extension-openweather is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * gnome-shell-extension-openweather is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with gnome-shell-extension-openweather. If not, see . + * + */ + const ExtensionUtils = imports.misc.extensionUtils; const Me = ExtensionUtils.getCurrentExtension(); diff --git a/src/prefs.js b/src/prefs.js index 26e69e7..e0ddcb1 100644 --- a/src/prefs.js +++ b/src/prefs.js @@ -4,7 +4,7 @@ * Weather extension for GNOME Shell preferences * - Creates a widget to set the preferences of the weather extension * - * Copyright (C) 2012 - 2014 + * Copyright (C) 2012 - 2015 * Canek Peláez , * Christian METZLER , * Jens Lody ,