Răsfoiți Sursa

Set page to be ready immediately

Set a small sample program as the code box's initial value. Set the run
button to run CodeBox.protoype.ParseCodeBox, which will run the supplied
code.
ApisNecros 1 an în urmă
părinte
comite
5a472a9db2
1 a modificat fișierele cu 3 adăugiri și 3 ștergeri
  1. 3 3
      index.html

+ 3 - 3
index.html

@@ -11,10 +11,10 @@
                 <input type="text" id="stackInit" class="inline-block w-full p-2 border border-black rounded-sm" placeholder="Initial Stack" />
             </div>
             <div>
-                <textarea id="script" class="w-full border border-black" rows="20" placeholder="11+n;"></textarea>
+                <textarea id="script" class="w-full border border-black" rows="20" placeholder="11+n;">11+n;</textarea>
             </div>
             <div class="flex justify-center items-center">
-                <button class="p-4 border border-black bg-blue-300 rounded" onclick="engine.Run()">Run</button>
+                <button class="p-4 border border-black bg-blue-300 rounded" onclick="cb.ParseCodeBox()">Run</button>
             </div>
             <div>
                 <textarea id="output" class="w-full border border-black" rows="20"></textarea>
@@ -22,7 +22,7 @@
         </div>
         <!-- <canvas class="w-full h-full"></canvas> -->
         <script>
-            const cb = new CodeBox("script", "output", "stackInit");
+            const cb = new CodeBox("script", "stackInit", "output");
         </script>
     </body>
 </html>