From 72904bbd1a2f471d17f43c2c84d31a840e7e4ae7 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Sat, 23 Jun 2018 18:25:53 +0800 Subject: config: add js Just like the config allows setting css URL path, add a config for setting the js URL path Setting the js path to an empty string disables emitting the reference to it in the head section. Signed-off-by: Andy Green Reviewed-by: John Keeping Signed-off-by: Christian Hesse --- ui-shared.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'ui-shared.c') diff --git a/ui-shared.c b/ui-shared.c index f998912..e6def60 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -780,6 +780,15 @@ static int emit_css_link(struct string_list_item *s, void *arg) return 0; } +static int emit_js_link(struct string_list_item *s, void *arg) +{ + html("\n"); + + return 0; +} + void cgit_print_docstart(void) { char *host = cgit_hosturl(); @@ -805,6 +814,8 @@ void cgit_print_docstart(void) else emit_css_link(NULL, "/cgit.css"); + for_each_string_list(&ctx.cfg.js, emit_js_link, NULL); + if (ctx.cfg.favicon) { html("