index.html 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <html>
  2. <body>
  3. <script>
  4. function translateTypes() {
  5. val = document.getElementById("value");
  6. if(["if", "while", "assign", "call", "break", "continue", "return", "resolve", "access", "constant", "input", "output", "declare", "global", "Integer", "Float", "String", "Boolean", "Action", "Type"].indexOf(val.value) >= 0){
  7. alert("Rewriting complex!");
  8. val.value = "{\"value\":\"" + val.value + "\"}"
  9. }
  10. else {
  11. alert("No rewrite required");
  12. }
  13. return 1;
  14. }
  15. </script>
  16. <form action="http://localhost:8001/" method="POST" onsubmit="translateTypes()">
  17. <table border="1">
  18. <tr><td>
  19. Operation type:
  20. </td><td>
  21. <input type="radio" name="op" value="set_input"> Set input
  22. </td><td>
  23. <input type="radio" name="op" value="get_output"> Get output
  24. </td></tr>
  25. <tr><td>
  26. Username:
  27. </td><td>
  28. <input type="text" name="username">
  29. </td></tr>
  30. <tr><td>
  31. Message type:
  32. </td><td>
  33. <input type="radio" name="element_type" value="R"> Identifier
  34. </td><td>
  35. <input type="radio" name="element_type" value="V"> Value
  36. </td></tr>
  37. <tr><td>
  38. Value:
  39. </td><td>
  40. <input type="text" id="value" name="value">
  41. </td></tr>
  42. <tr><td>
  43. <input type="submit" value="send request">
  44. </td></tr>
  45. </form>
  46. </td></tr>
  47. </table>
  48. </body>
  49. </html>