5 no warnings 'qw'; # you know what you doing
6 no warnings 'uninitialized'; # save some useless checks for more legible code
11 if (exists $get{ascii}) {
12 $ascii = $get{ascii} ne '0'; # manual override
13 } elsif (defined $ENV{HTTP_ACCEPT_CHARSET}) {
15 for (split q{,}, $ENV{HTTP_ACCEPT_CHARSET}) {
16 $ascii = 0, last if $_ eq '*' or m{utf-?8}i;
20 my $charset = $ascii ? 'us-ascii' : 'utf-8';
21 my $ctype = "text/html; charset=$charset";
22 $header{content_type} = $ctype;
24 :><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
25 "http://www.w3.org/TR/html4/loose.dtd">
29 <title>vimperator cheat sheet</title>
30 <meta http-equiv="content-type" content="<:= $ctype :>">
31 <link rel="stylesheet" type="text/css" media="all" href="base.css">
32 <!--[if lte IE 6]><style> .help dl.legend dt {margin:0 0 1px} </style><![endif]-->
33 <!--[if lte IE 7]><style> .help dl.legend dd {float:none} </style><![endif]--><:
34 my %styles = map {$_ => $_} qw(dark circus mono red terse);
35 our $style = exists $get{style} && $styles{$get{style}} || 'light';
36 printf(qq{\n<link rel="%s" type="text/css" media="all" href="%s" title="%s">},
37 $_ eq $style ? 'stylesheet' : 'alternate stylesheet', "$_.css", $_
40 our $showkeys = exists $get{keys} && $get{keys} ne '0';
41 print "\n<style> .no {visibility:hidden} </style>" unless $showkeys;
42 print "\n<style> .no, .alias {opacity:.5} </style>"
43 if $showkeys and $get{keys} eq 'ghost';
45 <script type="text/javascript" src="/keys.js"></script>
47 <body id="vimperator">
49 <h1>Vimperator cheat sheet</h1>
51 <h2>normal mode (default)</h2>
56 <ul class="keys omni">
57 <li class="mv" onclick="setmode()"><b>Esc</b> normal mode
58 <!-- not as static anymore, but never bothered; just see ^[ -->
64 arg => $ascii ? '.' : '·', # described as 'dot'
65 args => $ascii ? ':' : '⁚', # described as 'two dots'
66 alias => $ascii ? 'see: ' : '»',
67 up => $ascii ? 'up' : '▲',
68 right => $ascii ? 'right' : '▶',
69 down => $ascii ? 'down' : '▼',
70 left => $ascii ? 'left' : '◀',
71 sep => $ascii ? '*' : '•',
72 _ => exists $get{ascii} && !$ascii ? "\x{200b}" : '<wbr>',
73 # use the correct ZWNJ only when unicode is forced on
74 # default to use unofficial html for best support
77 use Shiar_Sheet::Keyboard;
78 my $keys = Shiar_Sheet::Keyboard->new({do 'vimperator.inc.pl'});
79 $keys->map($get{map}) or undef $get{map};
80 $keys->print_rows($get{static});
88 <dl class="legend legend-types">
90 <dd>Displays something without any permanent consequences.
92 <dd>Move cursor, scroll window, focus buffer element.
94 <dd>Tab or window navigation/selection.
98 <dd>Browse to a location in the current tab.
99 <dt class="mi">tab open
100 <dd>Browse somewhere in a new tab.
101 <dt class="mo">browser
102 <dd>Other browser action.
104 <dd>Enter a different mode.
105 <dt class="me">key cmd
106 <dd>Additional key commands (click for overview).
111 <dl class="legend legend-options">
112 <dt>key<:= $sign{arg} :>
113 <dd>Commands with a dot need a char argument afterwards.
114 <dt>key<:= $sign{args} :>
115 <dd>Commands with two dots require variable arguments afterwards.
118 <ul class="legend legend-set">
119 <li>keyboard <strong>map</strong> is
120 <:= $get{map} ? 'set to ' : '' :><em><:= $keys->{map} :></em>
121 <li><strong>ascii</strong> mode is
122 <:= exists $get{ascii} && 'forced ' :><em><:=
123 $ascii ? 'on' : 'off' :></em>
124 <li><strong>keys</strong> are
125 <em><:= $showkeys ? 'always shown' : 'hidden if unassigned' :></em><:=
126 !exists $get{keys} && ' by default' :>
127 <li>default <strong>style</strong> is
128 <:= defined $get{style} && 'set to ' :><em><:= $style :></em>
134 <a href="http://sheet.shiar.nl/" rel="home">sheet.shiar.nl</a>/vimperator
135 <a href="git://dev.shiar.nl/sheet" rel="vcs-git" title="Git repository"><:= "v$VERSION" :></a>
136 created by <a href="http://shiar.nl/" rel="author">Shiar</a> <:= $sign{sep} :>
137 <a title="Licensed under the GNU Affero General Public License, version 3" rel="copyright"
138 href="http://www.fsf.org/licensing/licenses/agpl-3.0.html">AGPLv3</a> <:= $sign{sep} :>
140 use Time::Format qw(time_format);
141 print time_format('yyyy-mm-dd', (stat 'vimperator.inc.pl')[9]);