common keyboard javascript include
[sheet.git] / nethack.plp
index bb0be709369898e8132cd1d384a66b7593f7b998..3cedd6e3a182f63c8983fcdb40d6d94531b51954 100644 (file)
@@ -31,7 +31,7 @@ $header{content_type} = $ctype;
 <link rel="stylesheet" type="text/css" media="all" href="base.css">
 <!--[if lte IE 6]><style> .help dl.legend dt {margin:0 0 1px} </style><![endif]-->
 <!--[if lte IE 7]><style> .help dl.legend dd {float:none} </style><![endif]--><:
-       my %styles = map {$_ => $_} qw(dark circus mono terse);
+       my %styles = map {$_ => $_} qw(dark circus mono red terse);
        our $style = exists $get{style} && $styles{$get{style}} || 'light';
        printf(qq{\n<link rel="%s" type="text/css" media="all" href="%s" title="%s">},
                $_ eq $style ? 'stylesheet' : 'alternate stylesheet', "$_.css", $_
@@ -42,35 +42,9 @@ $header{content_type} = $ctype;
        print "\n<style> .no, .alias {opacity:.5} </style>"
                if $showkeys and $get{keys} eq 'ghost';
 :>
+<script type="text/javascript" src="/keys.js"></script>
 
-<script><!--
-function setmode(classname) {
-       // set style for each #rows>li>ul>li to display:none unless it matches classname
-       var showclass = classname ? ' '+classname+'(?!\\w)' : '^$';
-       var parentskip = /^keys/;
-       var row = document.getElementById('rows').firstChild;
-       do {
-               if (row.tagName == 'LI' && row.firstChild.tagName == 'UL'
-               && !row.firstChild.className.match(parentskip)) {
-                       var el = row.firstChild.firstChild;
-                       if (el) do {
-                               if (el.tagName == 'LI') {
-                                       el.style.display = el.className.match(showclass) ? 'block' : 'none';
-                               }
-                       } while (el = el.nextSibling);
-               }
-       } while (row = row.nextSibling);
-
-       // update H2 to reflect the first part of a currently active (but hidden) H3
-       var h3s = document.getElementsByTagName('H3');
-       for (var i = 0; i < h3s.length; i++) {
-               if (h3s[i].parentNode.style.display != 'block') continue;
-               document.getElementsByTagName('H2')[0].innerHTML = h3s[i].firstChild.data;
-       }
-} // setmode
-//--></script>
-
-<body>
+<body id="nethack">
 
 <h1>NetHack cheat sheet</h1>
 
@@ -80,7 +54,7 @@ function setmode(classname) {
 
 <li class="row">
        <ul class="keys omni">
-       <li class="mo" onclick="setmode()"><b>Esc</b>
+       <li class="me" onclick="setmode()"><b>Esc</b>
                <!-- not as static anymore, but never bothered; just see ^[ -->
        </ul>
 </li>
@@ -88,7 +62,9 @@ function setmode(classname) {
 <:
 our %sign = (
        arg    => $ascii ? '.' : '·',  # described as 'dot'
-       argi   => $ascii ? ':' : ':',
+       args   => $ascii ? ':' : '⁚',
+       argi   => $ascii ? "'" : '′',
+       argm   => $ascii ? '|' : '↕',
        motion => $ascii ? '|' : '↕',
        alias  => $ascii ? 'see: ' : '»',
        up     => $ascii ? 'up'    : '▲',
@@ -136,10 +112,12 @@ $keys->print_rows($get{static});
                <dl class="legend legend-options">
                <dt>key<:= $sign{arg} :>
                        <dd>Commands with a dot need at least one argument afterwards.
-               <dt>key<:= $sign{motion} :>
-                       <dd>Requires a direction afterwards.
                <dt>key<:= $sign{argi} :>
                        <dd>Asks for an inventory item.
+               <dt>key<:= $sign{argm} :>
+                       <dd>Thing
+               <dt>key<:= $sign{motion} :>
+                       <dd>Requires a direction afterwards.
                </dl>
 
                <ul class="legend legend-set">