input.html 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <html>
  2. <head>
  3. <!-- Inserting CodeMirror text editor -->
  4. <!-- Credit for the idea goes to Aditya Rajan -->
  5. <link rel="stylesheet" href="assets/codemirror.css">
  6. <script src="assets/codemirror.js"></script>
  7. <script src="assets/matchbrackets.js"></script>
  8. <script src="assets/clike.js"></script>
  9. <style>.CodeMirror {border: 1px solid #ccc; width:500px; }</style>
  10. </head>
  11. <body>
  12. <!-- Specifying how the form data should be processed -->
  13. <form name="form1" method="post" target="output" action="output.php?saving=1">
  14. Write your program here:
  15. <br>
  16. <!-- Accepting program code -->
  17. <textarea id="code" name="data" cols="80" rows="10">
  18. #include<iostream>
  19. using namespace std;
  20. int main()
  21. {
  22. cout << "Hello world!";
  23. return 0;
  24. }
  25. </textarea>
  26. <br><br>
  27. <!-- Accepting standard input -->
  28. Standard input:<br>
  29. <textarea name="stdin" cols="60" rows="10">
  30. </textarea>
  31. <br><br>
  32. <!-- Accepting command-line agruments -->
  33. Command line arguments: <input type="text" name="args">
  34. <br><br>
  35. <!-- Submit button goes here -->
  36. <input type="submit" value="Run">
  37. </form>
  38. <br>
  39. <!-- Provide a link to text input option -->
  40. <a href="textinput.php" target="output">Click here to submit text file input</a>
  41. <script>
  42. var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  43. lineNumbers: true,
  44. matchBrackets: true,
  45. lineWrapping: true,
  46. tabMode: "indent",
  47. indentUnit: 4,
  48. mode: "text/x-c++src"
  49. });
  50. </script>
  51. </body>
  52. </html>