Skip to content

Commit ddecb44

Browse files
committed
Remove weird link tags around relative GH link
Formatters getting too smart for their own good.
1 parent 22552bc commit ddecb44

File tree

3 files changed

+60
-63
lines changed

3 files changed

+60
-63
lines changed

exercises/01 - JavaScript Drum Kit/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575

7676
keyelement.classList.add('playing');
7777

78-
soundclip.currentTime = 0; // Play sou
78+
soundclip.currentTime = 0; // Play sound
7979

8080
soundclip.play();
8181
}

exercises/06 - Type Ahead/index.html

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -17,52 +17,49 @@
1717
</ul>
1818
</form>
1919
<script>
20-
const endpoint = 'https://gist.githubusercontent.com/Miserlou/c5cd8364bf9b2420bb29/raw/2bf258763cdddd704f8ffd3ea9a3e81d25e2c6f6/cities.json';
20+
(() => {
21+
const endpoint = 'https://gist.githubusercontent.com/Miserlou/c5cd8364bf9b2420bb29/raw/2bf258763cdddd704f8ffd3ea9a3e81d25e2c6f6/cities.json';
2122

22-
// Step 1
23-
const cities = [],
24-
searchInput = document.querySelector('.search'),
25-
suggestions = document.querySelector('.suggestions');
23+
// Step 1
24+
const cities = [],
25+
searchInput = document.querySelector('.search'),
26+
suggestions = document.querySelector('.suggestions');
2627

27-
// Step 2
28-
fetch(endpoint)
29-
.then(blob => blob.json())
30-
.then(data => cities.push(...data))
28+
// Step 2
29+
fetch(endpoint)
30+
.then(blob => blob.json())
31+
.then(data => cities.push(...data))
3132

32-
// Step 4
33-
function matchInput(inputString, cities) {
34-
return cities.filter((location) => {
33+
// Step 4
34+
const matchInput = (inputString, cities) => cities.filter((location) => {
3535
const regex = new RegExp(inputString, 'gi');
3636
return location.city.match(regex) || location.state.match(regex)
3737
});
38-
}
3938

40-
// Step 6
41-
function numberWithCommas(x) {
42-
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
43-
}
39+
// Step 6
40+
const numberWithCommas = (x) => x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
4441

45-
// Step 5
46-
function displayMatches() {
47-
const matchArray = matchInput(this.value, cities)
42+
// Step 5
43+
const displayMatches = (el) => {
44+
const matchArray = matchInput(el.value, cities)
4845

49-
const suggestionList = matchArray.map((location => {
50-
const regex = new RegExp(this.value, 'gi');
51-
const cityName = location.city.replace(regex, `<span class ="hl">${this.value}</span>`);
52-
const stateName = location.state.replace(regex, `<span class="hl">${this.value}</span>`);
53-
return `
46+
const suggestionList = matchArray.map((location => {
47+
const regex = new RegExp(el.value, 'gi');
48+
const cityName = location.city.replace(regex, `<span class ="hl">${el.value}</span>`);
49+
const stateName = location.state.replace(regex, `<span class="hl">${el.value}</span>`);
50+
return `
5451
<li>
5552
<span class="name">${cityName}, ${stateName}</span>
5653
<span class="population">${numberWithCommas(location.population)}</span>
5754
</li>`;
58-
})).join('');
59-
suggestions.innerHTML = suggestionList;
60-
}
61-
62-
// Step 3
63-
searchInput.addEventListener('keyup', displayMatches);
55+
})).join('');
56+
suggestions.innerHTML = suggestionList;
57+
}
6458

59+
// Step 3
60+
searchInput.addEventListener('keyup', (e) => displayMatches(searchInput));
61+
})();
6562
</script>
6663
</body>
6764

68-
</html>
65+
</html>

readme.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -44,33 +44,33 @@ The starter files (available [here](https://github.com/wesbos/JavaScript30)) inc
4444

4545
## Table Of Contents
4646

47-
1. [JavaScript Drum Kit](<./exercises/01\ -\ JavaScript\ Drum\ Kit/>)
48-
2. [JS + CSS Clock](<./exercises/02\ -\ JS\ +\ CSS\ Clock/>)
49-
3. [CSS Variables](<./exercises/03\ -\ CSS\ Variables/>)
50-
4. [Array Cardio, Day 1](<./exercises/04\ -\ Array\ Cardio\ Day\ 1/>)
51-
5. [Flex Panel Gallery](<./exercises/05\ -\ Flex\ Panel\ Gallery/>)
52-
6. [Type Ahead](<./exercises/06\ -\ Type\ Ahead/>)
53-
7. [Array Cardio, Day 2](<./exercises/07\ -\ Array\ Cardio\ Day\ 2/>)
54-
8. [Fun with HTML5 Canvas](<./exercises/08\ -\ Fun\ with\ HTML5\ Canvas/>)
55-
9. [Dev Tools Domination](<./exercises/09\ -\ DevTools\ Domination/>)
56-
10. [Hold Shift and Check Checkboxes](<./exercises/10\ -\ Hold\ Shift\ and\ Check\ Checkboxes/>)
57-
11. [Custom Video Player](<./exercises/11\ -\ Custom\ Video\ Player/>)
58-
12. [Key Sequence Detection](<./exercises/12\ -\ Key\ Sequence\ Detection/>)
59-
13. [Slide in on Scroll](<./exercises/13\ -\ Slide\ in\ on\ Scroll/>)
60-
14. [JavaScript References vs. Copying](<./exercises/14\ -\ JavaScript\ References\ VS\ Copying>)
61-
15. [LocalStorage](<./exercises/15\ -\ LocalStorage/>)
62-
16. [Mouse Move Shadow](<./exercises/16\ -\ Mouse\ Move\ Shadow/>)
63-
17. [Sort Without Articles](<./exercises/17\ -\ Sort\ Without\ Articles/>)
64-
18. [Adding Up Times with Reduce](<./exercises/18\ -\ Adding\ Up\ Times\ with\ Reduce/>)
65-
19. [Webcam Fun](<./exercises/19\ -\ Webcam\ Fun/>)
66-
20. [Speech Detection](<./exercises/20\ -\ Speech\ Detection/>)
67-
21. [Geolocation](<./exercises/21\ -\ Geolocation/>)
68-
22. [Follow Along Link Highlighter](<./exercises/22\ -\ Follow\ Along\ Link\ Highlighter/>)
69-
23. [Speech Synthesis](<./exercises/23\ -\ Speech\ Synthesis/>)
70-
24. [Sticky Nav](<./exercises/24\ -\ Sticky\ Nav/>)
71-
25. [Event Capture, Propagation, Bubbling, and Once](<./exercises/25\ -\ Event\ Capture,\ Propagation,\ Bubbling\ and\ Once/>)
72-
26. [Stripe Follow Along Nav](<./exercises/26\ -\ Stripe\ Follow\ Along\ Nav/>)
73-
27. [Click and Drag](<./exercises/27\ -\ Click\ and\ Drag/>)
74-
28. [Video Speed Controller](<./exercises/28\ -\ Video\ Speed\ Controller/>)
75-
29. [Countdown Timer](<./exercises/29\ -\ Countdown\ Timer/>)
76-
30. [Whack A Mole](<./exercises/30\ -\ Whack\ A\ Mole/>)
47+
1. [JavaScript Drum Kit](./exercises/01\ -\ JavaScript\ Drum\ Kit/)
48+
2. [JS + CSS Clock](./exercises/02\ -\ JS\ +\ CSS\ Clock/)
49+
3. [CSS Variables](./exercises/03\ -\ CSS\ Variables/)
50+
4. [Array Cardio, Day 1](./exercises/04\ -\ Array\ Cardio\ Day\ 1/)
51+
5. [Flex Panel Gallery](./exercises/05\ -\ Flex\ Panel\ Gallery/)
52+
6. [Type Ahead](./exercises/06\ -\ Type\ Ahead/)
53+
7. [Array Cardio, Day 2](./exercises/07\ -\ Array\ Cardio\ Day\ 2/)
54+
8. [Fun with HTML5 Canvas](./exercises/08\ -\ Fun\ with\ HTML5\ Canvas/)
55+
9. [Dev Tools Domination](./exercises/09\ -\ DevTools\ Domination/)
56+
10. [Hold Shift and Check Checkboxes](./exercises/10\ -\ Hold\ Shift\ and\ Check\ Checkboxes/)
57+
11. [Custom Video Player](./exercises/11\ -\ Custom\ Video\ Player/)
58+
12. [Key Sequence Detection](./exercises/12\ -\ Key\ Sequence\ Detection/)
59+
13. [Slide in on Scroll](./exercises/13\ -\ Slide\ in\ on\ Scroll/)
60+
14. [JavaScript References vs. Copying](./exercises/14\ -\ JavaScript\ References\ VS\ Copying)
61+
15. [LocalStorage](./exercises/15\ -\ LocalStorage/)
62+
16. [Mouse Move Shadow](./exercises/16\ -\ Mouse\ Move\ Shadow/)
63+
17. [Sort Without Articles](./exercises/17\ -\ Sort\ Without\ Articles/)
64+
18. [Adding Up Times with Reduce](./exercises/18\ -\ Adding\ Up\ Times\ with\ Reduce/)
65+
19. [Webcam Fun](./exercises/19\ -\ Webcam\ Fun/)
66+
20. [Speech Detection](./exercises/20\ -\ Speech\ Detection/)
67+
21. [Geolocation](./exercises/21\ -\ Geolocation/)
68+
22. [Follow Along Link Highlighter](./exercises/22\ -\ Follow\ Along\ Link\ Highlighter/)
69+
23. [Speech Synthesis](./exercises/23\ -\ Speech\ Synthesis/)
70+
24. [Sticky Nav](./exercises/24\ -\ Sticky\ Nav/)
71+
25. [Event Capture, Propagation, Bubbling, and Once](./exercises/25\ -\ Event\ Capture,\ Propagation,\ Bubbling\ and\ Once/)
72+
26. [Stripe Follow Along Nav](./exercises/26\ -\ Stripe\ Follow\ Along\ Nav/)
73+
27. [Click and Drag](./exercises/27\ -\ Click\ and\ Drag/)
74+
28. [Video Speed Controller](./exercises/28\ -\ Video\ Speed\ Controller/)
75+
29. [Countdown Timer](./exercises/29\ -\ Countdown\ Timer/)
76+
30. [Whack A Mole](./exercises/30\ -\ Whack\ A\ Mole/)

0 commit comments

Comments
 (0)