Remove support for ancient browsers
[gitweb] / gitweb.cgi
index b182f4cfbbd5a4f90a304745aa6bae4824f278b9..953d1771b6be98740f430bbfd13066d7a3964953 100755 (executable)
@@ -519,18 +519,6 @@ our %feature = (
                'override' => 0,
                'default' => [0]},
 
-       # Enable and configure ability to change common timezone for dates
-       # in gitweb output via JavaScript.  Enabled by default.
-       # Project specific override is not supported.
-       'javascript-timezone' => {
-               'override' => 0,
-               'default' => [
-                       'local',     # default timezone: 'utc', 'local', or '(-|+)HHMM' format,
-                                    # or undef to turn off this feature
-                       'gitweb_tz', # name of cookie where to store selected timezone
-                       'datetime',  # CSS class used to mark up dates for manipulation
-               ]},
-
        # Syntax highlighting support. This is based on Daniel Svensson's
        # and Sham Chukoury's work in gitweb-xmms2.git.
        # It requires the 'highlight' program present in $PATH,
@@ -4310,28 +4298,24 @@ 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!;
        } else {
-               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!;
+                       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!;
+                       }
+                       print qq!};\n!.
+                               qq!</script>\n!;
                }
-               print qq!};\n!.
-                     qq!</script>\n!;
        }
 
        print "</body>\n" .
@@ -4429,7 +4413,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,23 +4521,8 @@ 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');
-       if ($datetime_class) {
-               $strtime = qq!<span class="$datetime_class">$strtime</span>!;
-       }
-
-       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'});
-
-       return $strtime;
+       return qq!<time datetime="$date->{'iso-8601'}" title="$date->{'iso-tz'}">$date->{'rfc2822'}</time>!;
 }
 
 # Outputs the author name and date in long form
@@ -4682,11 +4651,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 +5892,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,7 +6587,6 @@ 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\"><th>description</th><td>" . esc_html($descr) . "</td></tr>\n";
         if ($owner and not $omit_owner) {
@@ -8018,7 +7980,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"
                }