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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
|
<!DOCTYPE html>
<html>
<head>
<title>dump.fm image search</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="keywords" content="dump.fm,hot girls, hot guys, image chat, realtime, internet 3.0, dump, dump fm, image dump, pictures, image links, image board">
<meta name="description" content="dump.fm - Talk with pictures!" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://dump.fm/static/js/jquery-ui-1.8.effects.min.js"></script>
<script type="text/javascript" src="http://dump.fm/static/js/pichat.js"></script>
<link rel="stylesheet" type="text/css" href="http://dump.fm/static/css/dump.css">
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/ui-lightness/jquery-ui.css"
type="text/css" media="all" />
<link rel="stylesheet" href="http://dump.fm/static/css/admin.css"
type="text/css" media="all" />
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js"
type="text/javascript"></script>
<script src="http://dump.fm/static/js/admin.js" type="text/javascript"></script>
<link rel="shortcut icon" href="http://dump.fm/static/favicon.ico">
<!--[if IE]>
<script>
window.location = "http://dump.fm/error/ie";
</script>
<![endif]-->
<style>
body{margin:6%;}
img { max-width: 400px; max-height: 400px;}
h1 { width: 40%; display:inline-block; margin: 20px; font-size: 30px;}
#content { overflow: visible}
#content a { position: relative; display:inline-block; }
#content a canvas { position:absolute; z-index: 0; top: 0; left: 0; }
#content a img { position:absolute; z-index: 1; top:0; left: 0; }
#content a.animating canvas { display: none }
</style>
</head>
<body class="profile" style="margin:1%;">
<center>search dumps: <input type="text" name="search-query" id="search-query" /></center><br><br>
<center><div id="message"></div><br><br></center>
<div id="content">
</div>
</body>
<script>
$('#content a').live('hover', function(event) {
if (event.type == 'mouseover') {
var i = imageCache[this.index]
if (i.animated) {
i.img.width = Math.floor(i.width / 2)
i.img.height = Math.floor(i.height / 2)
$(this).addClass("animating")
$(this).append(i.img)
}
} else {
var i = imageCache[this.index]
if (i.animated) {
$(this).removeClass("animating")
this.removeChild(i.img)
}
}
});
var term = ""
var imagesPerPage = 25;
var images = []
var imageCache = []
var Search = {};
function addScript(term){
jQuery("#search-script").remove()
jQuery("head").append("<scr"+"ipt src='http://dump.fm/cmd/ghettosearch/"+term+"' id='search-script'></sc"+"ript>")
}
function setContent(x){
jQuery("#content").html(x)
}
function setMessage(x){
jQuery("#message").html(x)
}
Search.searchError = function(error){
setContent("")
setMessage(error)
}
var LoadedCheckerTimer = 0;
function startLoadedChecker(){
stopLoadedChecker()
LoadedCheckerTimer = setTimeout(loadedChecker, 500)
}
function loadedChecker(){
for(var j =0; j<imageCache.length; j++){
var i = imageCache[j];
if (i.img.complete && !i.shown) {
if (i.img.height == 0 || i.img.height == NaN || i.img.width == 0 || i.img.width == NaN) {
i.shown = true; continue;
}
//console.log("loaded " + i.img.src + " " + i.img.width + "x" + i.img.height)
i.width = i.img.width
i.height = i.img.height
var width = Math.floor(i.img.width / 2)
var height = Math.floor(i.img.height / 2)
var c = document.createElement("canvas")
c.width = width
c.height = height
c.index = j
var ctx = c.getContext('2d');
ctx.drawImage(i.img, 0, 0, c.width, c.height)
var a = document.createElement("a")
a.index = j
a.href = i.img.src
a.style.width = width + "px"
a.style.height = height + "px"
a.id = "imagelink-" + j;
a.appendChild(c)
$("#content").append(a)
i.shown = true
}
}
LoadedCheckerTimer = setTimeout(loadedChecker, 500)
}
function stopLoadedChecker(){
clearTimeout(LoadedCheckerTimer)
}
function renderPage(num){
setContent("")
delete window['imageCache']
imageCache = []
var tempLimit = 200;
for(var i=0; i<images.length && i<tempLimit; i++) {
var img = new Image();
img.src = images[i];
var animated = (parseUri(img.src)["file"].toLowerCase().substr(-3) == "gif") ? true : false;
imageCache.push({"img": img, "shown": false, "animated": animated})
}
startLoadedChecker();
/*if (images.length > 0)
setMessage("page " + (num + 1));
var contentString = ''
var start = num * imagesPerPage
var imageCounter = 0
for(var i = start; i < images.length; i++){
if(imageCounter > imagesPerPage) break;
contentString += '<a href="'+images[i]+'"><img src="'+images[i]+'"></a>'
imageCounter += 1
}
contentString += '<br><br>'
if(num > 0)
contentString += '<a href="javascript:renderPage('+(num-1)+')"><h1>previous</h1></a> '
if (images.length > start + imageCounter)
contentString += ' <a href="javascript:renderPage('+(num+1)+')"><h1>next</h1></a>'
setContent(contentString)*/
}
Search.searchResult = function(results){
images = []
if(results === null || results.length == 0) {
setContent("")
setMessage("no results found")
} else {
for(var r = 0; r<results.length; r++)
images.push(results[r].url)
renderPage(0)
}
}
var tokens = []
function doSearch(){
term = jQuery("#search-query").val().trim().toLowerCase()
var rawTokens = term.split(" ")
tokens = []
for(var t = 0; t < rawTokens.length; t++) {
if (rawTokens[t].length > 2)
tokens.push(rawTokens[t])
}
if (tokens.length == 0) {
setMessage("search query too small")
} else {
setMessage("searching for '"+tokens.join(" and ")+"'")
addScript(tokens.join("+"))
}
}
jQuery("#search-query").keydown(ifEnter(doSearch))
</script>
</html>
|