This repository was archived by the owner on Jul 11, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,11 +18,13 @@ function sendAndroidMessage() {
1818 * in the WebViewCompat reference doc, the second parameter, MessagePorts, is optional.
1919 * Also note that onmessage, addEventListener and removeEventListener are not supported.
2020 */
21+ // TODO: Change message to account for changes in data
2122 jsObject . postMessage ( "The weather in " + `${ document . getElementById ( "title" ) . innerText } ` + " today is " +
2223 `${ document . getElementById ( "shortDescription" ) . innerText } ` ) ;
2324}
2425
2526function getData ( ) {
27+ // TODO: Change the path to grab data from new location; Change longDescription and currentTemp to work with changes in data
2628 fetch ( "https://gcoleman799.github.io/Asset-Loader/weather.json" ) . then ( function ( resp ) {
2729 return resp . json ( ) ;
2830 } ) . then ( function ( data ) {
@@ -36,4 +38,6 @@ function getData() {
3638 + `${ data [ currentLocation ] . humidity } .` ;
3739 document . getElementById ( "icon" ) . src = data [ currentLocation ] . icon ;
3840 } )
39- }
41+ }
42+
43+ // TODO: Create getIcon() function to decide which icon to render.
Original file line number Diff line number Diff line change 11{
22 "newYork" :{
3- "currentTemp" :" 75° " ,
4- "highTemp" :" 83° " ,
5- "lowTemp" :" 64° " ,
6- "chancePrecip" :" 90% " ,
7- "humidity" :" 23% " ,
3+ "currentTemp" :75 ,
4+ "highTemp" :83 ,
5+ "lowTemp" :64 ,
6+ "chancePrecip" :90 ,
7+ "humidity" :23 ,
88 "description" :" Rainy" ,
9- "icon" :" https://gcoleman799.github.io/res/drawable/rain.png"
109 },
1110 "sanFrancisco" :{
12- "currentTemp" :" 70° " ,
13- "highTemp" :" 75° " ,
14- "lowTemp" :" 61° " ,
15- "chancePrecip" :" 0% " ,
16- "humidity" :" 2% " ,
11+ "currentTemp" :70 ,
12+ "highTemp" :75 ,
13+ "lowTemp" :61 ,
14+ "chancePrecip" :0 ,
15+ "humidity" :2 ,
1716 "description" :" Clear Sky" ,
18- "icon" : " https://gcoleman799.github.io/res/drawable/sunny.png"
1917 },
2018 "london" :{
21- "currentTemp" :" 88° " ,
22- "highTemp" :" 89° " ,
23- "lowTemp" :" 67° " ,
24- "chancePrecip" :" 15% " ,
25- "humidity" :" 36% " ,
19+ "currentTemp" :88 ,
20+ "highTemp" :89 ,
21+ "lowTemp" :67 ,
22+ "chancePrecip" :15 ,
23+ "humidity" :36 ,
2624 "description" :" Partly Cloudy" ,
27- "icon" :" https://gcoleman799.github.io/res/drawable/partly_cloudy.png"
2825 }
2926}
You can’t perform that action at this time.
0 commit comments