mirror of
https://github.com/mue/mue.git
synced 2026-07-23 16:57:25 +02:00
fix: search autocomplete, add visibility to weather
This commit is contained in:
@@ -76,6 +76,7 @@ export default class TimeSettings extends React.PureComponent {
|
||||
<Checkbox name='showtext' text={language.extra_info.show_text} category='weather'/>
|
||||
<Checkbox name='cloudiness' text={language.extra_info.cloudiness} category='weather'/>
|
||||
<Checkbox name='humidity' text={language.extra_info.humidity} category='weather'/>
|
||||
<Checkbox name='visibility' text={language.extra_info.visibility} category='weather'/>
|
||||
<Checkbox name='windspeed' text={language.extra_info.wind_speed} category='weather'/>
|
||||
<Checkbox name='windDirection' text={language.extra_info.wind_direction} category='weather'/>
|
||||
<Checkbox name='mintemp' text={language.extra_info.min_temp} category='weather'/>
|
||||
|
||||
@@ -45,8 +45,15 @@ export default class Search extends React.PureComponent {
|
||||
};
|
||||
}
|
||||
|
||||
searchButton = () => {
|
||||
const value = document.getElementById('searchtext').value || 'mue fast';
|
||||
searchButton = (e) => {
|
||||
let value;
|
||||
|
||||
if (e) {
|
||||
value = e;
|
||||
} else {
|
||||
value = document.getElementById('searchtext').value || 'mue fast';
|
||||
}
|
||||
|
||||
window.location.href = this.state.url + `?${this.state.query}=` + value;
|
||||
}
|
||||
|
||||
@@ -54,6 +61,7 @@ export default class Search extends React.PureComponent {
|
||||
const data = await (await fetchJSONP(this.state.autocompleteURL + this.state.autocompleteQuery + input, {
|
||||
jsonpCallback: this.state.autocompleteCallback
|
||||
})).json();
|
||||
|
||||
this.setState({
|
||||
suggestions: data[1].splice(0, 3)
|
||||
});
|
||||
|
||||
@@ -24,6 +24,7 @@ export default class Weather extends React.PureComponent {
|
||||
wind_speed: '',
|
||||
wind_degrees: '',
|
||||
cloudiness: '',
|
||||
visibility: '',
|
||||
pressure: ''
|
||||
}
|
||||
};
|
||||
@@ -48,6 +49,7 @@ export default class Weather extends React.PureComponent {
|
||||
humidity: this.state.weather.humidity,
|
||||
pressure: this.state.weather.pressure
|
||||
},
|
||||
visibility: this.state.weather.visibility,
|
||||
wind: {
|
||||
speed: this.state.weather.wind_speed,
|
||||
deg: this.state.weather.wind_degrees
|
||||
@@ -101,6 +103,7 @@ export default class Weather extends React.PureComponent {
|
||||
wind_speed: data.wind.speed,
|
||||
wind_degrees: data.wind.deg,
|
||||
cloudiness: data.clouds.all,
|
||||
visibility: data.visibility,
|
||||
pressure: data.main.pressure,
|
||||
original_temp: data.main.temp,
|
||||
original_temp_min: data.main.temp_min,
|
||||
@@ -162,6 +165,7 @@ export default class Weather extends React.PureComponent {
|
||||
{enabled('humidity') ? <span className='loc'><br/><WiHumidity/>{this.state.weather.humidity}%</span> : null}
|
||||
{enabled('windspeed') ? <span className='loc'><br/><WiWindy/>{this.state.weather.wind_speed}<span className='minmax'> m/s</span> {enabled('windDirection') ? <WindDirectionIcon degrees={this.state.weather.wind_degrees}/> : null}</span> : null}
|
||||
{enabled('cloudiness') ? <span className='loc'><br/><WiCloud/>{this.state.weather.cloudiness}%</span>: null}
|
||||
{enabled('visibility') ? <span className='loc'><br/>{this.state.weather.visibility} meters</span>: null}
|
||||
{enabled('atmosphericpressure') ? <span className='loc'><br/><WiBarometer/>{this.state.weather.pressure}<span className='minmax'> hPa</span></span> : null}
|
||||
<br/>
|
||||
{enabled('showlocation') ? <span className='loc'>{this.state.location}</span> : null}
|
||||
|
||||
@@ -185,6 +185,7 @@
|
||||
"show_text": "Show text",
|
||||
"cloudiness": "Cloudiness",
|
||||
"humidity": "Luftfeuchtigkeit",
|
||||
"visibility": "Visibility",
|
||||
"wind_speed": "Windgeschwindigkeit",
|
||||
"wind_direction": "Wind direction",
|
||||
"min_temp": "Mindesttemperatur",
|
||||
|
||||
@@ -185,6 +185,7 @@
|
||||
"show_text": "Show text",
|
||||
"cloudiness": "Cloudiness",
|
||||
"humidity": "Humidity",
|
||||
"visibility": "Visibility",
|
||||
"wind_speed": "Wind speed",
|
||||
"wind_direction": "Wind direction",
|
||||
"min_temp": "Minimum temperature",
|
||||
|
||||
@@ -185,6 +185,7 @@
|
||||
"show_text": "Show text",
|
||||
"cloudiness": "Cloudiness",
|
||||
"humidity": "Humidity",
|
||||
"visibility": "Visibility",
|
||||
"wind_speed": "Wind speed",
|
||||
"wind_direction": "Wind direction",
|
||||
"min_temp": "Minimum temperature",
|
||||
|
||||
@@ -185,6 +185,7 @@
|
||||
"show_text": "Show text",
|
||||
"cloudiness": "Cloudiness",
|
||||
"humidity": "Humedad",
|
||||
"visibility": "Visibility",
|
||||
"wind_speed": "Velocidad del viento",
|
||||
"wind_direction": "Wind direction",
|
||||
"min_temp": "Temperatura mínima",
|
||||
|
||||
@@ -185,6 +185,7 @@
|
||||
"show_text": "Show text",
|
||||
"cloudiness": "Cloudiness",
|
||||
"humidity": "Humidité",
|
||||
"visibility": "Visibility",
|
||||
"wind_speed": "Vitesse du vent",
|
||||
"wind_direction": "Wind direction",
|
||||
"min_temp": "Température minimale",
|
||||
|
||||
@@ -185,6 +185,7 @@
|
||||
"show_text": "Show text",
|
||||
"cloudiness": "Cloudiness",
|
||||
"humidity": "Humidity",
|
||||
"visibility": "Visibility",
|
||||
"wind_speed": "Wind speed",
|
||||
"wind_direction": "Wind direction",
|
||||
"min_temp": "Minimum temperature",
|
||||
|
||||
@@ -185,6 +185,7 @@
|
||||
"show_text": "Show text",
|
||||
"cloudiness": "Cloudiness",
|
||||
"humidity": "Humidity",
|
||||
"visibility": "Visibility",
|
||||
"wind_speed": "Wind speed",
|
||||
"wind_direction": "Wind direction",
|
||||
"min_temp": "Minimum temperature",
|
||||
|
||||
@@ -185,6 +185,7 @@
|
||||
"show_text": "Show text",
|
||||
"cloudiness": "Cloudiness",
|
||||
"humidity": "Humidity",
|
||||
"visibility": "Visibility",
|
||||
"wind_speed": "Wind speed",
|
||||
"wind_direction": "Wind direction",
|
||||
"min_temp": "Minimum temperature",
|
||||
|
||||
@@ -185,6 +185,7 @@
|
||||
"show_text": "Show text",
|
||||
"cloudiness": "Cloudiness",
|
||||
"humidity": "Humidity",
|
||||
"visibility": "Visibility",
|
||||
"wind_speed": "Wind speed",
|
||||
"wind_direction": "Wind direction",
|
||||
"min_temp": "Minimum temperature",
|
||||
|
||||
Reference in New Issue
Block a user