File tree Expand file tree Collapse file tree 2 files changed +48
-1
lines changed
Expand file tree Collapse file tree 2 files changed +48
-1
lines changed Original file line number Diff line number Diff line change 1+ [
2+ {
3+ className: "Academic Reading: Mastering True/False/Not Given",
4+ youtubeIframe: '<iframe width="560" height="315" src="https://www.youtube.com/embed/dQw4w9WgXcQ" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>'
5+ },
6+ {
7+ className: "Speed Reading Techniques for Section 3",
8+ youtubeIframe: '<iframe width="560" height="315" src="https://www.youtube.com/embed/example2" title="YouTube video player" frameborder="0" allowfullscreen></iframe>'
9+ },
10+ {
11+ className: "Matching Headings: The 'Elimination' Method",
12+ youtubeIframe: '<iframe width="560" height="315" src="https://www.youtube.com/embed/example3" title="YouTube video player" frameborder="0" allowfullscreen></iframe>'
13+ }
14+ ]
Original file line number Diff line number Diff line change @@ -20,7 +20,40 @@ function renderPlaylist() {
2020 $ ( '#title' ) . text ( title ) ;
2121 }
2222
23-
23+ let url ;
24+ let tutorials = [ ] ;
25+
26+ if ( topic == 'listening' ) {
27+ url = 'https://brainandbinary.github.io/1991/javascripts/listening.json' ;
28+ }
29+
30+ if ( topic == 'reading' ) {
31+ url = 'https://brainandbinary.github.io/1991/javascripts/reading.json' ;
32+ }
33+
34+ if ( topic == 'writing' ) {
35+ url = 'https://brainandbinary.github.io/1991/javascripts/writing.json' ;
36+ }
37+
38+ if ( topic == 'speaking' ) {
39+ url = 'https://brainandbinary.github.io/1991/javascripts/speaking.json' ;
40+ }
41+
42+ if ( topic == 'basic-speaking' ) {
43+ url = 'https://brainandbinary.github.io/1991/javascripts/basic-speaking.json' ;
44+ }
45+
46+ if ( topic == 'basic-english' ) {
47+ url = 'https://brainandbinary.github.io/1991/javascripts/basic-english.json' ;
48+ }
49+
50+ try {
51+ const response = await fetch ( url ) ;
52+ // 1. 'data' will be the array [ {className: ...}, {className: ...} ]
53+ tutorials = await response . json ( ) ;
54+ } catch ( e ) {
55+ console . log ( e )
56+ }
2457
2558
2659 const container = document . getElementById ( 'list-wrapper' ) ;
You can’t perform that action at this time.
0 commit comments