Skip to content

Commit 6fc984d

Browse files
committed
CE complete. Ready for SME
1 parent 3f36519 commit 6fc984d

File tree

1 file changed

+103
-103
lines changed

1 file changed

+103
-103
lines changed

Instructions/20480C_MOD09_LAK.md

Lines changed: 103 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,164 +1,164 @@
1-
# Module 9: Adding Offline Support to Web Applications.
1+
# Module 9: Adding Offline Support to Web Applications
22

3-
# Lab: Adding Offline Support to Web Applications.
3+
# Lab: Adding Offline Support to Web Applications
44

55
### Lab Setup
66

77
### Preparation Steps
88

9-
1. Ensure that you have cloned the 20480C directory from GitHub. It contains the code segments for this course's labs and demos. https://github.com/MicrosoftLearning/20480-Programming-in-HTML5-with-JavaScript-and-CSS3/tree/master/Allfiles.
9+
Ensure that you have cloned the 20480C directory from GitHub (**https://github.com/MicrosoftLearning/20480-Programming-in-HTML5-with-JavaScript-and-CSS3/tree/master/Allfiles**). It contains the code segments for the labs and demos in this course.
1010

11-
### Exercise 1: Caching Offline Data by Using the Application Cache API.
11+
### Exercise 1: Caching Offline Data by Using the Application Cache API
1212

13-
#### Task 1: Configure the application cache manifest.
13+
#### Task 1: Configure the application cache manifest
1414

15-
1. On the Windows 10 **Start** screen, click the **Desktop** tile.
16-
2. On the Windows taskbar, click **Microsoft Edge**.
17-
3. In the Microsoft Edge, press F10 to display the menu bar.
15+
1. On the **Start** menu, click the **Desktop** tile.
16+
2. On the taskbar, click Microsoft Edge.
17+
3. In Microsoft Edge, to display the menu bar, press F10.
1818
4. On the **Tools** menu, click **Internet options**.
1919
5. In the **Internet Options** dialog box, click **Settings**.
2020
6. In the **Website Data Settings** dialog box, click the **Caches and databases** tab.
2121
7. Select the **Allow website caches and databases** check box, and then click **OK**.
2222
8. In the **Internet Options** dialog box, click **OK**.
2323
9. Close Microsoft Edge.
24-
10. Open **Visual Studio 2017**.
24+
10. Open Microsoft Visual Studio 2017.
2525
11. In Visual Studio, on the **File** menu, point to **Open**, and then click **Project/Solution**.
26-
12. In the **Open Project** dialog box, browse to **Allfiles\Mod09\Labfiles\Starter\Exercise 1**, click **ContosoConf.sln**, and then click **Open**.
27-
13. In Solution Explorer, expand the **ContosoConf** project node, and then double-click **appcache.manifest**.
26+
12. In the **Open Project** dialog box, browse to **Allfiles\Mod09\Labfiles\Starter\Exercise 1**, and then open the **ContosoConf.sln** solution.
27+
13. In **Solution Explorer**, expand the **ContosoConf** project node, and then double-click **appcache.manifest**.
2828
14. Find the following comment:
29-
```javascript
29+
```javascript
3030
# TODO: Add index, about, schedule and location pages
31-
```
31+
```
3232
15. After the comment, type the following URLs:
33-
```javascript
33+
```javascript
3434
/index.htm
3535
/about.htm
3636
/location.htm
3737
/schedule.htm
38-
```
39-
16. In Solution Explorer, double-click **index.htm**.
40-
17. Add the **manifest** attribute to the **<html>** element, as shown in bold below:
41-
```html
38+
```
39+
16. In **Solution Explorer**, double-click **index.htm**.
40+
17. Add the **manifest** attribute to the **<html>** element, as shown below:
41+
```html
4242
<html lang="en" manifest="/appcache.manifest">
43-
```
44-
18. In Solution Explorer, double-click **about.htm**.
45-
19. Add the manifest attribute to the **&lt;html&gt;** element, as shown in bold below:
46-
```html
43+
```
44+
18. In **Solution Explorer**, double-click **about.htm**.
45+
19. Add the manifest attribute to the **&lt;html&gt;** element, as shown below:
46+
```html
4747
<html lang="en" manifest="/appcache.manifest">
48-
```
49-
20. In Solution Explorer, double-click **schedule.htm**.
50-
21. Add the manifest attribute to the **&lt;html&gt;** element, as shown in bold below:
51-
```html
48+
```
49+
20. In **Solution Explorer**, double-click **schedule.htm**.
50+
21. Add the **manifest** attribute to the **&lt;html&gt;** element, as shown below:
51+
```html
5252
<html lang="en" manifest="/appcache.manifest">
53-
```
54-
22. In Solution Explorer, double-click **location.htm**.
55-
23. Add the manifest attribute to the **&lt;html&gt;** element, as shown in bold below:
56-
```html
53+
```
54+
22. In **Solution Explorer**, double-click **location.htm**.
55+
23. Add the **manifest** attribute to the **&lt;html&gt;** element, as shown below:
56+
```html
5757
<html lang="en" manifest="/appcache.manifest">
58-
```
58+
```
5959

60-
#### Task 2: Detect offline mode by using JavaScript code.
60+
#### Task 2: Detect offline mode by using a JavaScript code
6161

62-
1. In Solution Explorer, expand the **scripts** folder, and then double-click **offline.js**.
62+
1. In **Solution Explorer**, expand the **scripts** folder, and then double-click **offline.js**.
6363
2. Find the following comment:
64-
```javascript
64+
```javascript
6565
// TODO: if currently offline, hide navigation links that require online
66-
```
66+
```
6767
3. After this comment, add the following JavaScript code:
68-
```javascript
68+
```javascript
6969
if (!navigator.onLine) {
7070
hideLinksThatRequireOnline();
7171
}
72-
```
72+
```
7373
4. Find the following comment:
74-
```javascript
74+
```javascript
7575
// TODO: add onoffline and ononline events to document.body
76-
```
76+
```
7777
5. After the second line of this comment, add the following JavaScript code:
78-
```javascript
78+
```javascript
7979
document.body.onoffline = hideLinksThatRequireOnline;
8080
document.body.ononline = showLinks;
81-
```
81+
```
8282
6. Find the following comment:
83-
```javascript
83+
```javascript
8484
// TODO: also handle the applicationCache error event to hide links
85-
```
85+
```
8686
7. After this comment, add the following JavaScript code:
87-
```javascript
87+
```javascript
8888
applicationCache.addEventListener("error", hideLinksThatRequireOnline, false);
89-
```
89+
```
9090

91-
#### Task 3: Test the application.
91+
#### Task 3: Test the application
9292

93-
1. In Solution Explorer, double-click **index.htm**.
93+
1. In **Solution Explorer**, double-click **index.htm**.
9494
2. On the **Debug** menu, click **Start Without Debugging**.
95-
3. In Microsoft Edge, if the message **Intranet settings are turned off by default** appears, click **Don’t show this message again**.
95+
3. In **Microsoft Edge**, if the **Intranet settings are turned off by default** message appears, click **Don’t show this message again**.
9696
4. Verify that Microsoft Edge displays the **Home** page.
97-
5. Expand the Windows notification area, right-click **IIS Express**, and then click **Exit**.
97+
5. Expand the Windows notification area, right-click **IIS Express**, and then select **Exit**.
9898

99-
>**Note:** When IIS Express first starts running, the IIS Express icon may appear in the Windows task bar rather than the notification area. If this occurs, right-click the **IIS Express** icon and then click **Exit**.
99+
>**Note**: When **IIS Express** first starts running, the **IIS Express** icon may appear on the taskbar rather than the notification area. If this occurs, right-click the **IIS Express** icon on the taskbar, and then select **Exit**.
100100
101101

102102
![alt text](./Images/20480B_9_IIS-Express.png "The IIS Express icon in the Windows notification area")
103103

104104
6. In the **Confirmation** dialog box, click **Yes**.
105105
7. In Microsoft Edge, click **Schedule**.
106106
8. Verify that the page loads and displays the schedule information.
107-
9. Wait five seconds, and then verify that the web site navigation bar no longer displays the **Register** link.
107+
9. Wait for five seconds, and then verify that the website navigation bar no longer displays the **Register** link.
108108
10. Click **About**.
109109
11. Verify that the page loads and displays the information describing the conference.
110-
12. Verify that the web site navigation bar no longer displays the **Register** link.
110+
12. Verify that the website navigation bar does not display the **Register** link.
111111
13. Close Microsoft Edge.
112112

113-
>**Results:** After completing this exercise, you will have modified the web application and made the **Home**, **About**, **Schedule**, and **Location** pages available offline.
113+
>**Results**: After completing this exercise, you will have modified the web application and made the **Home**, **About**, **Schedule**, and **Location** pages available offline.
114114
115-
### Exercise 2: Persisting User Data by Using the Local Storage API.
115+
### Exercise 2: Persisting User Data by Using the Local Storage API
116116

117-
#### Task 1: Observe the current behavior of the Schedule page.
117+
#### Task 1: Observe the current behavior of the Schedule page
118118

119119
1. In Visual Studio, on the **File** menu, click point to **Open**, and then click **Project/Solution**.
120-
2. In the **Open Project** dialog box, browse to **Allfiles\Mod09\Labfiles\Starter\Exercise 2**, click **ContosoConf.sln**, and then click **Open**.
121-
3. In Solution Explorer, expand the **ContosoConf** project, and then double-click **schedule.htm**.
120+
2. In the **Open Project** dialog box, browse to **Allfiles\Mod09\Labfiles\Starter\Exercise 2**, and then open the **ContosoConf.sln** solution.
121+
3. In **Solution Explorer**, expand the **ContosoConf** project, and then double-click **schedule.htm**.
122122
4. On the **Debug** menu, click **Start Without Debugging**.
123-
5. Expand the Windows notification area, right-click **IIS Express**, and then click **Exit**.
123+
5. Expand the Windows notification area, right-click **IIS Express**, and then select **Exit**.
124124
6. In the **Confirmation** dialog box, click **Yes**.
125-
7. In Microsoft Edge, click the star icon in the **Registration** box, and verify that the icon is now colored yellow.
125+
7. In Microsoft Edge, in the **Registration** box, click the star icon, and then verify that the icon is now colored yellow.
126126
8. Click **Refresh**.
127127
9. Verify that the star icon for **Registration** is now colored white.
128128
10. Close Microsoft Edge.
129129

130-
#### Task 2: Save information about starred session to local storage.
130+
#### Task 2: Save information about starred sessions to local storage
131131

132-
1. In Solution Explorer, expand the **ContosoConf** project, expand the **scripts** folder, and then double-click **LocalStarStorage.js**.
132+
1. In **Solution Explorer**, expand the **ContosoConf** project, expand the **scripts** folder, and then double-click **LocalStarStorage.js**.
133133
2. Find the following comments:
134-
```javascript
134+
```javascript
135135
// TODO: convert this.sessions into a JSON string
136136

137137
// TODO: save this JSON string into local storage as "stars"
138-
```
138+
```
139139
3. After the second comment, insert the following JavaScript code:
140-
```javascript
140+
```javascript
141141
this.localStorage.setItem("stars", JSON.stringify(this.sessions));
142-
```
142+
```
143143

144-
#### Task 3: Load information about starred session from local storage.
144+
#### Task 3: Load information about starred sessions from local storage
145145

146146
1. In **LocalStarStorage.js**, find the following comment:
147-
```javascript
147+
```javascript
148148
// TODO: get the "stars" from local storage
149-
```
149+
```
150150
2. After this comment, add the following JavaScript code:
151-
```javascript
151+
```javascript
152152
var json = this.localStorage.getItem("stars");
153-
```
153+
```
154154
3. Find the following comments:
155-
```javascript
155+
```javascript
156156
// TODO: parse the JSON string into this.sessions
157157

158158
// TODO: handle failures due to missing data etc
159-
```
159+
```
160160
4. After the second comment, add the following JavaScript code:
161-
```javascript
161+
```javascript
162162
if (json) {
163163
try {
164164
this.sessions = JSON.parse(json) || [];
@@ -168,71 +168,71 @@
168168
} else {
169169
this.sessions = [];
170170
}
171-
```
171+
```
172172

173-
#### Task 4: Use the local storage wrapper to save and load data in the Schedule page.
173+
#### Task 4: Use the local storage wrapper to save and load data in the Schedule page
174174

175-
1. In Solution Explorer, expand the **scripts** folder, then double-click **ScheduleItem.js**.
175+
1. In **Solution Explorer**, expand the **scripts** folder, then double-click **ScheduleItem.js**.
176176
2. Find the following comment:
177-
```javascript
177+
```javascript
178178
// TODO: Check if item is starred
179-
```
179+
```
180180
3. After this comment, add the following JavaScript code:
181-
```javascript
181+
```javascript
182182
if (localStarStorage.isStarred(this.id)) {
183183
this.element.classList.add(this.starredClass);
184184
}
185-
```
185+
```
186186
4. Find the following comment:
187-
```javascript
187+
```javascript
188188
// TODO: remove the star from the item
189-
```
190-
5. After this the comment, add the following JavaScript code:
191-
```javascript
189+
```
190+
5. After this comment, add the following JavaScript code:
191+
```javascript
192192
this.localStarStorage.removeStar(this.id);
193-
``
193+
```
194194
6. Find the following comment:
195-
```javascript
195+
```javascript
196196
// TODO: add a star to the item
197-
```
197+
```
198198
7. After this comment, add the following JavaScript code:
199-
```javascript
199+
```javascript
200200
this.localStarStorage.addStar(this.id);
201-
```
201+
```
202202

203-
#### Task 5: Test the application.
203+
#### Task 5: Test the application
204204

205-
1. In Solution Explorer, double-click **appcache.manifest**.
205+
1. In **Solution Explorer**, double-click **appcache.manifest**.
206206
2. Find the following line:
207-
```javascript
207+
```javascript
208208
CACHE MANIFEST
209-
```
209+
```
210210
3. After the line, insert the following line:
211-
```javascript
211+
```javascript
212212
# version 2
213-
```
214-
4. In Solution Explorer, double-click **schedule.htm**.
213+
```
214+
4. In **Solution Explorer**, double-click **schedule.htm**.
215215
5. On the **Debug** menu, click **Start Without Debugging**.
216-
6. In Microsoft Edge, press F5 to refresh the page.
217-
7. Expand the Windows notification area, right-click **IIS Express**, and then click **Exit**.
216+
6. In Microsoft Edge, to refresh the page, press F5.
217+
7. Expand the Windows notification area, right-click **IIS Express**, and then select **Exit**.
218218
8. In the **Confirmation** dialog box, click **Yes**.
219-
9. In Microsoft Edge, click the star icon in the **Registration** box, and verify that the icon is now colored yellow.
219+
9. In Microsoft Edge, click the star icon in the **Registration** box, and then verify that the icon is now colored yellow.
220220
10. Press F5.
221221
11. Verify that the star icon for **Registration** is still colored yellow.
222222
12. Close Microsoft Edge.
223223

224-
#### Task 6: Reset Microsoft Edge caching.
224+
#### Task 6: Reset Microsoft Edge caching
225225

226-
1. On the Windows taskbar, click **Microsoft Edge**.
227-
2. In the Microsoft Edge, press F10 to display the menu bar.
226+
1. On the taskbar, click **Microsoft Edge**.
227+
2. In Microsoft Edge, to display the menu bar, press F10.
228228
3. On the **Tools** menu, click **Internet options**.
229229
4. In the **Internet Options** dialog box, click **Settings**.
230230
5. In the **Website Data Settings** dialog box, click the **Caches and databases** tab.
231231
6. Clear the **Allow website caches and databases** check box, and then click **OK**.
232232
7. In the **Internet Options** dialog box, click **OK**.
233233
8. Close Microsoft Edge.
234234

235-
>**Results:** After completing this exercise, you will have updated the Schedule page to locally record starred sessions.
235+
>**Results**: After completing this exercise, you will have updated the **Schedule** page to record starred sessions locally.
236236
237237
©2018 Microsoft Corporation. All rights reserved.
238238

0 commit comments

Comments
 (0)