Commit a50ceffe authored by EnesKarakas's avatar EnesKarakas
Browse files

dwa

parent 82d812a0
...@@ -278,16 +278,32 @@ const WeatherForecastData = (props) => { ...@@ -278,16 +278,32 @@ const WeatherForecastData = (props) => {
/> />
<label for="hour_dewpoint">Hour Dew Point</label> <label for="hour_dewpoint">Hour Dew Point</label>
<br /> <br />
<input type="checkbox" id="hourly_will_it_rain" class="checkBoxFilter" /> <input
type="checkbox"
id="hourly_will_it_rain"
class="checkBoxFilter"
/>
<label for="hourly_will_it_rain">Will it Rain</label> <label for="hourly_will_it_rain">Will it Rain</label>
<br /> <br />
<input type="checkbox" id="hourly_chance_of_rain" class="checkBoxFilter" /> <input
type="checkbox"
id="hourly_chance_of_rain"
class="checkBoxFilter"
/>
<label for="hourly_chance_of_rain">Chance of Rain</label> <label for="hourly_chance_of_rain">Chance of Rain</label>
<br /> <br />
<input type="checkbox" id="hourly_will_it_snow" class="checkBoxFilter" /> <input
type="checkbox"
id="hourly_will_it_snow"
class="checkBoxFilter"
/>
<label for="hourly_will_it_snow">Will it Snow</label> <label for="hourly_will_it_snow">Will it Snow</label>
<br /> <br />
<input type="checkbox" id="hourly_chance_of_snow" class="checkBoxFilter" /> <input
type="checkbox"
id="hourly_chance_of_snow"
class="checkBoxFilter"
/>
<label for="hourly_chance_of_snow">Chance of Snow</label> <label for="hourly_chance_of_snow">Chance of Snow</label>
<br /> <br />
<input type="checkbox" id="hour_vis" class="checkBoxFilter" /> <input type="checkbox" id="hour_vis" class="checkBoxFilter" />
...@@ -340,14 +356,13 @@ const WeatherForecastData = (props) => { ...@@ -340,14 +356,13 @@ const WeatherForecastData = (props) => {
); );
function getData() { function getData() {
const units = document.getElementById("units").value; const units = document.getElementById("units").value;
const city = document.getElementById("city_text").value; const city_text = document.getElementById("city_text").value;
const region = document.getElementById("region_text").value; const region_text = document.getElementById("region_text").value;
const country = document.getElementById("country_text").value; const country_text = document.getElementById("country_text").value;
const latitude = document.getElementById("latitude_text").value; const latitude_text = document.getElementById("latitude_text").value;
const longitude = document.getElementById("longitude_text").value; const longitude_text = document.getElementById("longitude_text").value;
const name = document.getElementById("name").checked; const name = document.getElementById("name").checked;
const regionCheckbox = document.getElementById("region").checked; const regionCheckbox = document.getElementById("region").checked;
...@@ -379,9 +394,6 @@ const WeatherForecastData = (props) => { ...@@ -379,9 +394,6 @@ const WeatherForecastData = (props) => {
const daily_chance_of_snow = document.getElementById( const daily_chance_of_snow = document.getElementById(
"daily_chance_of_snow" "daily_chance_of_snow"
).checked; ).checked;
const condition_text = document.getElementById("condition_text").checked;
const condition_icon = document.getElementById("condition_icon").checked;
const condition_code = document.getElementById("condition_code").checked;
const uv = document.getElementById("uv").checked; const uv = document.getElementById("uv").checked;
const sunrise = document.getElementById("sunrise").checked; const sunrise = document.getElementById("sunrise").checked;
const sunset = document.getElementById("sunset").checked; const sunset = document.getElementById("sunset").checked;
...@@ -394,15 +406,6 @@ const WeatherForecastData = (props) => { ...@@ -394,15 +406,6 @@ const WeatherForecastData = (props) => {
const hour_time = document.getElementById("hour_time").checked; const hour_time = document.getElementById("hour_time").checked;
const hour_temp = document.getElementById("hour_temp").checked; const hour_temp = document.getElementById("hour_temp").checked;
const hour_is_day = document.getElementById("hour_is_day").checked; const hour_is_day = document.getElementById("hour_is_day").checked;
const hour_condition_text = document.getElementById(
"hour_condition_text"
).checked;
const hour_condition_icon = document.getElementById(
"hour_condition_icon"
).checked;
const hour_condition_code = document.getElementById(
"hour_condition_code"
).checked;
const hour_wind = document.getElementById("hour_wind").checked; const hour_wind = document.getElementById("hour_wind").checked;
const hour_wind_degree = const hour_wind_degree =
document.getElementById("hour_wind_degree").checked; document.getElementById("hour_wind_degree").checked;
...@@ -415,10 +418,18 @@ const WeatherForecastData = (props) => { ...@@ -415,10 +418,18 @@ const WeatherForecastData = (props) => {
const hour_windchill = document.getElementById("hour_windchill").checked; const hour_windchill = document.getElementById("hour_windchill").checked;
const hour_heatindex = document.getElementById("hour_heatindex").checked; const hour_heatindex = document.getElementById("hour_heatindex").checked;
const hour_dewpoint = document.getElementById("hour_dewpoint").checked; const hour_dewpoint = document.getElementById("hour_dewpoint").checked;
const hourly_will_it_rain = document.getElementById("hourly_will_it_rain").checked; const hourly_will_it_rain = document.getElementById(
const hourly_chance_of_rain = document.getElementById("hourly_chance_of_rain").checked; "hourly_will_it_rain"
const hourly_will_it_snow = document.getElementById("hourly_will_it_snow").checked; ).checked;
const hourly_chance_of_snow = document.getElementById("hourly_chance_of_snow").checked; const hourly_chance_of_rain = document.getElementById(
"hourly_chance_of_rain"
).checked;
const hourly_will_it_snow = document.getElementById(
"hourly_will_it_snow"
).checked;
const hourly_chance_of_snow = document.getElementById(
"hourly_chance_of_snow"
).checked;
const hour_vis = document.getElementById("hour_vis").checked; const hour_vis = document.getElementById("hour_vis").checked;
const hour_gust = document.getElementById("hour_gust").checked; const hour_gust = document.getElementById("hour_gust").checked;
const hour_uv = document.getElementById("hour_uv").checked; const hour_uv = document.getElementById("hour_uv").checked;
...@@ -437,27 +448,42 @@ const WeatherForecastData = (props) => { ...@@ -437,27 +448,42 @@ const WeatherForecastData = (props) => {
if (last_updated) filterArray.push("last_updated"); if (last_updated) filterArray.push("last_updated");
if (date) filterArray.push("date"); if (date) filterArray.push("date");
if (date_epoch) filterArray.push("date_epoch"); if (date_epoch) filterArray.push("date_epoch");
if (maxtemp) if(units=="world"){ if (maxtemp)
filterArray.push("maxtemp_c"); if (units == "world") {
}else{ filterArray.push("maxtemp_c");
filterArray.push("maxtemp_f");} } else {
if (mintemp) if(units=="world"){ filterArray.push("maxtemp_f");
filterArray.push("mintemp_c"); }
}else{filterArray.push("mintemp");} if (mintemp)
if (avgtemp) if(units=="world"){ if (units == "world") {
filterArray.push("avgtemp_c"); filterArray.push("mintemp_c");
}else{filterArray.push("avgtemp_f"); } else {
} filterArray.push("mintemp");
if (maxwind) if(units=="world"){ }
filterArray.push("maxwind_kph"); if (avgtemp)
}else{filterArray.push("maxwind_mph");} if (units == "world") {
if (totalprecip)if(units=="world"){ filterArray.push("avgtemp_c");
filterArray.push("totalprecip_mm"); } else {
}else{ filterArray.push("totalprecip_in");} filterArray.push("avgtemp_f");
if (avgvis) if(units=="world"){ }
filterArray.push("avgis_km"); if (maxwind)
}else{ if (units == "world") {
filterArray.push("avgvis_miles");} filterArray.push("maxwind_kph");
} else {
filterArray.push("maxwind_mph");
}
if (totalprecip)
if (units == "world") {
filterArray.push("totalprecip_mm");
} else {
filterArray.push("totalprecip_in");
}
if (avgvis)
if (units == "world") {
filterArray.push("avgis_km");
} else {
filterArray.push("avgvis_miles");
}
if (avghumidity) filterArray.push("avghumidity"); if (avghumidity) filterArray.push("avghumidity");
if (daily_will_it_rain) filterArray.push("daily_will_it_rain"); if (daily_will_it_rain) filterArray.push("daily_will_it_rain");
if (daily_chance_of_rain) filterArray.push("daily_chance_of_rain"); if (daily_chance_of_rain) filterArray.push("daily_chance_of_rain");
...@@ -475,51 +501,75 @@ const WeatherForecastData = (props) => { ...@@ -475,51 +501,75 @@ const WeatherForecastData = (props) => {
if (moon_illumination) filterArray.push("moon_illumination"); if (moon_illumination) filterArray.push("moon_illumination");
if (hour_time_epoch) filterArray.push("hourly_time_epoch"); if (hour_time_epoch) filterArray.push("hourly_time_epoch");
if (hour_time) filterArray.push("hourly_time"); if (hour_time) filterArray.push("hourly_time");
if (hour_temp) if(units=="world"){ if (hour_temp)
filterArray.push("hourly_temp_c"); if (units == "world") {
}else{ filterArray.push("hourly_temp_c");
filterArray.push("hourly_temp_f");} } else {
filterArray.push("hourly_temp_f");
}
if (hour_is_day) filterArray.push("hourly_is_day"); if (hour_is_day) filterArray.push("hourly_is_day");
if (hour_wind)if(units=="world"){ if (hour_wind)
filterArray.push("hourly_wind_kph"); if (units == "world") {
}else{ filterArray.push("hourly_wind_kph");
filterArray.push("hourly_wind_mph");} } else {
filterArray.push("hourly_wind_mph");
}
if (hour_wind_degree) filterArray.push("hourly_wind_degree"); if (hour_wind_degree) filterArray.push("hourly_wind_degree");
if (hour_wind_dir) filterArray.push("hourly_wind_dir"); if (hour_wind_dir) filterArray.push("hourly_wind_dir");
if (hour_pressure) if(units=="world"){ if (hour_pressure)
filterArray.push("hourly_pressure_mb"); if (units == "world") {
}else{filterArray.push("hourly_pressure_in");} filterArray.push("hourly_pressure_mb");
if (hour_precip) if(units=="world"){ } else {
filterArray.push("hourly_precip_mm"); filterArray.push("hourly_pressure_in");
}else{ }
filterArray.push("hourly_precip_in");} if (hour_precip)
if (units == "world") {
filterArray.push("hourly_precip_mm");
} else {
filterArray.push("hourly_precip_in");
}
if (hour_humidity) filterArray.push("hourly_humidity"); if (hour_humidity) filterArray.push("hourly_humidity");
if (hour_cloud) filterArray.push("hourly_cloud"); if (hour_cloud) filterArray.push("hourly_cloud");
if (hour_feelslike) if(units=="world"){ if (hour_feelslike)
filterArray.push("hourly_feelslike_c"); if (units == "world") {
}else{filterArray.push("hourly_feelslike_f");} filterArray.push("hourly_feelslike_c");
if (hour_windchill) if(units=="world"){ } else {
filterArray.push("hourly_windchill_c"); filterArray.push("hourly_feelslike_f");
}else{filterArray.push("hourly_windchill_f");} }
if (hour_heatindex)if(units=="world"){ if (hour_windchill)
filterArray.push("hourly_heatindex_c"); if (units == "world") {
}else{ filterArray.push("hourly_heatindex_f");} filterArray.push("hourly_windchill_c");
if (hour_dewpoint) if(units=="world"){ } else {
filterArray.push("hourly_dewpoint_c"); filterArray.push("hourly_windchill_f");
}else{ }
filterArray.push("hourly_dewpoint_f");} if (hour_heatindex)
if (units == "world") {
filterArray.push("hourly_heatindex_c");
} else {
filterArray.push("hourly_heatindex_f");
}
if (hour_dewpoint)
if (units == "world") {
filterArray.push("hourly_dewpoint_c");
} else {
filterArray.push("hourly_dewpoint_f");
}
if (hourly_will_it_rain) filterArray.push("hourly_will_it_rain"); if (hourly_will_it_rain) filterArray.push("hourly_will_it_rain");
if (hourly_chance_of_rain) filterArray.push("hourly_chance_of_rain"); if (hourly_chance_of_rain) filterArray.push("hourly_chance_of_rain");
if (hourly_will_it_snow) filterArray.push("hourly_will_it_snow"); if (hourly_will_it_snow) filterArray.push("hourly_will_it_snow");
if (hourly_chance_of_snow) filterArray.push("hourly_chance_of_snow"); if (hourly_chance_of_snow) filterArray.push("hourly_chance_of_snow");
if (hour_vis) if(units=="world"){ if (hour_vis)
filterArray.push("hourly_vis_km"); if (units == "world") {
}else{ filterArray.push("hourly_vis_km");
filterArray.push("hourly_vis_miles");} } else {
if (hour_gust) if(units=="world"){ filterArray.push("hourly_vis_miles");
filterArray.push("hourly_gust_kph"); }
}else{ if (hour_gust)
filterArray.push("hourly_gust_mph");} if (units == "world") {
filterArray.push("hourly_gust_kph");
} else {
filterArray.push("hourly_gust_mph");
}
if (hour_uv) filterArray.push("hourly_uv"); if (hour_uv) filterArray.push("hourly_uv");
let filterString = filterArray.join(","); let filterString = filterArray.join(",");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment