X-Git-Url: https://git.cworth.org/git?p=lmno.games;a=blobdiff_plain;f=scribe%2Fscribe.jsx;h=be0de3799acf1f6bedaeb2171de86e9588832c38;hp=06a8541297059bdc046f6f40ae3ac129d8ff2e74;hb=656345d535b978e92cd9da0801a28f4571aaa6f2;hpb=6c0ef34689d35ec9deada19903f7e307f5ac618a diff --git a/scribe/scribe.jsx b/scribe/scribe.jsx index 06a8541..be0de37 100644 --- a/scribe/scribe.jsx +++ b/scribe/scribe.jsx @@ -79,14 +79,31 @@ events.addEventListener("game-state", event => { * Game and supporting classes * *********************************************************/ +function copy_to_clipboard(id) +{ + const tmp = document.createElement("input"); + tmp.setAttribute("value", document.getElementById(id).innerHTML); + document.body.appendChild(tmp); + tmp.select(); + document.execCommand("copy"); + document.body.removeChild(tmp); +} + function GameInfo(props) { if (! props.id) return null; return (
-

{props.id}

- Invite a friend to play by sending this URL: {props.url} + {props.id} + {" "} + Share this link to invite a friend:{" "} + {props.url} + {" "} +
); } @@ -132,7 +149,7 @@ function PlayerInfo(props) { return (
-

Players

+ Players: {props.player.name} {props.player.team ? ` (${props.player.team})` : ""} {props.first_move ? "" : " "}