-
Notifications
You must be signed in to change notification settings - Fork 0
/
oldindex.html
135 lines (121 loc) · 3.67 KB
/
oldindex.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Random kitteh of the now</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<style type="text/css">
img {
display:block;
margin-left: auto;
margin-right: auto;
border: 15px black solid;
border-radius: 15px;
-moz-border-radius: 15px;
}
body {
background-image: url('bg.png');
color: gray;
}
h1 {
text-align: center;
color:white;
text-shadow: white 0px 0px 10px;
}
.warning {
text-align: center;
color:red;
text-shadow: red 0px 0px 25px;
}
#footer {
color: black;
font-size:0.75em;
text-align: center;
position: fixed;
bottom: 5px;
text-shadow: white 0px 0px 5px;
}
#infobox {
background: black;
border: 5px black;
border-radius: 15px;
-moz-border-radius: 15px;
padding: 15px;
width: 300px;
font-style: italic;
margin: 0 auto;
}
a {
color: white;
}
#image {
background: black;
}
</style>
<script type="text/javascript">
function setImage() {
var imageName = window.location.hash.substring(1);
imageName = imageName.replace('<', '').replace('/', '').replace(':', '');//prevent xss?
document.getElementById('image').src = "http://lolcats.iskrembilen.com/imgs/" + imageName;
}
function getNew() {
var hasImage;
if (document.getElementById("image").src == "http://lolcats.iskrembilen.com/") {
hasImage = false;
} else {
hasImage = true;
}
var request = window.XMLHttpRequest ? new XMLHttpRequest() : new new ActiveXObject("MSXML2.XMLHTTP.3.0");
request.open("get", "http://lolcats.iskrembilen.com/ajax.php", true);
request.onreadystatechange = function(){
if (request.readyState == 4 && request.status == 200) {
if (request.responseText){
document.getElementById("newLink").href = "http://lolcats.iskrembilen.com/#" + request.responseText;
}
}
}
request.send(null);
}
function load() {
if (window.location.hash == "") {
var request = window.XMLHttpRequest ? new XMLHttpRequest() : new new ActiveXObject("MSXML2.XMLHTTP.3.0");
request.open("get", "http://lolcats.iskrembilen.com/ajax.php", true);
request.onreadystatechange = function() {
if (request.readyState == 4 && request.status == 200) {
if (request.responseText) {
document.getElementById("image").src = "http://lolcats.iskrembilen.com/imgs/" + request.responseText;
window.location.hash = "#" + request.responseText;
}
}
}
request.send(null);
getNew();
} else {
setImage();
getNew();
}
document.getElementById("page").style.display = 'block';
}
function clicked() {
document.getElementById("image").src = "http://lolcats.iskrembilen.com/wait.gif";
window.location = document.getElementById("newLink").href;
setImage();
getNew();
}
</script>
</head>
<body onload="javascript:load()" onhashchange="javscript:setImage()">
<noscript>
<h1><span class='warning'>PLZ 2 ENABLE JAVASCRIPT</span></h1>
<p class='warning'><a href='old.php'>... or click here for the old stupid version.</a></p>
</noscript>
<div id='page' style="display:none">
<h1>Random lolcat</h1>
<a href='#' id='newLink' onclick="javascript:clicked();">
<img src='' alt='lolcat' id='image' />
</a>
<p id="infobox">Click the image for a new, random one.</p>
</div>
<p id="footer"> page © 2011 <a href="mailto:[email protected]">sandsmark</a></p>
</body>
</html>