X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/866cb3f196ab258fbe5a1760e233899ca3df1234..fb9b9cbfd0f9077e208a8f00f4a675201fde62c3:/browser.plp diff --git a/browser.plp b/browser.plp index 8c24298..75605fd 100644 --- a/browser.plp +++ b/browser.plp @@ -9,7 +9,7 @@ Html({ description => "caniuse.", keywords => [qw'html css browser feature'], - stylesheet => [qw'circus dark mono red'], + stylesheet => [qw'circus dark mono red light'], data => ['browser-support.inc.pl'], }); @@ -20,6 +20,7 @@ Html({ with Wikimedia browser usage statistics.

+
<: my $caniuse = do 'browser-support.inc.pl' or die $! || $@; @@ -50,9 +51,22 @@ if (my ($somerow) = values %{ $caniuse->{data} }) { } } -my $canihas = do 'browser-usage.inc.pl' or do { +my $canihas = do 'browser-usage.inc.pl' || do { printf "

Browser usage data not found: %s.

\n", $_ for $! || $@; + +{ + map { + $_ => +{ + map { + ($_->[4] => 0 ), # future + ($_->[3] => .5), # next + ($_->[0] => 5 ), # past + ($_->[1] => 10 ), # previous + ($_->[2] => 30 ), # current + } $caniuse->{agents}->{$_}->{versions} + } + } @browsers + }; # fallback hash based on release semantics }; my $scorediv = (max(map { sum(values %$_) } values %$canihas) // 1) / 100; @@ -131,7 +145,14 @@ for my $id (sort { my $cell = $_ ? lc $_->[0] : '-'; print '', $cell; } - printf '%s', $row->{description}, $row->{title}; + print '', $row->{title}; + print '
'; + s/\.?$/./, print "

$_

" for map { ref $_ ? @$_ : $_ || () } + $row->{description}, $row->{notes}; + printf 'Resources: %s.', join(', ', + map { qq($_->{title}) } @$_ + ) for $row->{links} // (); + print '
'; for ($row->{status}) { my $cell = $_ // '-'; $cell = sprintf '%s', $_, $cell for $row->{spec} // (); @@ -174,7 +195,7 @@ print ''; sub paddedver { # normalised version number comparable as string (cmp) shift =~ /^(\d*)(.*)/; - return sprintf('%02d', $1) . $2; + return sprintf('%02d', $1 || 0) . $2; } sub showversions { @@ -186,19 +207,8 @@ sub showversions { return join('‒', @span); } -:> - +:>
+
@@ -208,6 +218,7 @@ Array.forEach(document.getElementsByTagName('TD'), function(val) { partial external (js/plugin) missing + unknown