X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/29b80033c249b03db4391eb284d543a0d68a8e5a..4e33af0004e7dd474555eedb009def7e89bb159c:/vimperator.plp?ds=inline
diff --git a/vimperator.plp b/vimperator.plp
index fe30db5..cdde680 100644
--- a/vimperator.plp
+++ b/vimperator.plp
@@ -5,21 +5,11 @@ use warnings;
no warnings 'qw'; # you know what you doing
no warnings 'uninitialized'; # save some useless checks for more legible code
-our $VERSION = '1.0';
+use Shiar_Sheet::KeySigns qw(%sign);
-our $ascii = 0;
-if (exists $get{ascii}) {
- $ascii = $get{ascii} ne '0'; # manual override
-} elsif (defined $ENV{HTTP_ACCEPT_CHARSET}) {
- $ascii = 1;
- for (split q{,}, $ENV{HTTP_ACCEPT_CHARSET}) {
- $ascii = 0, last if $_ eq '*' or m{utf-?8}i;
- }
-}
+our $VERSION = '1.0';
-my $charset = $ascii ? 'us-ascii' : 'utf-8';
-my $ctype = "text/html; charset=$charset";
-$header{content_type} = $ctype;
+$header{content_type} = "text/html; charset=$sign{charset}";
:>
@@ -27,7 +17,7 @@ $header{content_type} = $ctype;
vimperator cheat sheet
-
+
<:
@@ -42,34 +32,7 @@ $header{content_type} = $ctype;
print "\n"
if $showkeys and $get{keys} eq 'ghost';
:>
-
-
-
+
@@ -87,20 +50,6 @@ function setmode(classname) {
<:
-our %sign = (
- arg => $ascii ? '.' : '·', # described as 'dot'
- args => $ascii ? ':' : 'â', # described as 'two dots'
- alias => $ascii ? 'see: ' : '»',
- up => $ascii ? 'up' : 'â²',
- right => $ascii ? 'right' : 'â¶',
- down => $ascii ? 'down' : 'â¼',
- left => $ascii ? 'left' : 'â',
- sep => $ascii ? '*' : 'â¢',
- _ => exists $get{ascii} && !$ascii ? "\x{200b}" : '',
- # use the correct ZWNJ only when unicode is forced on
- # default to use unofficial html for best support
-);
-
use Shiar_Sheet::Keyboard;
my $keys = Shiar_Sheet::Keyboard->new({do 'vimperator.inc.pl'});
$keys->map($get{map}) or undef $get{map};
@@ -146,8 +95,8 @@ $keys->print_rows($get{static});
keyboard map is
<:= $get{map} ? 'set to ' : '' :><:= $keys->{map} :>
ascii mode is
- <:= exists $get{ascii} && 'forced ' :><:=
- $ascii ? 'on' : 'off' :>
+ <:= defined $sign{-ascii} && 'forced ' :><:=
+ $sign{-ascii} ? 'on' : 'off' :>
keys are
<:= $showkeys ? 'always shown' : 'hidden if unassigned' :><:=
!exists $get{keys} && ' by default' :>
@@ -158,10 +107,10 @@ $keys->print_rows($get{static});