diff --git a/docs/can-guides/commitment/recipes/weather-report/weather-report-advanced.md b/docs/can-guides/commitment/recipes/weather-report/weather-report-advanced.md index cfea04e2e5c..d49f316fcdf 100644 --- a/docs/can-guides/commitment/recipes/weather-report/weather-report-advanced.md +++ b/docs/can-guides/commitment/recipes/weather-report/weather-report-advanced.md @@ -25,7 +25,6 @@ The following sections are broken down into: - Things to know — Information about CanJS that is useful for solving the problem. - Solution — The solution to the problem. - ## Removing Imperative Code ### The problem @@ -232,14 +231,14 @@ We want to define the behavior of `place` so that it becomes `null` when `locati ### The solution -Update the `JS` tab to: +Update the __JavaScript__ tab to: - - Mixin [can-define-stream-kefir] into the `WeatherViewModel`. - - Remove the setter side-effects from `location` - - Change `place` to derive its value from: +1. Remove the setter side-effects from `location`. +2. Change `place` to derive its value from: - changes in `location` - `place` should be `null` if `location` changes. - the `.places` value - `place` should be the one and only _place_ in `places` if there is only one _place_ in `places`. - the set `.place` value. +3. Mix [can-define-stream-kefir] into the `WeatherViewModel`. @sourceref ./advanced-1/js.js @highlight 4,35-52,79,only @@ -359,9 +358,13 @@ We will do this by: ### The solution +Update the __JavaScript__ tab: + @sourceref ./advanced-2/js.js @highlight 3-21,24-40,only +Update the __HTML__ tab: + @sourceref ./advanced-2/html.html @highlight 1-3,only @@ -397,6 +400,8 @@ fetch("https://api.flickr.com/services/rest/?"+ ### The solution +Update the __JavaScript__ tab: + @sourceref ./advanced-3/js.js @highlight 41-60,108,only @@ -413,9 +418,13 @@ Display the message while `geoLocation` and `geoLocationError` are undefined. ### The solution +Update the __JavaScript__ tab: + @sourceref ./4-enable-location.js @highlight 61-63,only +Update the __HTML__ tab: + @sourceref ./4-enable-location.html @highlight 6-10,only @@ -428,13 +437,17 @@ Show the location entry `
` only when geo location has failed. ### What you need to know -Nothing, you've learned it all by this point. Apply what you know! +Nothing, you’ve learned it all by this point. Apply what you know! ### The solution +Update the __JavaScript__ tab: + @sourceref ./5-show-location.js @highlight 64-66,only +Update the __HTML__ tab: + @sourceref ./5-show-location.html @highlight 12,17,only diff --git a/docs/can-guides/commitment/recipes/weather-report/weather-report.md b/docs/can-guides/commitment/recipes/weather-report/weather-report.md index 1b25a97790d..c5941888110 100755 --- a/docs/can-guides/commitment/recipes/weather-report/weather-report.md +++ b/docs/can-guides/commitment/recipes/weather-report/weather-report.md @@ -17,11 +17,11 @@ To use the widget: 2. If the location name isn’t unique, __click__ on the intended location. 3. See the 10-day forecast for your selected city. -__Start this tutorial by cloning the following JSBin__: +__Start this tutorial by cloning the following JS Bin__: JS Bin on jsbin.com -This JSBin has initial prototype HTML and CSS which is useful for +This JS Bin has initial prototype HTML and CSS which is useful for getting the application to look right. The following sections are broken down into: @@ -35,7 +35,7 @@ The following sections are broken down into: ### The problem -Get the basic setup for a CanJS app (in a JSBin) setup by: +Get the basic setup for a CanJS app (in a JS Bin) setup by: 1. Creating a template that outputs the pre-constructed HTML. 2. Defining a `WeatherViewModel` constructor function. @@ -75,7 +75,7 @@ Get the basic setup for a CanJS app (in a JSBin) setup by: ### The solution -Update the `HTML` tab to wrap the template in a `script` tag: +Update the __HTML__ tab to wrap the template in a `script` tag: ```html