forked from hsenot/bip
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuildings.html
More file actions
270 lines (237 loc) · 8.22 KB
/
buildings.html
File metadata and controls
270 lines (237 loc) · 8.22 KB
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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>BIP - Building Improvement Platform</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Le styles -->
<link rel="stylesheet" href="../openlayers/theme/default/style.css" type="text/css">
<link rel="stylesheet" href="css/ol-style.css" type="text/css">
<link href="../bootstrap/css/bootstrap.css" rel="stylesheet">
<style type="text/css">
body {
padding-top: 60px;
}
.tab-content > #mapTab.active {
display: block;
padding: 0px;
}
#search_box {
padding: 19px 19px 0;
}
legend {
margin-bottom: 5px;
}
</style>
<link href="../bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="index.html">BIP</a>
<div class="nav-collapse">
<ul class="nav">
<li class="active"><a href="buildings.html">Buildings</a></li>
<li><a href="projects.html">Projects</a></li>
<li><a href="data.html">Data</a></li>
<li><a href="people.html">People</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<div class="container">
<div class="tabbable"> <!-- Only required for left/right tabs -->
<ul class="nav nav-tabs">
<li id="dashboardTabLabel" class="active"><a href="#dashboardTab" data-toggle="tab">Dashboard</a></li>
<li id="mapTabLabel"><a href="#mapTab" data-toggle="tab">Search</a></li>
<li id="detailsTabLabel" class="hide"><a href="#detailsTab" data-toggle="tab">Details</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="dashboardTab">
<div class="well">
<h2>Buildings are for people</h2>
</div>
<div class="row">
<div class="span4"><div class="well"><h2>News 1</h2></div></div>
<div class="span4"><div class="well"><h2>News 2</h2></div></div>
<div class="span4"><div class="well"><h2>News 3</h2></div></div>
</div>
<div class="row">
<div class="span4"><div class="well"><h2>Average / median</h2></div></div>
<div class="span4"><div class="well"><h2>Ranking</h2></div></div>
<div class="span4"><div class="well"><h2>Tip of the day</h2></div></div>
</div>
</div>
<div class="tab-pane" id="mapTab">
<div class="well" id="search_box" style="text-align: center">
<form class="form-search">
<input type="text" class="input-large search-query">
<button class="btn btn-small" href="#"><i class="icon-search"></i></button>
<p id="current_building"></p>
</form>
</div>
<div id="map" class="smallmap"></div>
</div>
<div class="tab-pane" id="detailsTab">
<div class="well" id="building_details">
<div class="row">
<div class="span8 offset2">
<form id='buildingDetailsForm'>
<legend><h2>Building name</h2></legend>
</form>
</div>
</div>
<div class="row">
<div class="span8 offset2">
<div id='buildingProjectsTable'>
</div>
<a id="addProjectShowButton"><i class="icon-plus"></i>Add a new project</a>
<div id='addProjectForm' class="hide">
<form id='buildingAddProjectForm'>
<label>Description</label>
<textarea rows="3" id='addProjectDesc'></textarea>
<label>Funding</label>
<select id='addProjectFund'>
<option>1</option>
<option>2</option>
<option>3</option>
</select>
<label>Cost</label>
<div class="input-prepend">
<span class="add-on">$</span><input type="text" id='addProjectCost'>
</div>
<label>Payback period</label>
<div class="input-append">
<input type="text" id='addProjectPayback'><span class="add-on">year(s)</span>
</div>
<label>Emission reduction</label>
<div class="input-append">
<input type="text" id='addProjectEmission'><span class="add-on">t CO2-e/year</span>
</div>
<div class="form-actions">
<input class="btn" type="button" value="Cancel" id="addProjectCancelButton">
<input class="btn btn-primary" type="button" value="Add" id="addProjectFormButton">
</div>
</form>
</div>
</div>
</div>
<div class="row">
<div class="span8 offset2">
<form>
<legend><h2>Data</h2></legend>
Data API by OSM_ID
</form>
</div>
</div>
<div class="row">
<div class="span8 offset2">
<form>
<legend><h2>People</h2></legend>
People API by OSM_ID
</form>
</div>
</div>
<div class="row">
<div class="span8 offset2">
<form>
<legend><h2>Other information & services</h2></legend>
Google Street View
<br>Flickr/Panoramio
<br>Wikipedia
<br>Nearby Tweets
<br>User-uploaded photos and documents
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<hr>
<footer>
<p align="center">Developers: plug your data with the API or fork the platform code on GitHub.</p>
</footer>
</div> <!-- /container -->
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="../openlayers/OpenLayers.js"></script>
<!-- Letting Google host and serve jQuery for us -->
<!-- based on http://encosia.com/3-reasons-why-you-should-let-google-host-jquery-for-you/ -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<script src="../bootstrap/js/bootstrap.js"></script>
<script src="js/building.js"></script>
<script>
var showBuildingDetails;
function getURLParameter(name) {
return decodeURI(
(RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]
);
}
$(document).ready(function () {
$.fn.clearForm = function() {
return this.each(function() {
var type = this.type, tag = this.tagName.toLowerCase();
if (tag == 'form')
return $(':input',this).clearForm();
if (type == 'text' || type == 'password' || tag == 'textarea')
this.value = '';
else if (type == 'checkbox' || type == 'radio')
this.checked = false;
else if (tag == 'select')
this.selectedIndex = -1;
});
};
// Checking if a building number has been passed
var url_osm_id = getURLParameter('osm_id');
if (url_osm_id !== "null")
{
// Then we bring the detail tab and the right building details
showBuildingDetails(url_osm_id);
}
// Window resize function
var rsz = function(){
var h = $(window).height();
var w = $(window).width();
var tw;
// Debug display for map size
//$("#search_box").html('Total: '+w+' px, map: '+$("#map").width()+' px');
// Setting height to window height minus the header and footer sizes
$("#map").css('height',h-280);
// Setting width to a size following the liquid layout breaks
if (w>=1200){tw = 569*2;}
if (w<1200){tw = 459*2;}
if (w<980){tw = 351*2;}
if (w<745){tw = w-45;}
$("#map").css('width', tw);
};
// Initial width/height values are required for display of vector layer
rsz();
// Initialising the map when the map tab is clicked for the first time
$('#mapTabLabel').click(function(){
if (!(olmap))
{
// Initialising sequence
init();
// Resizing on window resize
$(window).resize(rsz);
}
});
});
</script>
</body>
</html>