org.symbian.tools.wrttools.previewer/http-content/wrtdebugger/debugger.jsp
author Eugene Ostroukhov <eugeneo@symbian.org>
Tue, 13 Apr 2010 16:04:08 -0700
changeset 303 a619b3ef3095
parent 41 fc4a1d68260a
permissions -rw-r--r--
Bug 2482 - Store previewer user information in workspace

<%@ page import="org.symbian.tools.wrttools.previewer.http.WebAppInterface" %>
<%
	String widget = WebAppInterface.decode(request.getParameter("widget"));
	String id = request.getParameter("session");
%>
<html>
<head>
	<title><%=widget %></title>
	<% WebAppInterface.connectDebugger(widget, id); %>
	<script type="text/javascript">
		var req;
		
		function connect() {
			req = new XMLHttpRequest();
			req.onreadystatechange = testconnection;
			req.open("GET", "<%=WebAppInterface.getAjaxUri(widget, id) %>", true);
			req.send(null);
		}
		
		function testconnection() {
			if (req.readyState == 4) {
				if (req.status == 200) {
					window.setTimeout(connect, 200);
				} else {
					window.location = '<%=WebAppInterface.getUrl(widget, id) %>';
				}
			}
		}
	</script>
</head>
<body onload="connect()">
Establishing debug connection...
</body>