+ const modalFenEdit = [
+ h('input',
+ {
+ attrs: { "id": "modal-fenedit", type: "checkbox" },
+ "class": { "modal": true },
+ }),
+ h('div',
+ {
+ attrs: { "role": "dialog", "aria-labelledby": "modal-fenedit" },
+ },
+ [
+ h('div',
+ {
+ "class": { "card": true, "smallpad": true },
+ },
+ [
+ h('label',
+ {
+ attrs: { "id": "close-fenedit", "for": "modal-fenedit" },
+ "class": { "modal-close": true },
+ }
+ ),
+ h('h3',
+ {
+ "class": { "section": true },
+ domProps: { innerHTML: "Position + flags (FEN):" },
+ }
+ ),
+ h('input',
+ {
+ attrs: {
+ "id": "input-fen",
+ type: "text",
+ value: VariantRules.GenRandInitFen(),
+ },
+ }
+ ),
+ h('button',
+ {
+ on: { click:
+ () => {
+ const fen = document.getElementById("input-fen").value;
+ document.getElementById("modal-fenedit").checked = false;
+ this.newGame("friend", fen);
+ }
+ },
+ domProps: { innerHTML: "Ok" },
+ }
+ ),
+ h('button',
+ {
+ on: { click:
+ () => {
+ document.getElementById("input-fen").value =
+ VariantRules.GenRandInitFen();
+ }
+ },
+ domProps: { innerHTML: "Random" },
+ }
+ ),
+ ]
+ )
+ ]
+ )
+ ];
+ elementArray = elementArray.concat(modalFenEdit);