]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-shared.c
config: make empty js= omit script tag
[ps-cgit] / ui-shared.c
index c50b3e68568087221bb75ef25268af4d203b9338..baea6f2c84e9f168df4e29983e9593b1b2cf888a 100644 (file)
@@ -673,7 +673,7 @@ const struct date_mode *cgit_date_mode(enum date_mode_type type)
 static void print_rel_date(time_t t, int tz, double value,
        const char *class, const char *suffix)
 {
 static void print_rel_date(time_t t, int tz, double value,
        const char *class, const char *suffix)
 {
-       htmlf("<span class='%s' title='", class);
+       htmlf("<span class='%s' data-ut='%" PRIu64 "' title='", class, (uint64_t)t);
        html_attr(show_date(t, tz, cgit_date_mode(DATE_ISO8601)));
        htmlf("'>%.0f %s</span>", value, suffix);
 }
        html_attr(show_date(t, tz, cgit_date_mode(DATE_ISO8601)));
        htmlf("'>%.0f %s</span>", value, suffix);
 }
@@ -770,6 +770,10 @@ static void print_rel_vcs_link(const char *url)
 
 static int emit_css_link(struct string_list_item *s, void *arg)
 {
 
 static int emit_css_link(struct string_list_item *s, void *arg)
 {
+       /* Do not emit anything if css= is specified. */
+       if (s && *s->string == '\0')
+               return 0;
+
        html("<link rel='stylesheet' type='text/css' href='");
        if (s)
                html_attr(s->string);
        html("<link rel='stylesheet' type='text/css' href='");
        if (s)
                html_attr(s->string);
@@ -782,6 +786,10 @@ static int emit_css_link(struct string_list_item *s, void *arg)
 
 static int emit_js_link(struct string_list_item *s, void *arg)
 {
 
 static int emit_js_link(struct string_list_item *s, void *arg)
 {
+       /* Do not emit anything if js= is specified. */
+       if (s && *s->string == '\0')
+               return 0;
+
        html("<script type='text/javascript' src='");
        if (s)
                html_attr(s->string);
        html("<script type='text/javascript' src='");
        if (s)
                html_attr(s->string);