This repository has been archived by the owner on Jul 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
158 lines (132 loc) · 4.05 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
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Themis Geo/Temp Browser</title>
<link rel="stylesheet" href="index.css">
<link rel="stylesheet" href="vendor/simplehistogram/simplehistogram.css">
<script type="text/javascript" src="vendor/simplehistogram/simplehistogram.js"></script>
<link rel="stylesheet" href="vendor/dateflipper/dateflipper.css">
<script type="text/javascript" src="vendor/dateflipper/dateflipper.js"></script>
<link rel="stylesheet" href="vendor/leaflet/leaflet.css">
<script type="text/javascript" src="vendor/leaflet/leaflet.js"></script>
<script type="text/javascript" src="vendor/jquery-1.9.0.min.js"></script>
<script type="text/javascript" src="src/hasEvents.js"></script>
<script type="text/javascript" src="src/app.js"></script>
<script type="text/javascript" src="src/filtersPanel.js"></script>
<script type="text/javascript" src="src/map.js"></script>
<script type="text/javascript" src="src/model.js"></script>
<script type="text/javascript" src="src/resultList.js"></script>
<script type="text/javascript" src="src/tfidf.js"></script>
<script type="text/javascript" src="src/timeHistogram.js"></script>
<style>
html, body {
font-family:"Trebuchet MS", Helvetica, sans-serif;
font-size:14px;
line-height:140%;
margin:0;
padding:0;
background-color:#fdfdfd;
height:100%;
}
#container {
position:relative;
margin:10px;
}
#resultList{
position:relative;
margin-left:330px;
min-height:600px;
border:1px solid #efefef;
}
#sidebar {
position:absolute;
top:30px;
left:10px;
bottom:10px;
width:320px;
}
#map {
position:absolute;
top:0;
width:320px;
height:260px;
border:1px solid #efefef;
}
#filters {
position:absolute;
top:270px;
}
#filters select {
height:20px;
width:320px;
}
#histogram {
position:absolute;
top:300px;
bottom:0;
width:320px;
border:1px solid #efefef;
}
form {
padding:5px 10px;
}
input {
width:316px;
outline:none;
border:1px solid #ccc;
padding:2px;
}
input:focus {
border-color:#aaaaff;
}
.sticky {
position:fixed !important;
top:10px !important;
left:10px !important;
}
</style>
</head>
<body>
<form>
<input type="text" placeholder="Search..."></input>
</form>
<div id="container">
<div id="resultList"></div>
</div>
<div id="sidebar">
<div id="map"></div>
<div id="filters"></div>
<div id="histogram"></div>
</div>
<script type="text/javascript">
jQuery(document).ready(function() {
var searchUI = new SpatioTemporalUI({
resultList: document.getElementById('resultList'),
map: document.getElementById('map'),
filters: document.getElementById('filters'),
timeHistogram: document.getElementById('histogram')
});
// Make the sidebar sticky
var win = jQuery(window),
el = jQuery('#sidebar'),
top = el.offset().top;
win.scroll(function() {
el.toggleClass('sticky', win.scrollTop() > top);
});
// Wire up the the text input field
jQuery('form').submit(function(e) {
e.preventDefault();
// Test scenario 1: update the UI with a query - the UI will pass the query
// to ES by itself
// searchUI.update(jQuery('input').val());
// Test scenario 2: fetch the data via THEMIS (or, in this case, from the dummy
// test data), and update the UI with the data directly
jQuery.getJSON('backmeup-testdata.json', function(data) {
searchUI.update(data)
});
});
});
</script>
</body>
</html>