-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathappinput.html
129 lines (120 loc) · 4.66 KB
/
appinput.html
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
<title>Remoku App Input Test</title>
<style>
body{text-align:left; margin:0;padding:0;}
.icons{max-height:75px;}
ul{margin:0;padding:0;}
li{list-style-type: none; margin-top:5px; margin-left:0px; height:100px; padding:0; }
a{text-decoration:none;color:black;}
img{vertical-align:middle; line-height: 2em}
</style>
<script>
var rokupostframe;
var rokuAddress = "192.168.1.10";
var appidarray = [];
function loadRokuImages(){
var appid = appidarray.shift();
document.getElementById(appid).src = 'http://' + rokuAddress +':8060/query/icon/' + appid;
}
function rokupost(action, param){
if(!rokupostframe){
rokupostframe = document.createElement("iframe");
rokupostframe.name="rokuresponse"
rokupostframe.id="rokuresponse";
rokupostframe.style.visibility="hidden";
rokupostframe.style.display="none";
rokupostframe = document.body.appendChild(rokupostframe);
}
var rokupost = document.getElementById('rokupost');
rokupost.setAttribute("action", "http://" + rokuAddress + ":8060/" +
action + "/" + param);
rokupost.submit();
//rokupost.focus();
return false;
}
function rokulaunch(id){
//alert (id);
rokupost("launch",id);
}
function clickme(){
var textin = document.getElementById("in").value;
var applist = document.getElementById("applist");
var apparray = [];
if (window.DOMParser)
{
parser=new DOMParser();
xmlDoc=parser.parseFromString(textin,"text/xml");
}
else // Internet Explorer
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.loadXML(textin);
}
apps = xmlDoc.getElementsByTagName("app");
for (i=0;i<apps.length;i++)
{
var appid = apps[i].attributes.getNamedItem("id").value;
var appname = (apps[i].childNodes[0].nodeValue);
//alert(appname + " " + appid);
var appitem = document.createElement('li');
appitem.innerHTML = "<a href='#"+appid+"' onclick='rokulaunch("+ appid +");'>" +
"<img class='icons' id=" + appid + " onload='loadRokuImages()'> " +
appname + "</>"; //src='http://' + rokuAddress +':8060/query/icon/' + appid
applist.appendChild(appitem);
appidarray.push(appid);
}
appid = appidarray.shift();
document.getElementById(appid).src = 'http://' + rokuAddress +':8060/query/icon/' + appid;
// Move innerHTML calls to array,
}
</script>
</head>
<body>
<div id="container">
<textarea id="in" style="width:240px; height:240px;">
<apps>
<app id="11" version="2.1.21">Roku Channel Store</app>
<app id="12" version="2.2.11">Netflix</app>
<app id="1453_c" version="1.1.100925">TuneIn Radio</app>
<app id="28" version="1.0.22">Pandora</app>
<app id="2049" version="1.82.0">MOG music</app>
<app id="13" version="1.0.9">Amazon Instant Video</app>
<app id="2285" version="1.1.3">Hulu Plus</app>
<app id="2267" version="1.1.0">HGTV</app>
<app id="1152_1" version="0.0.0">TED Talks HD</app>
<app id="1968" version="1.0.101028">Flixster</app>
<app id="45" version="1.5.0">Revision3</app>
<app id="1489_6" version="1.3.101209">YouTube</app>
<app id="199" version="1.1.110207">The TWiT Netcast Network</app>
<app id="1688" version="1.5.110103">Roku Newscaster</app>
<app id="1980" version="1.1.100907">Vimeo</app>
<app id="1997" version="1.1.5">Chow</app>
<app id="1418_0" version="1.2.20">Nowhere TV</app>
<app id="1883" version="1.1.1">Picasa Web Albums</app>
<app id="2785" version="1.4.0">iTunes Podcasts</app>
<app id="2898" version="0.0.0">Weather Underground</app>
<app id="3032" version="1.3.0">tv.com</app>
<app id="2835_f" version="1.0.110112">Roku USB Media Player</app>
<app id="3261" version="1.0.3">Photo Puzzle</app>
<app id="2115" version="1.4.1">SHOUTcast Internet Radio</app>
<app id="3128" version="1.0.135">Gabby (Beta)</app>
<app id="1616" version="1.0.1">NASA TV</app>
<app id="2946_2" version="1.0.12">FoxNews.com Live</app>
<app id="2016_b" version="2.0.19">Movies on Demand</app>
<app id="dev" version="0.1.7">Quick Stream</app>
</apps>
</textarea>
<button id="clickme" onclick="clickme();">Submit Apps</button>
</div>
<div id="apps">
<ul id="applist">
</ul>
</div>
<form id="rokupost" method="post" target="rokuresponse"></form>
</body>
</html>