main.html
1.89 KB
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
<?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 You!!!<br />
<img src="/image/me" />
</div>
<hr />
<div id="msg"></div>
</body>
</html>
<!-- vim: set ts=4 sw=4: -->