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

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="icon" href="/favicon.ico" type="image/vnd.microsoft.icon">
<title>Send example calls via jQuery</title>
<style type="text/css">
body { font-family:Helvetica,Arial,Sans-serif;background-color:#cde; }
table { border-collapse:collapse; }
.bigtable { border-collapse:collapse; border:2px black solid; box-shadow:4px 4px 8px #666; background-color:#ffd; margin:1em;}
td, th { border:1px black solid; vertical-align:top; padding:0.5em;}
td.right { border:0px black solid; float:right; }
td.left { border:0px black solid; align:left; }
tr.t { border-bottom:1px black solid; }
.t td,th { border:0px black solid; }
input { white-space:pre }
.smalltable { border-collapse:collapse; border:2px black inset; margin-left:1em; padding:5px;}
.smalltable td { border:none; vertical-align:top; padding:5px;}
pre.green {white-space:pre; background-color:#9d9; }
pre.red {white-space:pre; background-color:#d99; }
</style>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="pEp_functions.js"></script>
<script type="text/javascript" src="interactive.js"></script>
<script type="text/javascript" src="unittests.js"></script>
<script type="text/javascript" src="test-encode-decode.js"></script>
</head>
<body>
<h1>p≡p JSON Server Adapter – <span id="spn_version">(no JavaScript?)</span></h1>
<h2>1. Send example calls via jQuery</h2>
<form id="frm" name="frm">
<table class="bigtable" id="bigtable">
<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>
<tr><td>Security token:</td>
<td>
<input type="text" id="security_token" size="50" maxlength="80" placeholder="see /tmp/pEp-json-token-*">
</td>
</tr>
<tr><td>Function name:</td><td>
<select name="fn_name" id="fn_name" size="1" onChange="on_select_change()">
<option>–––––</option>
</select>
</td></tr>
<tr><td>Parameters:</td><td id="td_param"></td></tr>
<tr><td colspan="2"> <input type="button" value="Call function!" onClick="button_click()" id="call_btn"> </td></tr>
<tr><td>Debug...</td><td id="deb"><pre id="debug">...</pre></td></tr>
<tr><td>Result:</td><td id="result"><pre id="resultpre">Banana!</pre></td></tr>
</table>
</form>
<form id="frm_2" name="frm_2">
<textarea placeholder="Just a scratchboard for text copy & paste :-)" rows="12" cols="80">
</textarea>
</form>
<hr>
<h2>2. Open WebSocket connection</h2>
<input type="button" onClick="openWebSocket()" id="openWsBtn" value="Open WebSocket!">
<hr>
<h2>3. Execute JavaScript tests</h2>
<p id='unittest_div'>(you have to activate JavaScript in your browser to see something useful here)</p>
<p>Unittest output: <textarea id='unittest_out'></textarea></p>
<hr>
<h2>4. Generate documentation</h2>
<form id="frm_doc" name="frm_doc">
Select output format:
<select id="doc_format" size="1">
<option value="html" checked>HTML Table</option>
<option value="md" >Markdown Table</option>
<option value="trac" >Trac Table</option>
</select>
<button type="button" name="btn_doc" onclick="create_doc()">Create!</button></dd>
</form>
<div id="doc_out" style="background-color:white;border:1px black solid; padding:10px;"></div>
<script type="text/javascript">
init_pEp_functions();
on_select_change();
add_test_buttons();
</script>
</body>
</html>