browser: browser and versions in cell titles
authorMischa POSLAWSKY <perl@shiar.org>
Thu, 27 Apr 2017 18:48:52 +0000 (20:48 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 29 May 2017 17:21:27 +0000 (19:21 +0200)
Increases size by 5kB to 134kB (50kB to 793kB uncompressed)
but greatly improves usability.

browser.plp

index 44c2b22..effda37 100644 (file)
@@ -48,10 +48,10 @@ my %DSTATS = (
        p => 'plugin 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} // (),
@@ -397,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);