p≡p JSON adapter
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
3.5 KiB

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <head>
  4. <meta http-equiv="content-type" content="text/html; charset=utf-8">
  5. <link rel="icon" href="/favicon.ico" type="image/vnd.microsoft.icon">
  6. <title>Send example calls via jQuery</title>
  7. <style type="text/css">
  8. body { font-family:Helvetica,Arial,Sans-serif;background-color:#cde; }
  9. table { border-collapse:collapse; }
  10. .bigtable { border-collapse:collapse; border:2px black solid; box-shadow:4px 4px 8px #666; background-color:#ffd; margin:1em;}
  11. td, th { border:1px black solid; vertical-align:top; padding:0.5em;}
  12. td.right { border:0px black solid; float:right; }
  13. td.left { border:0px black solid; align:left; }
  14. tr.t { border-bottom:1px black solid; }
  15. .t td,th { border:0px black solid; }
  16. input { white-space:pre }
  17. .smalltable { border-collapse:collapse; border:2px black inset; margin-left:1em; padding:5px;}
  18. .smalltable td { border:none; vertical-align:top; padding:5px;}
  19. pre.green {white-space:pre; background-color:#9d9; }
  20. pre.red {white-space:pre; background-color:#d99; }
  21. </style>
  22. <script type="text/javascript" src="jquery.js"></script>
  23. <script type="text/javascript" src="pEp_functions.js"></script>
  24. <script type="text/javascript" src="interactive.js"></script>
  25. <script type="text/javascript" src="unittests.js"></script>
  26. <script type="text/javascript" src="test-encode-decode.js"></script>
  27. </head>
  28. <body>
  29. <h1>p≡p JSON Server Adapter – <span id="spn_version">(no JavaScript?)</span></h1>
  30. <h2>1. Send example calls via jQuery</h2>
  31. <form id="frm" name="frm">
  32. <table class="bigtable" id="bigtable">
  33. <tr><td>Server's Address</td><td> <input type="text" id="server" size="50" maxlength="200" value="http://127.0.0.1:4223/ja/0.1/" </td></tr>
  34. <tr><td>Security token:</td>
  35. <td>
  36. <input type="text" id="security_token" size="50" maxlength="80" placeholder="see /tmp/pEp-json-token-*">
  37. </td>
  38. </tr>
  39. <tr><td>Function name:</td><td>
  40. <select name="fn_name" id="fn_name" size="1" onChange="on_select_change()">
  41. <option>–––––</option>
  42. </select>
  43. </td></tr>
  44. <tr><td>Parameters:</td><td id="td_param"></td></tr>
  45. <tr><td colspan="2"> <input type="button" value="Call function!" onClick="button_click()" id="call_btn"> </td></tr>
  46. <tr><td>Debug...</td><td id="deb"><pre id="debug">...</pre></td></tr>
  47. <tr><td>Result:</td><td id="result"><pre id="resultpre">Banana!</pre></td></tr>
  48. </table>
  49. </form>
  50. <form id="frm_2" name="frm_2">
  51. <textarea placeholder="Just a scratchboard for text copy & paste :-)" rows="12" cols="80">
  52. </textarea>
  53. </form>
  54. <hr>
  55. <h2>2. Open WebSocket connection</h2>
  56. <input type="button" onClick="openWebSocket()" id="openWsBtn" value="Open WebSocket!">
  57. <hr>
  58. <h2>3. Execute JavaScript tests</h2>
  59. <p id='unittest_div'>(you have to activate JavaScript in your browser to see something useful here)</p>
  60. <p>Unittest output: <textarea id='unittest_out'></textarea></p>
  61. <hr>
  62. <h2>4. Generate documentation</h2>
  63. <form id="frm_doc" name="frm_doc">
  64. Select output format:
  65. <select id="doc_format" size="1">
  66. <option value="html" checked>HTML Table</option>
  67. <option value="md" >Markdown Table</option>
  68. <option value="trac" >Trac Table</option>
  69. </select>
  70. <button type="button" name="btn_doc" onclick="create_doc()">Create!</button></dd>
  71. </form>
  72. <div id="doc_out" style="background-color:white;border:1px black solid; padding:10px;"></div>
  73. <script type="text/javascript">
  74. init_pEp_functions();
  75. on_select_change();
  76. add_test_buttons();
  77. </script>
  78. </body>
  79. </html>