main.html 1.9 KB
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<title>My own little Web-App</title>
		<link rel="stylesheet" type="text/css" href="/assets/style/common">
		<script type="text/javascript" src="/assets/js/jquery"></script>
		<script type="text/javascript" src="/assets/js/serverval"></script>
		<script type="text/javascript" src="/assets/js/session"></script>
		<script>
			//<![CDATA[
			var sess = null;

			$(document).ready(function() {
				var sval = new ServerVal("#randval");

				sess = new Session("#sessinfo");
				$.getJSON("/sessinfo/", $.proxy(sess.loadJSON, sess));

				$("ul#menu li:eq(0)").click(function() {
					sval.start();
				});

				$("ul#menu li:eq(1)").click(function() {
					$("#login").removeClass("hide");
				});

				$("#randval").click(function() {
					sval.stop();
				});

				$("#login form").submit(function(event) {
					event.preventDefault();
					$.post("/login/",
						$("#login form").serialize(),
						$.proxy(sess.loadJSON, sess));
					$("#login").addClass("hide");
				});
			});
			//]]>
		</script>
	</head>
	<body> 
		<ul id="menu">
			<li>random Value</li>
			<li>login</li>
		</ul>
		<div id="sessinfo" class="x-small">
			Session: <span></span><br />
			<canvas width="100px" height="3px"></canvas>
		</div>
		<div id="login" class="hide">
			<form>
				<input type="text" name="username" />
			</form>
		</div>
		<div id="randval" class="hide">
			<span class=\"small">
				Value created at: <br />
				<span></span><br>
				Next value in: <span></span><br />
			</span>
			Value: <span></span>
		</div>
		<div id="main">
			<h1>Testpage</h1>
			Welcome<span></span>!!!<br />
			<img src="/image/me" />
		</div>
		<hr />
		<div id="msg"></div>
	</body>
</html>

<!-- vim: set ts=4 sw=4: -->