'y x' => 'l5 ex',
'a' => 'l3',
'a x' => 'l3 ex',
- 'p j' => 'l2',
- 'j' => 'l2',
'p' => 'l2',
- 'p p' => 'l2',
'u' => 'l0',
);
my %DSTATS = (
u => 'unknown',
n => 'unsupported',
p => 'plugin required',
- j => 'javascript required',
a => 'partial',
y => 'supported',
- d => 'disabled by default',
+ d => '(disabled by default)',
x => sub {
join(' ',
- 'requires prefix',
+ 'with prefix',
map {"-$_-"}
($caniuse->{agents}->{$_[0]}->{prefix_exceptions} // {})->{$_[1]}
// $caniuse->{agents}->{$_[0]}->{prefix} // (),
);
my %PSTATS = ( # score percentage
y => 1, 'y x' => .9,
- a => .5, 'a x' => .5, 'a d' => .1,
- j => .2, 'p j' => .2, 'n d' => .2, 'n x d' => .2,
- p => .2, 'p p' => .2, 'p d' => .1,
- n => 0, u => 0,
+ a => .5, 'a x' => .5, 'a d' => .2,
+ p => .2, 'p d' => .1,
+ n => 0, 'n d' => .2, 'n x d' => .2,
+ u => 0,
);
my %CSTATUS = (
unoff => 'l1', # unofficial
while $prev =~ s/\h \# (\d+) \b//x;
# prepare version hover details
- my $title = sprintf('%.1f%% %s', $usage * $usagepct, join(', ',
- map { ref $_ eq 'CODE' ? $_->($browser, $span[0]->[0]) : $_ }
- map { $DSTATS{$_} // () }
- map { split / /, $_ }
- $prev
+ my $title = sprintf('%.1f%% %s', $usage * $usagepct, join(' ',
+ (map { ref $_ eq 'CODE' ? $_->($browser, $span[0]->[0]) : $_ }
+ map { $DSTATS{$_} // () }
+ map { split / /, $_ }
+ $prev
+ ),
+ 'in', $caniuse->{agents}->{$browser}->{abbr},
+ showversions((map { @{$_} } @span), undef),
));
$title .= "\n$_" for notestotitle(@notes);
sub showversions {
# title to describe minumum version and optional maximum for multiple cells
my @span = (map { split /-/ } grep { defined } @_);
- return $span[0] if @_ <= 1;
+ return $span[0] =~ s/\.0\z//r if @_ <= 1;
splice @span, 1, -1;
return join('‒', @span);
}