123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <!-- Code by Sunit Kumar Nandi -->
- <!DOCTYPE html>
- <head>
- <!-- Inserting CodeMirror text editor -->
- <!-- Credit for the idea goes to Aditya Rajan -->
- <meta charset="utf-8" script=>
- <link rel="stylesheet" type="text/css" href="style.css">
- <link rel="stylesheet" href="assets/codemirror.css">
- <script src="assets/codemirror.js"></script>
- <script src="assets/matchbrackets.js"></script>
- <script src="assets/clike.js"></script>
- <style>.CodeMirror {border: 1px solid #ccc; width:500px; }</style>
- </head>
- <body>
- <!-- Specifying how the form data should be processed -->
- <form name="form1" method="post" target="output" action="output.php?saving=1">
- Write your program here:
- <br>
- <!-- Accepting program code -->
- <textarea id="code" name="data" cols="100" rows="10">
- #include<iostream>
- using namespace std;
- int main()
- {
- cout << "Hello world!";
- return 0;
- }
- </textarea>
- <br><br>
- <!-- Accepting standard input -->
- Standard input:<br>
- <textarea name="stdin" cols="60" rows="10" placeholder="Type in keyboard inputs here">
- </textarea>
- <br><br>
- <!-- Accepting command-line agruments -->
- Command-line arguments:<br>
- <input type="text" name="args" placeholder="Type in parameters to pass to program">
- <br><br>
- <!-- Submit button goes here -->
- <button type="submit">Run</button>
- </form>
- <br>
- <!-- Provide a link to text input option -->
- <button href="textinput.php" target="output">Submit a text file</button>
- <script>
- var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
- lineNumbers: true,
- matchBrackets: true,
- lineWrapping: true,
- tabMode: "indent",
- indentUnit: 4,
- mode: "text/x-c++src"
- });
- </script>
- </body>
- </html>
|