81 |
|
|
82 |
fprintf(output, "<html><head><title>%s</title>\n", relative_path); |
fprintf(output, "<html><head><title>%s</title>\n", relative_path); |
83 |
fprintf(output, "<link rel=\"stylesheet\" type='text/css' href='%sjscoverage.css'>\n", relative_path_to_ancestor); |
fprintf(output, "<link rel=\"stylesheet\" type='text/css' href='%sjscoverage.css'>\n", relative_path_to_ancestor); |
84 |
fprintf(output, "<link rel=\"stylesheet\" type='text/css' href='%ssh_nedit.css'>\n", relative_path_to_ancestor); |
fprintf(output, "<link rel=\"stylesheet\" type='text/css' href='%sjscoverage-sh_nedit.css'>\n", relative_path_to_ancestor); |
85 |
fprintf(output, "<script src=\"%sjscoverage.js\"></script>\n", relative_path_to_ancestor); |
fprintf(output, "<script src=\"%sjscoverage.js\"></script>\n", relative_path_to_ancestor); |
86 |
fprintf(output, "<script src=\"%ssh_main.js\"></script>\n", relative_path_to_ancestor); |
fprintf(output, "<script src=\"%sjscoverage-sh_main.js\"></script>\n", relative_path_to_ancestor); |
87 |
fprintf(output, "<script src=\"%ssh_javascript.min.js\"></script>\n", relative_path_to_ancestor); |
fprintf(output, "<script src=\"%sjscoverage-sh_javascript.js\"></script>\n", relative_path_to_ancestor); |
88 |
fprintf(output, "<script>\n"); |
fprintf(output, "<script>\n"); |
89 |
fprintf(output, "var gCurrentFile = \"%s\";\n", relative_path); |
fprintf(output, "var gCurrentFile = \"%s\";\n", relative_path); |
90 |
fprintf(output, "</script>\n"); |
fprintf(output, "</script>\n"); |
162 |
copy_file(source_file, destination_file); |
copy_file(source_file, destination_file); |
163 |
break; |
break; |
164 |
case FILE_TYPE_JS: |
case FILE_TYPE_JS: |
|
highlight_file(source_file, destination_file, id); |
|
165 |
{ |
{ |
166 |
FILE * input = xfopen(source_file, "r"); |
FILE * input = xfopen(source_file, "r"); |
167 |
FILE * output = xfopen(destination_file, "w"); |
FILE * output = xfopen(destination_file, "w"); |
168 |
jscoverage_instrument_js(id, input, output); |
const char * suffix = ".jscoverage.js"; |
169 |
|
char temporary_file_name[strlen(destination_file) + strlen(suffix) + 1]; |
170 |
|
strcpy(temporary_file_name, destination_file); |
171 |
|
strcat(temporary_file_name, suffix); |
172 |
|
jscoverage_instrument_js(id, input, output, temporary_file_name); |
173 |
fclose(input); |
fclose(input); |
174 |
fclose(output); |
fclose(output); |
175 |
} |
} |
176 |
|
highlight_file(source_file, destination_file, id); |
177 |
break; |
break; |
178 |
} |
} |
179 |
} |
} |
229 |
fatal("cannot stat directory: %s", destination); |
fatal("cannot stat directory: %s", destination); |
230 |
} |
} |
231 |
|
|
232 |
|
/* copy the resources */ |
233 |
|
jscoverage_copy_resources(destination); |
234 |
|
|
235 |
/* finally: copy the directory */ |
/* finally: copy the directory */ |
236 |
struct DirListEntry * list = make_recursive_dir_list(source); |
struct DirListEntry * list = make_recursive_dir_list(source); |
237 |
for (struct DirListEntry * p = list; p != NULL; p = p->next) { |
for (struct DirListEntry * p = list; p != NULL; p = p->next) { |
277 |
copy_resource("jscoverage.css", destination_directory); |
copy_resource("jscoverage.css", destination_directory); |
278 |
copy_resource("jscoverage.js", destination_directory); |
copy_resource("jscoverage.js", destination_directory); |
279 |
copy_resource("jscoverage-throbber.gif", destination_directory); |
copy_resource("jscoverage-throbber.gif", destination_directory); |
280 |
copy_resource("sh_main.js", destination_directory); |
copy_resource("jscoverage-sh_main.js", destination_directory); |
281 |
copy_resource("sh_javascript.min.js", destination_directory); |
copy_resource("jscoverage-sh_javascript.js", destination_directory); |
282 |
copy_resource("sh_nedit.css", destination_directory); |
copy_resource("jscoverage-sh_nedit.css", destination_directory); |
283 |
} |
} |