author | tasneems@symbian.org |
Thu, 11 Mar 2010 13:15:14 -0800 | |
changeset 252 | 87ba64dae28d |
parent 41 | fc4a1d68260a |
permissions | -rw-r--r-- |
41
fc4a1d68260a
Preview is now feeded from the embedded HTML server
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
1 |
<%@ page import="org.symbian.tools.wrttools.previewer.http.WebAppInterface" %> |
2 | 2 |
<% |
3 |
String widget = WebAppInterface.decode(request.getParameter("widget")); |
|
4 |
String id = request.getParameter("session"); |
|
5 |
%> |
|
6 |
<html> |
|
7 |
<head> |
|
8 |
<title><%=widget %></title> |
|
9 |
<% WebAppInterface.connectDebugger(widget, id); %> |
|
10 |
<script type="text/javascript"> |
|
11 |
var req; |
|
12 |
||
13 |
function connect() { |
|
14 |
req = new XMLHttpRequest(); |
|
15 |
req.onreadystatechange = testconnection; |
|
16 |
req.open("GET", "<%=WebAppInterface.getAjaxUri(widget, id) %>", true); |
|
17 |
req.send(null); |
|
18 |
} |
|
19 |
||
20 |
function testconnection() { |
|
21 |
if (req.readyState == 4) { |
|
22 |
if (req.status == 200) { |
|
23 |
window.setTimeout(connect, 200); |
|
24 |
} else { |
|
25 |
window.location = '<%=WebAppInterface.getUrl(widget, id) %>'; |
|
26 |
} |
|
27 |
} |
|
28 |
} |
|
29 |
</script> |
|
30 |
</head> |
|
31 |
<body onload="connect()"> |
|
32 |
Establishing debug connection... |
|
33 |
</body> |