about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-11-16 19:42:35 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2023-11-16 19:42:35 -0500
commitf03dd9f422b7f88f7a14f658715865a2db552b70 (patch)
tree569703db756094de2e0717da2a9bd53f8e1c2a75
parenta5111c43bae9d72a1d5abcadccb82f525155e43d (diff)
downloadwittle-f03dd9f422b7f88f7a14f658715865a2db552b70.tar.gz
wittle-f03dd9f422b7f88f7a14f658715865a2db552b70.tar.bz2
wittle-f03dd9f422b7f88f7a14f658715865a2db552b70.zip
allow re-solving on the same day
-rw-r--r--app/views/wittle/puzzles/_handle_puzzle.html.erb8
-rw-r--r--app/views/wittle/puzzles/show.html.haml3
2 files changed, 8 insertions, 3 deletions
diff --git a/app/views/wittle/puzzles/_handle_puzzle.html.erb b/app/views/wittle/puzzles/_handle_puzzle.html.erb index e451745..f0e3227 100644 --- a/app/views/wittle/puzzles/_handle_puzzle.html.erb +++ b/app/views/wittle/puzzles/_handle_puzzle.html.erb
@@ -19,7 +19,7 @@ function setTime() {
19} 19}
20 20
21window.onload = function() { 21window.onload = function() {
22 <% if @playable %> 22 <% if @playable or @puzzle.latest? %>
23 $("#sens").val(window.settings.sensitivity) 23 $("#sens").val(window.settings.sensitivity)
24 $("#sens").on("change", function() { 24 $("#sens").on("change", function() {
25 window.settings.sensitivity = this.value 25 window.settings.sensitivity = this.value
@@ -28,7 +28,9 @@ window.onload = function() {
28 $("#volume").on("change", function() { 28 $("#volume").on("change", function() {
29 window.settings.volume = this.value 29 window.settings.volume = this.value
30 }) 30 })
31 <% end %>
31 32
33 <% if @playable %>
32 <% if @already_started %> 34 <% if @already_started %>
33 var puzzle = window.deserializePuzzle("<%= @puzzle.data %>") 35 var puzzle = window.deserializePuzzle("<%= @puzzle.data %>")
34 draw(puzzle) 36 draw(puzzle)
@@ -52,7 +54,9 @@ window.onload = function() {
52 var puzzle = window.deserializePuzzle("<%= @puzzle.data %>") 54 var puzzle = window.deserializePuzzle("<%= @puzzle.data %>")
53 draw(puzzle) 55 draw(puzzle)
54 drawPath(puzzle, JSON.parse("<%= escape_javascript(sanitize @solution) %>")) 56 drawPath(puzzle, JSON.parse("<%= escape_javascript(sanitize @solution) %>"))
55 window.trace = function() {} 57 <% unless @puzzle.latest? %>
58 window.trace = function() {}
59 <% end %>
56 <% end %> 60 <% end %>
57} 61}
58 62
diff --git a/app/views/wittle/puzzles/show.html.haml b/app/views/wittle/puzzles/show.html.haml index 679046d..5eb34a4 100644 --- a/app/views/wittle/puzzles/show.html.haml +++ b/app/views/wittle/puzzles/show.html.haml
@@ -12,6 +12,7 @@
12 %label#minutes 00 12 %label#minutes 00
13 %label#colon : 13 %label#colon :
14 %label#seconds 00 14 %label#seconds 00
15- if @playable or @puzzle.latest?
15 %details#trace-settings 16 %details#trace-settings
16 %summary Settings 17 %summary Settings
17 .things 18 .things
@@ -19,7 +20,7 @@
19 %input#sens{ type: "range", min: "0.1", max: "1.3", step: "0.1" } 20 %input#sens{ type: "range", min: "0.1", max: "1.3", step: "0.1" }
20 %label{ for: "volume" } Volume 21 %label{ for: "volume" } Volume
21 %input#volume{ type: "range", min: "0", max: "0.24", step: "0.02" } 22 %input#volume{ type: "range", min: "0", max: "0.24", step: "0.02" }
22- else 23- unless @playable
23 #scores 24 #scores
24 #by-time 25 #by-time
25 %h2 Fastest Solves 26 %h2 Fastest Solves