browser: browser and versions in cell titles
[sheet.git] / browser.plp
index 1073e4945a54f4caec8e2d23d887c4b7b028b26e..effda377a2f9bbf1e5ce3564c2010238ac2c2923 100644 (file)
@@ -39,23 +39,19 @@ my %CSTATS = (
        '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} // (),
@@ -64,10 +60,10 @@ my %DSTATS = (
 );
 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
@@ -401,11 +397,14 @@ sub saybrowsercols {
                                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);