aboutsummaryrefslogtreecommitdiff
path: root/web/poc_jsonrpc/movies.html
diff options
context:
space:
mode:
authortopfs2 <topfs2@svn>2010-02-14 13:16:20 +0000
committertopfs2 <topfs2@svn>2010-02-14 13:16:20 +0000
commitc6771db8b2fa54d139d808dcf22d1c4b2096d1c7 (patch)
tree68b39517dc0b333d6ddaa3db0fbb2b6329eef343 /web/poc_jsonrpc/movies.html
parentb755c0bcb9cec1597e25f241dd21be46d71dd062 (diff)
Merge commit 'origin/jsonrpc' into trunk
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@27770 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'web/poc_jsonrpc/movies.html')
-rw-r--r--web/poc_jsonrpc/movies.html54
1 files changed, 54 insertions, 0 deletions
diff --git a/web/poc_jsonrpc/movies.html b/web/poc_jsonrpc/movies.html
new file mode 100644
index 0000000000..3e41a62042
--- /dev/null
+++ b/web/poc_jsonrpc/movies.html
@@ -0,0 +1,54 @@
+<html>
+<head>
+<title>XBMC - Movies</title>
+<link type="text/css" rel="stylesheet" href="basic.css">
+<script type="text/javascript" src="json.js"> // FOR browsers which doesn't have it included
+</script>
+<script type="text/javascript">
+function PlayMovie(movieid)
+{
+ alert("Not implemented");
+}
+</script>
+</head>
+<body>
+<h1>Movies</h1>
+
+<script type="text/javascript">
+var http_request = new XMLHttpRequest();
+http_request.open( "POST", "jsonrpc", false );
+var send = { "jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "id": 1 }
+http_request.send("{\"jsonrpc\": \"2.0\", \"method\": \"VideoLibrary.GetMovies\", \"params\": { \"fields\": [\"title\", \"plot\"] }, \"id\": 1}");
+
+var the_object = JSON.parse(http_request.responseText);
+var result = the_object["result"];
+var array = result["movies"];
+
+document.write("<table class=\"Movies\"><thead><tr><th>Thumbnail</th><th>Info</th></tr></thead><tbody>");
+var odd = false;
+for (var property in array) {
+ var item = array[property];
+ var row = "even";
+ if (odd)
+ row = "odd";
+
+ document.write("<tr class=\"" + row + "\"><td class=\"cover\">");
+ if (item["thumbnail"])
+ document.write("<img src=thumb/" + item["thumbnail"] + ".jpg alt=\"" + item["title"] + "\" height=200 onclick=\"PlayMovie(" + item["movieid"] + ")\"></img>");
+ document.write("</td><td>");
+
+ document.write("<table class\"Info\"><tr><td class=\"Title\">");
+ document.write("<h1>" + item["title"] + "</h1>");
+ document.write("</td></tr><tr><td class=\"Plot\">");
+ if (item["plot"])
+ document.write(item["plot"]);
+ document.write("</td></tr></table>");
+
+
+ document.write("</td></tr>");
+ odd = !odd;
+}
+document.write("</tbody></table>");
+</script>
+</body>
+</html>