Bolden the current item in .page_subhead
[gitweb] / gitweb.cgi
index f57ed5a65700e539c8a0054866873f39ddec79e7..1de74b658fa613e490aea3ac12eb3a6c533fd8e1 100755 (executable)
@@ -4310,10 +4310,10 @@ sub git_footer_html {
                insert_file($site_footer);
        }
 
-       print qq!<script type="text/javascript" src="!.esc_url($javascript).qq!"></script>\n!;
        if (defined $action &&
            $action eq 'blame_incremental') {
-               print qq!<script type="text/javascript">\n!.
+               print qq!<script src="!.esc_url($javascript).qq!"></script>\n!;
+               print qq!<script>\n!.
                      qq!startBlame("!. esc_attr(href(action=>"blame_data", -replay=>1)) .qq!",\n!.
                      qq!           "!. esc_attr(href()) .qq!");\n!.
                      qq!</script>\n!;
@@ -4321,17 +4321,20 @@ sub git_footer_html {
                my ($jstimezone, $tz_cookie, $datetime_class) =
                        gitweb_get_feature('javascript-timezone');
 
-               print qq!<script type="text/javascript">\n!.
-                     qq!window.onload = function () {\n!;
-               if (gitweb_check_feature('javascript-actions')) {
-                       print qq!       fixLinks();\n!;
-               }
-               if ($jstimezone && $tz_cookie && $datetime_class) {
-                       print qq!       var tz_cookie = { name: '$tz_cookie', expires: 14, path: '/' };\n!. # in days
-                             qq!       onloadTZSetup('$jstimezone', tz_cookie, '$datetime_class');\n!;
+               if (gitweb_check_feature('javascript-actions') || ($jstimezone && $tz_cookie && $datetime_class)) {
+                       print qq!<script src="!.esc_url($javascript).qq!"></script>\n!;
+                       print qq!<script>\n!.
+                               qq!window.onload = function () {\n!;
+                       if (gitweb_check_feature('javascript-actions')) {
+                               print qq!       fixLinks();\n!;
+                       }
+                       if ($jstimezone && $tz_cookie && $datetime_class) {
+                               print qq!       var tz_cookie = { name: '$tz_cookie', expires: 14, path: '/' };\n!. # in days
+                                       qq!     onloadTZSetup('$jstimezone', tz_cookie, '$datetime_class');\n!;
+                       }
+                       print qq!};\n!.
+                               qq!</script>\n!;
                }
-               print qq!};\n!.
-                     qq!</script>\n!;
        }
 
        print "</body>\n" .
@@ -4429,7 +4432,7 @@ sub git_print_page_nav {
        print "<div class=\"page_nav\">\n" .
                (join " | ",
                 map { $_ eq $current ?
-                      $_ : $cgi->a({-href => ($arg{$_}{_href} ? $arg{$_}{_href} : href(%{$arg{$_}}))}, "$_")
+                      $cgi->span({-class => "current"}, $_) : $cgi->a({-href => ($arg{$_}{_href} ? $arg{$_}{_href} : href(%{$arg{$_}}))}, "$_")
                 } @navs);
        print "<br/>\n$extra" if defined $extra; # pager or formats
        print "</div>\n";
@@ -4546,9 +4549,6 @@ sub format_timestamp_html {
        }
 
        my $localtime_format = '(%02d:%02d %s)';
-       if ($date->{'hour_local'} < 6) {
-               $localtime_format = '(<span class="atnight">%02d:%02d</span> %s)';
-       }
        $strtime .= ' ' .
                    sprintf($localtime_format,
                            $date->{'hour_local'}, $date->{'minute_local'}, $date->{'tz_local'});
@@ -4583,7 +4583,7 @@ sub git_print_authorship_rows {
        @people = ('author', 'committer') unless @people;
        foreach my $who (@people) {
                my %wd = parse_date($co->{"${who}_epoch"}, $co->{"${who}_tz"});
-               print "<tr><td>$who</td><td>" .
+               print "<tr><th>$who</th><td>" .
                      format_search_author($co->{"${who}_name"}, $who,
                                           esc_html($co->{"${who}_name"})) . " " .
                      format_search_author($co->{"${who}_email"}, $who,
@@ -4682,11 +4682,6 @@ sub git_print_log {
 
                print format_log_line_html($line) . "<br/>\n";
        }
-
-       if ($opts{'-final_empty_line'}) {
-               # end with single empty line
-               print "<br/>\n" unless $skip_blank_line;
-       }
 }
 
 # return link target (what link points to)
@@ -5928,13 +5923,12 @@ sub git_log_body {
                      $cgi->a({-href => href(action=>"commitdiff", hash=>$commit)}, "commitdiff") .
                      " | " .
                      $cgi->a({-href => href(action=>"tree", hash=>$commit, hash_base=>$commit)}, "tree") .
-                     "<br/>\n" .
                      "</div>\n";
                      git_print_authorship(\%co, -tag => 'span');
-                     print "<br/>\n</div>\n";
+                     print "</div>\n";
 
                print "<div class=\"log_body\">\n";
-               git_print_log($co{'comment'}, -final_empty_line=> 1);
+               git_print_log($co{'comment'});
                print "</div>\n";
        }
        if ($extra) {
@@ -6624,14 +6618,13 @@ sub git_summary {
        git_header_html();
        git_print_page_nav('summary','', $head);
 
-       print "<div class=\"title\">&nbsp;</div>\n";
        print "<table class=\"projects_list\">\n" .
-             "<tr id=\"metadata_desc\"><td>description</td><td>" . esc_html($descr) . "</td></tr>\n";
+             "<tr id=\"metadata_desc\"><th>description</th><td>" . esc_html($descr) . "</td></tr>\n";
         if ($owner and not $omit_owner) {
-               print  "<tr id=\"metadata_owner\"><td>owner</td><td>" . esc_html($owner) . "</td></tr>\n";
+               print  "<tr id=\"metadata_owner\"><th>owner</th><td>" . esc_html($owner) . "</td></tr>\n";
         }
        if (defined $cd{'rfc2822'}) {
-               print "<tr id=\"metadata_lchange\"><td>last change</td>" .
+               print "<tr id=\"metadata_lchange\"><th>last change</th>" .
                      "<td>".format_timestamp_html(\%cd)."</td></tr>\n";
        }
 
@@ -6654,7 +6647,7 @@ sub git_summary {
                        # without ability to add tags, don't show if there are none
                        my $cloud = git_populate_project_tagcloud($ctags);
                        print "<tr id=\"metadata_ctags\">" .
-                             "<td>content tags</td>" .
+                             "<th>content tags</th>" .
                              "<td>".git_show_project_tagcloud($cloud, 48)."</td>" .
                              "</tr>\n";
                }
@@ -6725,7 +6718,7 @@ sub git_tag {
        print "<div class=\"title_text\">\n" .
              "<table class=\"object_header\">\n" .
              "<tr>\n" .
-             "<td>object</td>\n" .
+             "<th>object</th>\n" .
              "<td>" . $cgi->a({-class => "list", -href => href(action=>$tag{'type'}, hash=>$tag{'object'})},
                               $tag{'object'}) . "</td>\n" .
              "<td class=\"link\">" . $cgi->a({-href => href(action=>$tag{'type'}, hash=>$tag{'object'})},
@@ -7602,9 +7595,9 @@ sub git_commit {
        print "<div class=\"title_text\">\n" .
              "<table class=\"object_header\">\n";
        git_print_authorship_rows(\%co);
-       print "<tr><td>commit</td><td class=\"sha1\">$co{'id'}</td></tr>\n";
+       print "<tr><th>commit</th><td class=\"sha1\">$co{'id'}</td></tr>\n";
        print "<tr>" .
-             "<td>tree</td>" .
+             "<th>tree</th>" .
              "<td class=\"sha1\">" .
              $cgi->a({-href => href(action=>"tree", hash=>$co{'tree'}, hash_base=>$hash),
                       class => "list"}, $co{'tree'}) .
@@ -7621,7 +7614,7 @@ sub git_commit {
 
        foreach my $par (@$parents) {
                print "<tr>" .
-                     "<td>parent</td>" .
+                     "<th>parent</th>" .
                      "<td class=\"sha1\">" .
                      $cgi->a({-href => href(action=>"commit", hash=>$par),
                               class => "list"}, $par) .
@@ -8018,7 +8011,7 @@ sub git_commitdiff {
                print "<div class=\"page_body\">\n";
                if (@{$co{'comment'}} > 1) {
                        print "<div class=\"log\">\n";
-                       git_print_log($co{'comment'}, -final_empty_line=> 1, -remove_title => 1);
+                       git_print_log($co{'comment'}, -remove_title => 1);
                        print "</div>\n"; # class="log"
                }