}
#[derive(Debug,Copy,Clone,Serialize,Deserialize)]
-pub enum UoKind { Global, Piece, }
+pub enum UoKind { Global, Piece, GlobalExtra, }
pub type UoKey = char;
desc: Html::lit("flip"),
})
}
+ out.push(UoDescription {
+ kind: UoKind::GlobalExtra,
+ def_key: 'l'.into(),
+ opname: "lower".to_string(),
+ desc: Html::lit("lower (send to bottom)"),
+ });
self.add_ui_operations(&mut out)?;
out
}
type Pos = [number, number];
type ClientSeq = number;
type Generation = number;
-type UoKind = "Global"| "Piece" | "ClientExtra";
+type UoKind = "Global"| "Piece" | "ClientExtra" | "GlobalExtra";
type UoDescription = {
kind: UoKind;
var uos_node : HTMLElement;
const uo_kind_prec : { [kind: string]: number } = {
+ 'GlobalExtra' : 50,
'Global' : 100,
'Piece' : 200,
'ClientExtra' : 500,
}
function recompute_keybindings() {
+ uo_map = Object.create(null);
for (let piece of Object.keys(pieces)) {
let p = pieces[piece];
if (p.held != us) continue;
for (var kk of uo_keys) {
let uo = uo_map[kk]!;
let ent = document.createElement('div');
- ent.setAttribute('class','uokey');
- ent.innerHTML = '<b>' + kk + '</bb>' + uo.desc;
+ ent.setAttribute('class','uokey-'+uo.kind);
+ ent.innerHTML = '<b>' + kk + '</b> ' + uo.desc;
out.appendChild(ent);
}
uos_node.firstChild!.replaceWith(out);
update_oe : (e as any).className,
})
}
+ recompute_keybindings();
// test_swap_stack();
}
SPDX-License-Identifier: AGPL-3.0-or-later
There is NO WARRANTY. -->
<style>
- div.uokeys: { }
- div.uokey: { }
+ div.uokeys { display: flex; flex-wrap: wrap; }
+ div[class|=uokey] {
+ outline: 1px solid #000;
+ margin: 1px;
+ padding-left: 5px;
+ padding-right: 6.5px;
+ }
+ div.uokey-ClientExtra {
+ margin-left: auto;
+ margin-top: auto;
+ }
</style>
<h1>Hi {{nick | escape}}!</h1>
<pre id="error"></pre>