-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
49 lines (42 loc) · 3.02 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
<html>
<head>
<link href="http://plixitank.heroku.com/stylesheets/screen.css?1295775511" media="screen" rel="stylesheet" type="text/css" />
<!-- Dependencies -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js"></script>
<script type="text/javascript" src="https://github.com/flaptor/indextank-jquery/raw/1.x/jquery.indextank.ize.js"></script>
<script type="text/javascript" src="https://github.com/flaptor/indextank-jquery/raw/1.x/jquery.indextank.autocomplete.js"></script>
<script type="text/javascript" src="https://github.com/flaptor/indextank-jquery/raw/1.x/jquery.indextank.ajaxsearch.js"></script>
<script type="text/javascript" src="https://github.com/flaptor/indextank-jquery/raw/1.x/jquery.indextank.renderer.js"></script>
<script type="text/javascript" src="https://github.com/flaptor/indextank-jquery/raw/1.x/jquery.indextank.statsrenderer.js"></script>
<script type="text/javascript" src="https://github.com/flaptor/indextank-jquery/raw/1.x/jquery.indextank.instantsearch.js"></script>
<script type="text/javascript" src="https://github.com/flaptor/indextank-jquery/raw/1.x/jquery.indextank.basic.js"></script>
<script type="text/javascript" src="https://github.com/rmm5t/jquery-timeago/raw/master/jquery.timeago.js"></script>
<link type="text/css" rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/themes/south-street/jquery-ui.css" media="all" />
<script>
$(document).ready(function(){
var itemRender = function(item) {
var d = $.timeago(new Date(parseInt(item.timestamp)*1000));
return $("<li></li>").append( $("<a></a>")
.attr("href", item.url)
.append( $("<img></img>").attr("src", item.thumbnail))
.append( item.screen_name + " - " + d )
.append( $("<p></p>").text(item.text))
);
};
$("#myform").indextank_Ize('your_indextank_public_api_url', 'your_index_name');
var renderer = $("#results").indextank_Renderer({format: itemRender});
var stats = $("#stats").indextank_StatsRenderer();
$("#query").indextank_Autocomplete().indextank_AjaxSearch( {listeners: renderer.add(stats) ,fields: "*"}).indextank_InstantSearch();
});
</script>
</head>
<body>
<h1>IndexTank static page search demo</h1>
<form id="myform" action="ignored.html">
<input id="query" type="text"/>
</form>
<p id="stats"></p>
<ul id="results"></ul>
</body>
</html>