/
index.html
106 lines (90 loc) · 2.87 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<link type="text/css" rel="stylesheet" href="/stylesheets/main.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<title>Random Awesomeness</title>
<script type="text/javascript">
function cleanTitle(){
newMessageCount = 0;
newLastMessage = currentDate.getTime() - 36000000
lastMessage = currentDate.getTime() - 36000000;
document.title = 'Random Awesomeness';
}
window.onblur = function (){ window_focus = false; }
window.onfocus = function (){ window_focus = true; cleanTitle(); }
window.onload = window.onfocus;
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-22008857-1']);
_gaq.push(['_setDomainName', '.randomchatroom.net']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<SCRIPT TYPE="text/javascript">
<!--
if (document.domain == "randomguestbook.appspot.com")
{
window.location.href = "http://the.randomchatroom.net/"
}
function submitEnter(e)
{
if (e.keyCode == 13)
{
$("form").submit();
return false;
}
}
function scheduleUpdate(){
setTimeout('ajaxUpdate()', 10000);
}
function ajaxUpdate(){
$.ajax({
url: "messages/"+document.URL.replace("http://","").split("/")[1].toUpperCase(),
context: document.body,
success: function(data, textStatus, jqXHR){
$("#messages").html(data);
scheduleUpdate();
}
});
}
var submittedAt = new Date(0);
$(document).ready(function(){
ajaxUpdate();
$('#content').keypress(submitEnter);
$('form').submit(function(){
if (('#content').value == ""){
return false;
}
var now = new Date();
var lastSubmitted = now.getTime() - submittedAt.getTime();
if(lastSubmitted < 3000){
return false;
}
submittedAt = new Date();
});
})
//-->
</SCRIPT>
</head>
<body>
<div style="float: right"><a href="/info/about.html">About</a></div>
<div>Hi! Please write something! Press enter to submit.</div>
<form action="/messages/" method="post">
<div><textarea id="content" name="content" rows="3" cols="60" required="required"></textarea></div>
Alias: <input type="text" name="alias" value='{{alias}}' /><input type="submit" value="Submit">
<input type="hidden" name="room" value="{{room}}"/>
</form>
<br/>
<div id="messages">
</div>
<noscript>
<div>Please enable Javascript to view messages.</div>
</noscript>
</body>
</html>