diff options
author | topfs2 <topfs2@svn> | 2010-04-06 17:14:52 +0000 |
---|---|---|
committer | topfs2 <topfs2@svn> | 2010-04-06 17:14:52 +0000 |
commit | 50cec292e0035656a1883f9388bac32e48e76e1f (patch) | |
tree | 773c88dd355da7bd0b6dca7ea19ece84653a347f /web | |
parent | 79290ff559174186823830c18eb94fd8fd2be9ca (diff) |
Let album and artist views in webinterface use the new play feature
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@29085 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'web')
-rw-r--r-- | web/poc_jsonrpc/albums.html | 9 | ||||
-rw-r--r-- | web/poc_jsonrpc/artists.html | 8 |
2 files changed, 16 insertions, 1 deletions
diff --git a/web/poc_jsonrpc/albums.html b/web/poc_jsonrpc/albums.html index 5feee87391..f49fcfdcc6 100644 --- a/web/poc_jsonrpc/albums.html +++ b/web/poc_jsonrpc/albums.html @@ -3,6 +3,13 @@ <title>XBMC - Albums</title> <link type="text/css" rel="stylesheet" href="basic.css" /> <script type="text/javascript" src="json.js" /> +<script type="text/javascript"> +function CallPlay(album) { + var http_request = new XMLHttpRequest(); + http_request.open( "POST", "jsonrpc", false ); + http_request.send("{\"jsonrpc\": \"2.0\", \"method\": \"AudioPlaylist.Play\", \"params\": { \"albumid\": " + album + " }, \"id\": 1}"); +} +</script> </head> <body> <table class="Navigation"> @@ -35,10 +42,12 @@ var result = the_object["result"]; var array = result["albums"]; for (var property in array) { var item = array[property]; + document.write("<a href=\"nowplaying.html\" onclick=CallPlay(" + item["albumid"] + ")>"); if (item["thumbnail"]) document.write("<img src=thumb/" + item["thumbnail"] + ".jpg width=100 alt=\"" + item["album"] + "\"></img>"); else document.write("<img src=images/DefaultAlbumCover.png width=100 alt=\"" + item["album"] + "\"></img>"); + document.write("</a>"); } </script> diff --git a/web/poc_jsonrpc/artists.html b/web/poc_jsonrpc/artists.html index ae19840051..86daed3f30 100644 --- a/web/poc_jsonrpc/artists.html +++ b/web/poc_jsonrpc/artists.html @@ -4,6 +4,12 @@ <link type="text/css" rel="stylesheet" href="basic.css" /> <script type="text/javascript" src="json.js" /> <script type="text/javascript"> +function CallPlay(album) { + var http_request = new XMLHttpRequest(); + http_request.open( "POST", "jsonrpc", false ); + http_request.send("{\"jsonrpc\": \"2.0\", \"method\": \"AudioPlaylist.Play\", \"params\": { \"albumid\": " + album + " }, \"id\": 1}"); +} + function writeArtist( artist ) { document.write("<h2>" + artist["label"] + "</h2>"); @@ -17,7 +23,7 @@ function writeArtist( artist ) { for (var property in array) { var item = array[property]; - document.write("<a href=\"nowplaying.html\">"); + document.write("<a href=\"nowplaying.html\" onclick=CallPlay(" + item["albumid"] + ")>"); if (item["thumbnail"]) document.write("<img src=\"thumb/" + item["thumbnail"] + ".jpg\" class=\"cover\" alt=\"" + item["label"] + "\"></img>"); else |