style: common disfavoured class .ex
[sheet.git] / keyboard.plp
1 <(common.inc.plp)><:
2         our $VERSION = 'v1.0';
3
4         use Shiar_Sheet::KeySigns qw(%sign);
5
6 :><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
7  "http://www.w3.org/TR/html4/loose.dtd">
8 <html>
9
10 <head>
11 <meta http-equiv="content-type" content="<:= $header{content_type} :>">
12 <title>keyboard cheat sheet</title>
13 <:= stylesheet(qw'light dark circus mono red terse') :>
14 <!--[if lte IE 6]><style> .help dl.legend dt {margin:0 0 1px} </style><![endif]-->
15 <!--[if lte IE 7]><style> .help dl.legend dd {float:none} </style><![endif]--><:
16         our $showkeys = exists $get{keys} && $get{keys} ne '0';
17         print "\n".'<style type="text/css"> .no {visibility:hidden} </style>'
18                 unless $showkeys;
19         print "\n".'<style type="text/css"> .no, .alias {opacity:.5} </style>'
20                 if $showkeys and $get{keys} eq 'ghost';
21 :>
22 <script type="text/javascript" src="/keys.js"></script>
23
24 <body id="keyboard">
25
26 <h1>keyboard cheat sheet</h1>
27
28 <h2>normal mode (default)</h2>
29
30 <ul id="rows">
31
32 <li class="row">
33         <ul class="keys omni">
34         <li class="mo chr27" onclick="setmode()"><b>Esc</b> normal mode
35                 <!-- not as static anymore, but never bothered; just see ^[ -->
36         </ul>
37 </li>
38
39 <:
40 our %sign;
41 use Shiar_Sheet::Keyboard 2;
42 my $usint = [
43         [  'a' ..                                            'z'],
44         [qw(Á B ¢ Ð É F G H Í J Œ Ø µ Ñ Ó Ö Ä ® § Þ Ú V Å X Ü Æ)],
45         [qw(á b © ð é f g h í j œ ø µ ñ ó ö ä ® ß þ ú v å x ü æ)],
46         [qw(Å ı Ç ð ´ ̉ ˝ ̣ ˆ ½  Þ ¾ ˜ Ø ∏ Œ ‰ / ˇ ¨ ◊ „ ˛ ¼ ¸)],
47         [qw(å ∫ ç ∂ ´ ƒ © ˙ ^ ∆ ° ¬ µ ~ ø π œ ® ß † ¨ √ ∑ ≈ ¥ Ω)],
48 ];
49
50 my $keys = Shiar_Sheet::Keyboard->new({
51         def => {
52                 '' => {
53                         map { $_ => [''] } @{ $usint->[0] }
54                 },
55         },
56         key => {
57                 map {
58                         my $i = ord($_) - ord('a');
59                         $_ => ["$usint->[1]->[$i]<br>$usint->[2]->[$i]"]
60                 } 'a'..'z'
61         },
62 });
63 $keys->map($get{map}) or undef $get{map};
64 $keys->print_rows($get{rows}, [0]);
65 :>
66 </ul>
67
68 <hr>
69
70 <div class="help">
71         <div class="left">
72                 <dl class="legend legend-types">
73                 <dt class="ci">info
74                         <dd>Info command: shows/does something without altering anything.
75                 <dt class="pm">motion
76                 <dt class="po">positioning
77                         <dd>Other movement (jumps, window (re)positioning).
78                 <dt class="co">command
79                         <dd>Direct action command.
80                 <dt class="mi">ins mode
81                         <dd>Enters Insert or Replace mode.
82                 <dt class="mo">mode
83                         <dd>Enters a different mode.
84                 <dt class="mv">vis mode
85                         <dd>Enters Visual or Select mode.
86                 <dt class="me">key cmd
87                         <dd>Additional key commands (click for overview).
88                 </dl>
89         </div>
90
91         <div class="right">
92                 <dl class="legend legend-options">
93                 </dl>
94
95                 <ul class="legend legend-set">
96                 <li>keyboard <strong>map</strong> is
97                         <:= $get{map} ? 'set to ' : '' :><em><:= $keys->{map} :></em>
98                 <li><strong>ascii</strong> mode is
99                         <:= defined $sign{-ascii} && 'forced ' :><em><:=
100                                 $sign{-ascii} ? 'on' : 'off' :></em>
101                 <li><strong>keys</strong> are
102                         <em><:= $showkeys ? 'always shown' : 'hidden if unassigned' :></em><:=
103                                 !exists $get{keys} && ' by default' :>
104                 <li>default <strong>style</strong> is
105                         <:= defined $get{style} && 'set to ' :><em><:= $style :></em>
106                 </ul>
107         </div>
108 </div>
109
110 <p class="footer">
111         <a href="/" rel="home">sheet.shiar.nl</a>/vim.<a href="/source/vim.plp"
112          rel="code" title="Written in Perl">plp</a>
113         <a href="http://git.shiar.nl/sheet.git/history/HEAD:/vim.plp"
114          rel="vcs-git" title="Git repository"><:= $VERSION :></a>
115         created by <a href="http://shiar.nl/" rel="author">Shiar</a> <:= $sign{sep} :>
116         <a href="http://www.fsf.org/licensing/licenses/agpl-3.0.html" rel="copyright"
117          title="Licensed under the GNU Affero General Public License, version 3">AGPLv3</a>
118 </p>
119
120 </html>