aboutsummaryrefslogtreecommitdiff
path: root/web/poc_jsonrpc/development.html
blob: 7e6f4175c16a04d25379a2eb9f1d767b6c1aa4e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<html>
<head>
<title>XBMC - Development</title>
<link type="text/css" rel="stylesheet" href="basic.css" />
<script type="text/javascript" src="json.js" />
</head>
<body>
<table class="Navigation">
<tr class="primary">
  <td class="unselected"><a href="nowplaying.html">Now playing</a></td>
  <td class="unselected"><a href="movies.html">Videos</a></td>
  <td class="unselected"><a href="artists.html">Music</a></td>
  <td class="selected">Development</td>
</tr>
</table>
<br />

<script type="text/javascript">
var http_request = new XMLHttpRequest();
http_request.open( "POST", "jsonrpc", false );
http_request.send("{\"jsonrpc\": \"2.0\", \"method\": \"JSONRPC.Introspect\", \"id\": 1}");

var the_object = JSON.parse(http_request.responseText);
var result = the_object["result"];
var commands = result["commands"];
document.write("<table class=\"Introspect\"><thead><tr><th>Command</th><th>Executable</th><th>Permission</th><th>Description</th></tr></thead><tbody>");
for (var property in commands) {
  var item = commands[property];

  document.write("<tr class=\"" + (property % 2 == 0 ? "even" : "odd") + "\">");
  document.write("<td class=\"command\">"     + item["command"]     + "</td>");
  document.write("<td class=\"executable\">"  + item["executable"]  + "</td>");
  document.write("<td class=\"permission\">"  + item["permission"]  + "</td>");
  document.write("<td class=\"description\">" + item["description"] + "</td>");
  document.write("</tr>");
}
document.write("</tbody></table>");
</script>
</body>
</html>