| 1 | <!doctype html> |
| 2 | <html lang="en-us"> |
| 3 | <head> |
| 4 | <meta charset="utf-8"> |
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 6 | <title>ChucK + JS => ChucKScript</title> |
| 7 | <link rel="stylesheet" href="../../css/editor.css"> |
| 8 | </head> |
| 9 | <body onresize="chuckEditor.resize();"> |
| 10 | <div> |
| 11 | <div id="program">// Globals 5: remove shred |
| 12 | // This test is automated, but should approximate this code: |
| 13 | SinOsc foo => dac; |
| 14 | 2::second => now; |
| 15 | </div> |
| 16 | </div> |
| 17 | <div class="buttons"> |
| 18 | <button class="chuckButton" id="startChuck" disabled="disabled">Start ChucK</button> |
| 19 | <button class="chuckButton" id="compileButton" disabled="disabled">Compile and Run</button> |
| 20 | <button class="chuckButton" id="replaceButton" disabled="disabled">Replace</button> |
| 21 | <button class="chuckButton" id="removeButton" disabled="disabled">Remove</button> |
| 22 | <button class="chuckButton" id="clearButton" disabled="disabled">Clear VM and Globals</button> |
| 23 | <button class="chuckButton" id="micButton" disabled="disabled">Enable Microphone</button> |
| 24 | <button class="chuckButton" id="fileFormButton">Show File Uploader</button> |
| 25 | </div> |
| 26 | <div id="fileForm" class="hidden"> |
| 27 | <p>File name to use in ChucK: <input type="text" id="uploadFilename"></p> |
| 28 | <p>Local file to upload: <input type="file" id="uploadFile" name="uploadFile"></p> |
| 29 | <p><button class="chuckButton" id="fileButton" disabled="disabled">Upload File to Virtual File System</button></p> |
| 30 | </div> |
| 31 | <div> |
| 32 | <textarea id="output"></textarea> |
| 33 | <div id="shreds"> |
| 34 | <table id="shredstable"> |
| 35 | <col width="60px"> |
| 36 | <col width="1*"> |
| 37 | <col width="50px"> |
| 38 | <col width="60px"> |
| 39 | <tr><th>shred</th><th>code</th><th>time</th><th>remove</th> |
| 40 | </table> |
| 41 | </div> |
| 42 | <div class="clearfix"></div> |
| 43 | </div> |
| 44 | <script type="text/javascript" src="../../js/ace-min-noconflict/ace.js" charset="utf-8"></script> |
| 45 | <script type="text/javascript" src="../../js/editor.js"></script> |
| 46 | <script type="text/javascript" src="../../js/defer.js"></script> |
| 47 | <script> |
| 48 | // override |
| 49 | var whereIsChuck = "../../js"; |
| 50 | </script> |
| 51 | <script type="text/javascript" src="../../js/webchuck_host.js"></script> |
| 52 | <script type="text/javascript" src="../../js/host.js"></script> |
| 53 | <script> |
| 54 | theChuckReady.then( function() |
| 55 | { |
| 56 | // compile and then exit 2 seconds later |
| 57 | theChuck.runCode( "SinOsc foo => dac; 1::week => now;" ).then( function( shred ) |
| 58 | { |
| 59 | setTimeout( function() { |
| 60 | theChuck.removeShred( shred ); |
| 61 | }, 2000 ); |
| 62 | }); |
| 63 | }); |
| 64 | </script> |
| 65 | </body> |
| 66 | </html> |
| 67 | |
| 68 |