X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;ds=sidebyside;f=scribe%2Fscribe.jsx;h=be0de3799acf1f6bedaeb2171de86e9588832c38;hb=451e6a2e8e35cc619210e430a1d8d2e7e387d7c0;hp=06a8541297059bdc046f6f40ae3ac129d8ff2e74;hpb=6c0ef34689d35ec9deada19903f7e307f5ac618a;p=lmno.games 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 (