diff --git a/godel/index.html b/godel/index.html index f8e8dad..f74a48e 100644 --- a/godel/index.html +++ b/godel/index.html @@ -54,7 +54,8 @@ Y <- Y + 1 GOTO C1
- +
{ + const instructions = btoa(instructionsEditorEl.getValue()); + + navigator.clipboard + .writeText( + window.location.href.split("?")[0] + `?instructions=${instructions}` + ) + .then(() => alert("copied to clipboard")); +}); state.subscribe((msg) => { if (msg.type == MESSAGES.COMPILE_RESULT) { @@ -146,7 +158,7 @@ state.subscribe((msg) => { const urlParams = new URLSearchParams(window.location.search); if (urlParams.get("instructions")) { - editorEl.setValue(atob(urlParams.get("instructions"))); + instructionsEditorEl.setValue(atob(urlParams.get("instructions"))); } compileButton.addEventListener("click", () => {