'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,
qq! "!. esc_attr(href()) .qq!");\n!.
qq!</script>\n!;
} else {
- my ($jstimezone, $tz_cookie, $datetime_class) =
- gitweb_get_feature('javascript-timezone');
-
- if (gitweb_check_feature('javascript-actions') || ($jstimezone && $tz_cookie && $datetime_class)) {
+ if (gitweb_check_feature('javascript-actions')) {
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!;
}
sub format_timestamp_html {
my $date = shift;
- 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! class="$datetime_class"!;
- }
- $strtime .= qq!>$date->{'rfc2822'}</time>!;
-
- 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