X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/efc30e581f90743618f1bbf44fe0bfae075549ef..0e07efe0549f928d061f52c16ed9a4ee8260b49a:/charset.plp diff --git a/charset.plp b/charset.plp index 7ff3f42..d2c92c5 100644 --- a/charset.plp +++ b/charset.plp @@ -1,5 +1,8 @@ <(common.inc.plp)><: +my $mode = exists $get{compare}; +my @tablist = split m{/+}, $Request || 'default'; + Html({ title => 'charset cheat sheet', version => '1.0', @@ -18,8 +21,6 @@ Html({ )], }); -my @tablist = split m{/+}, $Request || 'default'; - use List::Util qw( first pairmap pairfirst pairs ); :> @@ -76,7 +77,7 @@ use Shiar_Sheet::FormatChar; my $glyphs = Shiar_Sheet::FormatChar->new; my @request; -my $INHERIT = do 'charset-encoding.inc.pl' +my $charsets = do 'charset-encoding.inc.pl' or Alert('Encoding metadata could not be read', $@ || $!); sub tabinput { @@ -136,7 +137,8 @@ sub tabinput { my $params = $input =~ s/[+](.*)\z// ? $1 : undef; if (not defined $params) { - my @parents = @{ $INHERIT->{$input} || [] }; + my $charset = $charsets->{$input} || {}; + my @parents = @{ $charset->{inherit} || [] }; if (my ($parent, $part) = pairfirst { defined $visible->{$a} } @parents) { $row{parent} = $parent; @@ -403,7 +405,7 @@ for my $row (@request) { my ($cell, $name, $class) = $glyph eq $NOCHAR ? () : $glyphs->glyph_html($glyph); - if (exists $get{compare}) { + if ($mode) { state $visible = {}; $class = ( $cp == ord $glyph ? 'l4' : @@ -430,7 +432,7 @@ for my $row (@request) {
- <: if (exists $get{compare}) { :> +
<: if ($mode) { :>
unicode inherited existing