File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,8 @@ CHAPTERS := 00_intro 01_values 02_program_structure 03_functions 04_data 05_high
44
55SVGS := $(wildcard img/* .svg)
66
7- html : $(foreach CHAP,$(CHAPTERS ) ,html/$(CHAP ) .html) html/js/chapter_info.js html/js/ acorn_codemirror.js \
8- code/skillsharing.zip code/solutions/20_4_a_public_space_on_the_web.zip \
7+ html : $(foreach CHAP,$(CHAPTERS ) ,html/$(CHAP ) .html) html/js/acorn_codemirror.js \
8+ code/skillsharing.zip code/solutions/20_4_a_public_space_on_the_web.zip html/js/chapter_info.js \
99 $(patsubst img/%.svg,img/generated/%.png,$(SVGS))
1010
1111html/% .html : % .txt asciidoc_html.conf
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ dir.forEach(function(file) {
9292 solution : fs . readFileSync ( "code/solutions/20_3_creating_directories.js" , "utf8" )
9393 } ,
9494 { name : "A public space on the web" ,
95- file : "code/solutions/20_4_a_public_space_on_the_web" ,
95+ file : "code/solutions/20_4_a_public_space_on_the_web.zip " ,
9696 number : 4 ,
9797 type : "js" ,
9898 code : nodeInfo ,
Original file line number Diff line number Diff line change @@ -140,7 +140,11 @@ addEventListener("load", function() {
140140 type : exercise . type } ;
141141 setEditorCode ( exercise . code , exercise . type ) ;
142142 visible = "exercise" ;
143- document . querySelector ( "#download" ) . href = "data:text/plain;charset=UTF-8," + exercise . solution ;
143+ var link = document . querySelector ( "#download" ) ;
144+ if ( / \. z i p $ / . test ( exercise . file ) )
145+ link . href = exercise . file
146+ else
147+ link . href = "data:text/plain;charset=UTF-8," + exercise . solution ;
144148 }
145149 [ "box" , "exercise" ] . forEach ( function ( id ) {
146150 document . querySelector ( "#" + id + "_info" ) . style . display =
You can’t perform that action at this time.
0 commit comments