Skip to content

Updating foundation #1

Merged
merged 50 commits into from
Oct 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
f694407
Test
handley7 Sep 17, 2019
ddb628d
Fixed inconsistency with test suite
harjaus Sep 20, 2019
660bcf1
Added missing file for sheet 06.
harjaus Sep 20, 2019
0d5f324
Merge pull request #6 from harjaus/master
aa7401 Sep 20, 2019
73dfc6a
Changed sheet to specify which folder
harjaus Sep 20, 2019
3e5f457
Added missing files
harjaus Sep 20, 2019
e486943
Merge pull request #7 from harjaus/master
harjaus Sep 20, 2019
d2c7f53
Minor spelling mistake
harjaus Sep 21, 2019
745c463
Merge pull request #8 from harjaus/master
harjaus Sep 21, 2019
beb81da
Merge remote-tracking branch 'upstream/master'
handley7 Sep 21, 2019
9a87865
Update 01 Setup.md for Windows 10 WSL setup
handley7 Sep 21, 2019
36d7da9
Update 01 Setup.md
handley7 Sep 21, 2019
a8c2edb
Merge branch 'master' of https://github.coventry.ac.uk/handley7/found…
handley7 Sep 21, 2019
c6dd19d
Update images for WSL tutorial in 01 Setup.md
handley7 Sep 21, 2019
08c89b7
Update 01 Setup.md
handley7 Sep 21, 2019
de5af6f
Merge pull request #9 from handley7/master
aa7401 Sep 21, 2019
2c5dcaa
improved clarity of task
aa7401 Sep 22, 2019
da834a3
Merge branch 'master' of https://github.coventry.ac.uk/web/foundation
aa7401 Sep 22, 2019
1c19206
updated extensions list
aa7401 Sep 24, 2019
2456d1c
minor spelling amendment
charle44 Sep 24, 2019
afd9df0
Merge pull request #10 from charle44/patch-1
harjaus Sep 24, 2019
c78e77d
updated name of extension
aa7401 Sep 26, 2019
fd6f91d
added notes on debugging the test explorer
aa7401 Sep 26, 2019
1054bd3
Merge branch 'master' of https://github.coventry.ac.uk/web/foundation
aa7401 Sep 26, 2019
b9fed75
added extra task to lab
aa7401 Sep 26, 2019
ddc5667
shortcut
charle44 Sep 28, 2019
c5881dd
03_html/05_semantic change & video word change
charle44 Oct 1, 2019
44e093f
updated the lab list and deleted old notes
aa7401 Oct 2, 2019
7d0bc7d
Merge pull request #13 from charle44/patch-2
aa7401 Oct 2, 2019
888e37d
Merge pull request #15 from charle44/patch-4
aa7401 Oct 2, 2019
f143f1b
added async examples
aa7401 Oct 3, 2019
2f87891
Merge branch 'master' of https://github.coventry.ac.uk/web/foundation
aa7401 Oct 3, 2019
f24e9df
Fixed error in code under 4.4 Static Members
aa6164 Oct 6, 2019
c593b3e
added login project
aa7401 Oct 7, 2019
53fc0b6
updated lab sheet
aa7401 Oct 7, 2019
c1649a0
fixed missing file
aa7401 Oct 8, 2019
7cb6b16
Merge branch 'master' of https://github.coventry.ac.uk/web/foundation
aa7401 Oct 8, 2019
15b4db6
fixed issue
aa7401 Oct 8, 2019
6340dc7
fixed module name
aa7401 Oct 8, 2019
8449b58
another bug fixed
aa7401 Oct 8, 2019
357f86f
added open file debug option
aa7401 Oct 8, 2019
006c796
Merge branch 'master' of https://github.coventry.ac.uk/web/foundation
aa7401 Oct 8, 2019
21c2366
replaced api used
aa7401 Oct 9, 2019
393a730
added a currencies data file
aa7401 Oct 9, 2019
ca82a75
fixed all urls
aa7401 Oct 9, 2019
7564ca2
added async functions file
aa7401 Oct 9, 2019
053389a
deleted old readme file
aa7401 Oct 9, 2019
d4ddbc7
started mocking file system
aa7401 Oct 9, 2019
64be017
Merge branch 'master' of https://github.coventry.ac.uk/web/foundation
aa7401 Oct 9, 2019
87c1585
fixed text input issue
aa7401 Oct 11, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
"semi": [1, "never"],
"space-before-blocks": ["error", { "functions": "always", "keywords": "always", "classes": "always" }],
"space-before-function-paren": [2, "never"],
"strict": [2, "global"],
"yoda": 2
},
"overrides": [{
Expand Down
6 changes: 6 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Current Opened File",
"program": "${file}"
},
{
"type": "node",
"request": "launch",
Expand Down
31 changes: 31 additions & 0 deletions 01 Setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,37 @@ Press CTRL-SHIFT-P and a selection box should appear at the top of the editor. T

Now the integrated terminal uses the _Bash Shell_ meaning you can use the standard *nix bash commands!

# If _Bash Shell_ is _not_ listed on your Windows 10 machine

On some versions of Windows 10, some extra configuration is required before Bash Shell is able to be selected within VS Code. If this is the case on your machine, follow the below troubleshooting steps before reattempting to change your shell as above.

To start, we need to make sure Developer Mode is enabled in the Update and Security section of Windows 10. Press **WIN+R** (Windows Key and R simultaneosly) to open a Run dialog. In the dialog enter **ms-settings:developers** followed by the enter key. The window shown below should appear on screen.

![Enabling Windows 10 Developer Mode](exercises/.images/developerMode.PNG)

Select the **Developer mode** radio button and **yes** on any succeeding dialog boxes. Wait for any neccessary installations to complete.

Once that has completed, we need to enable the WSL (Windows Subsystem for Linux). Press **WIN+R**, in the dialog enter **powershell** followed by the enter key. In the powershell window copy and paste the following:

```
Start-Process powershell -Verb runAs
exit
```

Press the enter key and accept the UAC (User Account Control) dialog. A new powershell window will launch with Administrator rights.

Copy and paste the following:

```
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
```

Press the enter key and wait for the process to complete. Once complete, restart your computer before continuing.

Finally, we need to install [Ubuntu from the Microsoft Store](https://www.microsoft.com/en-gb/p/ubuntu/9nblggh4msv6?activetab=pivot:overviewtab). Click the blue **Get** button and accept any dialogs to launch the Microsoft Store and begin the installation. Once Ubuntu for WSL (Windows Subsystem for Linux) has installed, restart Windows.

Once restarted, reattempt to enable Bash Shell in VS Code as per the section above.

## 1 Forking the Foundation Materials

You should start by logging in to the University GitHub server using your university username and password. Make sure you don't log into GitHub.com!
Expand Down
4 changes: 2 additions & 2 deletions 02 HTTP.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Start the server and access the `/books/1` route. What is displayed in the web b
2. Note that it is itself a JavaScript object and that it contains a single property called `index` which matches the name of the URL segment.
3. The value of this property is the string we added to the URL.
4. This index value is used to look up the title of the book in the array, the book title is stored in a constant.
5. Finally the book title is send to the web browser.
5. Finally the book title is sent to the web browser.

#### 1.3.1 Core Knowledge

Expand Down Expand Up @@ -178,7 +178,7 @@ Make sure the server is still running and use the [Chrome web browser](https://w
1. Open the [Chrome Developer Tools](https://developers.google.com/web/tools/chrome-devtools/) by clicking on the _customise and control Google Chrome tools_ button (the three dots to the extreme right of the address bar).
2. Choose **More tools** from the menu and then **Developer tools** from the submenu.
3. Locate the **Network** tab in the Chrome developer tools.
4. Reload the web page.
4. Reload the web page. (Press F5)
5. You should now see the resource sent in the HTTP response together with some data dealing with response times.
6. Click on the file name (as shown) to display the HTTP headers.

Expand Down
4 changes: 2 additions & 2 deletions 03 HTML5.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ Now we will learn how to embed audio in a website. There are a number of resourc

1. Add the `guitar` audio file to the `index.html` web page. The file has been provided in the two required formats.
1. Test that the audio plays in both Firefox and Chrome.
2. Can you modify the `<audio>` element to make the video auto-play?
2. Can you modify the `<audio>` element to make the sound auto-play?
2. Add the `coventry` video clip to the `index.html` file, again the file has been provided in both formats (note that you will need to change one of the extensions from `.mp5` to `.mp4`).
1. Test the video using both Firefox and Chrome.
2. Restrict the video window to 320px wide without stretching the image.
Expand Down Expand Up @@ -250,7 +250,7 @@ Verify that you understand the elements used in marking up the table:

## 5 Semantic Markup

In this final exercise we will look at how [MicroData](https://developer.mozilla.org/en-US/docs/Web/HTML/Microdata) can be used to add semantic information to a web page. Start by using the SSH Terminal to run the server in the `exercises/03_html/06_semantic/` directory and navigating to the base route `/`. This should display a simple review page.
In this final exercise we will look at how [MicroData](https://developer.mozilla.org/en-US/docs/Web/HTML/Microdata) can be used to add semantic information to a web page. Start by using the SSH Terminal to run the server in the `exercises/03_html/05_semantic/` directory and navigating to the base route `/`. This should display a simple review page.

1. Paste the URL into the [Rich Snippets Tool](http://www.google.com/webmasters/tools/richsnippets) to see what semantic data it contains. Notice:
1. There are two **items** on in the webpage, a movie and a rating. These are defined using the `itemscope` attribute in the html. Each item has an `itemtype` attribute that points to the appropriate Microdata definition.
Expand Down
9 changes: 5 additions & 4 deletions 05 JavaScript.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const biggest = largestNumber(5, 8)
1. The function is declared using the `function` keyword and the function is given a name which must be a valid variable name.
- If the name comprises more than one word these should be written using camel casing as shown above. This is known as a **Function Declaration**
2. The function above takes two parameters, `a` and `b`.
- These are variables with local scope (they can't ba accessed outside the function)
- These are variables with local scope (they can't be accessed outside the function)
- When the function is called, you need to pass two **values** which get assigned to the two parameters.
- If you pass too many values the extra ones get _ignored_.
- If you don't pass enough values the remainder are assigned a value of `null`. `Null` is an assignment value (means a value of no value).
Expand Down Expand Up @@ -98,8 +98,9 @@ const sqr = num => num * num
1. Refactor the `remainder2` function expression to take advantage of the implicit return (you will need to reduce it to a single line of code).
2. Compare this to the original version: which is more _readable_?
3. Create a function expression that takes two string parameters and returns the longest string and assign this to a constant called `longest. check this works correctly.
4. Modify the function expression so that it can handle any number of string parameters (use a _rest parameter_).
5. Can you reduce this function expression to a single line (hint: explore using the [reduce function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce) combined with the [ternary operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator))?
4. Modify the function expression so that it can handle any number of string parameters (use a _rest parameter_). (hint: you will need to use a [`for...in`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in) statement to loop through the strings. How does this differ from a [`for...of`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of) statement?)
5. Use a [ternary operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator) instead of the `if` statement in the loop.
6. Finally use the [`reduce()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce) method to replace the `for...in` loop to reduce the function to a single line.

## 2 Callbacks

Expand Down Expand Up @@ -563,7 +564,7 @@ class Student extends Person {
Currently each instance of a prototype function is completely self-contained. What if we need to store data about the prototype function itself? In a traditional OOP language we would use static methods and the new ECMA `class` syntax allows us to do something similar by adding properties to the prototype function itself. We can also define static methods that can be called directly from the prototype function, see the example below.

```javascript
class Student {
class ECMA6Student extends Person {
constructor(name, startYear, course) {
super(name, startYear)
this.subject = course || 'not enrolled'
Expand Down
Loading