From a8821b425351cdd8a5f69f5b60e389a1ae81cb72 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sun, 29 Oct 2023 11:35:52 -0400 Subject: cache player name --- app/views/wittle/puzzles/solve.js.erb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/views') diff --git a/app/views/wittle/puzzles/solve.js.erb b/app/views/wittle/puzzles/solve.js.erb index 12c2350..2aa22e9 100644 --- a/app/views/wittle/puzzles/solve.js.erb +++ b/app/views/wittle/puzzles/solve.js.erb @@ -1 +1,5 @@ $("#submission-form").html('<%= escape_javascript(render partial: "submission") %>'); +$("#submission-form #name").val(window.settings.player_name) +$("#submission-form #name").on("change", function() { + window.settings.player_name = this.value +}) -- cgit 1.4.1