about summary refs log tree commit diff stats
path: root/html/playground/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'html/playground/index.html')
-rw-r--r--html/playground/index.html17
1 files changed, 16 insertions, 1 deletions
diff --git a/html/playground/index.html b/html/playground/index.html
index d987c22..ec575a5 100644
--- a/html/playground/index.html
+++ b/html/playground/index.html
@@ -92,8 +92,14 @@
 </head>
 <body>
 
+    <div class="playground">    
+        <!-- use this empty div to mount stuff -->
+        <div class="seesaw"></div>
+        <div class="slide"></div>
+    </div>
+
     <div class="button-container">
-        <button onclick="document.getElementById('codeInput').value='';window.location.hash='';">Clear</button>
+        <button onclick="clearEverything()">Clear</button>
         <button onclick="downloadCodeAndEditor()">Download</button>
         <button onclick="shareCode()">Share</button>
         <button onclick="evaluateCode()" class="run">Run Code</button>
@@ -156,6 +162,15 @@
             window.prompt("Copy the URL to share.\nBe warned! Very long URLs don't share wicked well, sometimes.", window.location.href);
         }
 
+        function clearEverything() {
+            if (!confirm('Are you sure you want to reset the playground?')) {
+                return;
+            } else {               
+                window.location.hash = '';
+                window.location.reload();
+            }
+        }
+
         function loadCodeFromHash() {
             const hash = window.location.hash.substring(1);
             if (hash) {