Change the time markup
[gitweb] / gitweb.cgi
index 8ece13db4dd92334f9dfee2f880505f0eccb811e..43fcbc748718937087a161e1d9cfa138b1ceb4b7 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";
@@ -4537,18 +4540,14 @@ sub git_print_section {
 
 sub format_timestamp_html {
        my $date = shift;
-       my $strtime = $date->{'rfc2822'};
 
        my (undef, undef, $datetime_class) =
                gitweb_get_feature('javascript-timezone');
+       my $strtime = qq!<time datetime="$date->{'iso-8601'}" title="$date->{'iso-tz'}"!;
        if ($datetime_class) {
-               $strtime = qq!<span class="$datetime_class">$strtime</span>!;
+               $strtime .= qq! class="$datetime_class"!;
        }
-
-       my $localtime_format = '(%02d:%02d %s)';
-       $strtime .= ' ' .
-                   sprintf($localtime_format,
-                           $date->{'hour_local'}, $date->{'minute_local'}, $date->{'tz_local'});
+       $strtime .= qq!>$date->{'rfc2822'}</time>!;
 
        return $strtime;
 }