X-Git-Url: https://git.cworth.org/git?p=lmno.games;a=blobdiff_plain;f=scribe%2Fscribe.jsx;h=78155949f782174a6ff40d2a80c7b5948f715868;hp=d81932b7b847e6bb813993fd06a20a336a90d0ec;hb=e7e45fef427d3d76f7f88ca919c73e28de5a301b;hpb=35db0996e270ea66c7d0a94f1ddb2506005b22a3 diff --git a/scribe/scribe.jsx b/scribe/scribe.jsx index d81932b..7815594 100644 --- a/scribe/scribe.jsx +++ b/scribe/scribe.jsx @@ -1,8 +1,8 @@ function team_symbol(team) { if (team === "+") - return "ð¥"; + return "+"; else - return "ð"; + return "o"; } function undisplay(element) { @@ -26,7 +26,9 @@ const events = new EventSource("events"); events.onerror = function(event) { if (event.target.readyState === EventSource.CLOSED) { + setTimeout(() => { add_message("danger", "Connection to server lost."); + }, 1000); } }; @@ -77,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 (