forked from dippi/navigator-proto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
449 lines (441 loc) · 23.1 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
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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Navigator</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link rel="stylesheet" href="static/css/jquery.mobile-1.3.1.min.css" />
<link rel="stylesheet" href="static/css/jqm-icon-pack-2.0-original.css" />
<link rel="stylesheet" href="static/css/leaflet.css" />
<link type="text/css" rel="stylesheet" href="static/css/leaflet.label.css" />
<link rel="stylesheet" href="static/css/main.css" />
<link rel="stylesheet" href="static/css/leaflet.awesome-markers.css" />
<link rel="stylesheet" href="static/css/compass.css" />
<style>
/* Hide all the app pages until jQuery Mobile inits to
avoid the Flash of Unstyled Content */
[data-role=page] { display: none; }
.splashscreen {
width: 100%;
height: 100%;
border: 0;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index:1001;
background: lightgrey;
text-shadow: none;
color: black;
}
</style>
</head>
<body>
<noscript>Error: No Javascript available in your browser.</noscript>
<div id="splashscreen" class="splashscreen" style="display: none" ></div>
<script>
// Show the splash screen with a loading message
// Handler to hide the message when the loading stops
window.onload = function() {
var splashscreenStatus = document.getElementById("splashscreen").style.display;
if (splashscreenStatus != "none") {
document.getElementById("splashscreen").style.display = "none";
};
};
document.getElementById("splashscreen").innerHTML = 'Loading...';
document.getElementById("splashscreen").style.display = 'block';
</script>
<div id="map" style="width: 100%; height: 100%; border: 0;" ></div>
<!-- data-role="page" and other data-roles are jQuery mobile specific widget attributes -->
<!-- The jQuery mobile will link to pages with data-role="page" based on the id attribute.
There are several pages in this index.html document. -->
<!-- Front page -->
<div id="front-page" data-role="page">
<div data-role="header" data-theme="b">
<h1>Navigator</h1>
<!-- Settings button.
data-icon="gear" and class="ui-btn-right" are jQuery mobile specific -->
<a href="#front-page-menu" data-icon="menu" class="ui-btn-right physical-menu-btn" data-rel="popup" data-iconpos="notext" data-transition="slidedown">Menu</a>
</div>
<div data-role="content" id="input-search">
<!-- "Search box" with the list of results for the location that the user wants to go to. -->
<ul id="navigate-to-input" data-role="listview" data-inset="true" data-filter="true" data-filter-placeholder="Where do you want to go?"></ul>
</div>
<div data-role="content" style="height: 63px; text-align: right" ></div>
<div data-role="content" style="position: absolute; width: 100%; bottom: 0; text-align: center; padding-left: 0; padding-right: 0">
<fieldset data-role="controlgroup" data-type="horizontal" data-shadow="true" style="display: inline-block">
<label><input type="checkbox" name="usetransit" checked="checked"><img src="static/images/bus_stop.svg" style="height: 20px;" /></label>
</fieldset>
<fieldset id="vehiclesettings" data-role="controlgroup" data-type="horizontal" data-shadow="true" style="display: inline-block">
<label><input type="radio" name="vehiclesettings" value="WALK" checked="checked"><img src="static/images/walking.svg" style="height: 20px;"/></label>
<label><input type="radio" name="vehiclesettings" value="BICYCLE"><img src="static/images/bicycle.svg" style="height: 20px;"/></label>
<label><input type="radio" name="vehiclesettings" value="CAR"><img src="static/images/car.svg" style="height: 20px;"/></label>
</fieldset>
</div>
<div id="front-page-menu" data-role="popup">
<ul data-role="listview" data-inset="true">
<li><a href="#bus-stop-page" id="show-stops-button">
<h3>See bus stops nearby</h3>
<p>View approaching estimations</p>
</a></li>
<li><a href="#settings">
<h3>Settings</h3>
<p>Access the routing settings.</p>
</a></li>
<li><a href="#service-directory?">
<h3>Find nearest services</h3>
<p>Find a service that is nearest to your current location.</p>
</a></li>
<!-- pageshow event for the map-page is handled in the routing.coffee -->
<li><a href="#map-page">
<h3>Browse map</h3>
<p>Calculate routes and browse for points of interest.</p>
</a></li>
<li><a href="#live-page">
<h3>View live map</h3>
<p>Get a real-time overview of vehicle positions.</p>
</a></li>
<li><a href="#front-page" id="qr-button">
<h3>Scan QR-Code</h3>
<p>Take a destination scanning a QR-Code.</p>
</a></li>
<li><a href="#front-page" id="speech-button">
<h3>Vocal input</h3>
<p>Find an address pronouncing it.</p>
</a></li>
<li><a href="#front-page" id="mac-address">
<h3>Nearest Mac addresses</h3>
<p>Find nearest busses</p>
</a></li>
<li><a href="#front-page" id="ticket-button">
<h3>Buy an internal Helsinki ticket </h3>
<p>Buy a SMS ticket that can be used in Helsinki trains, metro and trams. The ticket costs 2 euros.</p>
</a> </li>
<li><a href="#kutsuplus-page" id="kutsuplus-button">
<h3>Order a Kutsuplus car </h3>
<p>Orders a Kutsuplus car to a bus stop of your choosing</p>
</a> </li>
<li><a href="#front-page" id="stop-watch-disruptions">
<h3>Stop watching disruptions</h3>
<p>Stop receiving notifications about disruptions</p>
</a></li>
<li><a href="#disruptions" id="show-disruptions-trigger">
<h3>View disruptions</h3>
<p>Show received disruptions</p>
</a></li>
<li><a href="#" id="test-message-sender">
<h3>Sent test message</h3>
<p></p>
</a></li>
</ul>
</div>
<!-- add the popup in the frontpage -->
<div data-role="popup" id="add-address" data-icon="delete" data-iconpos="notext" class="ui-content">
<label id="label-name" for="fname">Input tag for this address</label>
<input type="text" name="fname" id="fname" placeholder="Input tag for this address" />
<button id="tag-add">OK</button>
<!-- <a href="#" id="tag-click" data-role="button">OK</a> -->
</div>
<div data-role="popup" id="delete-address" class="ui-content">
<label id="label-name2" for="fname">Are you sure to delete?</label>
<button id="tag-delete">OK</button>
<!-- <a href="#" id="tag-click" data-role="button">OK</a> -->
</div>
</div>
<!-- Map page -->
<div id="map-page" data-role="page">
<div data-role="header" data-theme="b">
<a href="" data-rel="back">Back</a>
<h1 style="margin-bottom: 0; margin-top: 0"><a href="#navigation-page" data-icon="play" data-role="button" data-inline="true" style="margin-top: 3px; margin-bottom: 7px">Let's go</a></h1>
<a href="#map-page-menu" data-icon="menu" class="ui-btn-right physical-menu-btn" data-rel="popup" data-iconpos="notext" data-transition="slidedown" data-shadow="false" data-iconshadow="false">Menu</a>
</div>
<div data-role="footer" data-position="fixed" style="padding: 0; margin: 0; border: 0; overflow: visible;">
<ul id="routes" class="route-list" style="display: block">
<li>
<ul class="route-buttons-0 route-graph" style="display: none">
</ul>
</li>
<li>
<ul class="route-buttons-1 route-graph" style="display: none">
</ul>
</li>
<li>
<ul class="route-buttons-2 route-graph" style="display: none">
</ul>
</li>
</ul>
<form id="comment-box" style="display: none; width: 100%; height: 100%; border: 0;">
<label>
<textarea style="width: 100%; height: 100%;"></textarea>
</label>
<fieldset class="ui-grid-a">
<div class="ui-block-a"><button type="button" class="cancel-button" data-theme="c">Cancel</button></div>
<div class="ui-block-b"><button type="submit" data-theme="b">Submit</button></div>
</fieldset>
</form>
</div>
<div id="error-popup" data-role="popup" data-rel="dialog" data-transition="pop" data-overlay-theme="a">
<div data-role="header">
<h1>Routing failed</h1>
</div>
<div data-role="content">
<p>Error</p>
<a href="#" data-role="button" data-rel="back">Dismiss</a>
</div>
</div>
<div id="map-page-menu" data-role="popup">
<ul data-role="listview" data-inset="true">
<li><a href="#navigation-page" class="journey-preview-link">
<h3>Preview journey</h3>
<p>Start viewing a simulation.</p>
</a></li>
<li><a href="#settings">
<h3>Settings</h3>
<p>Access the routing settings.</p>
</a></li>
<li><a href="" id="watch-disruptions">
<h3>Watch for disruptions</h3>
<p>Watch disruptions for current route.</p>
</a></li>
<!-- <li><a href="#" id="addContactAddress">
<h3>Add Address</h3>
<p>Add Address To Contact</p>
</a></li> --><!-- feature is not supported in that version -->
</ul>
</div>
</div>
<!-- Navigation page -->
<div id="navigation-page" data-role="page">
<div data-role="header" data-theme="b" style="text-align: center">
<a href="" data-rel="back">Back</a>
<h1 style="margin-bottom: 0; margin-top: 0"><a data-icon="pause" data-role="button" class="pause-navigation-link" data-inline="true" style="margin-top: 3px; margin-bottom: 7px">Pause</a></h1>
<a href="#navigation-page-menu" data-icon="menu" class="ui-btn-right physical-menu-btn" data-rel="popup" data-iconpos="notext" data-transition="slidedown">Menu</a>
</div>
<div data-role="footer" data-position="fixed" style="padding: 0; margin: 0; border: 0; overflow: visible;">
<ul class="route-list" style="display: block">
<li>
<ul class="route-buttons-0 route-graph" style="display: none">
</ul>
</li>
<li>
<ul class="route-buttons-1 route-graph" style="display: none">
</ul>
</li>
<li>
<ul class="route-buttons-2 route-graph" style="display: none">
</ul>
</li>
</ul>
</div>
<div id="navigation-page-menu" data-role="popup">
<ul data-role="listview" data-inset="true">
<li><a href="#settings">
<h3>Settings</h3>
<p>Access the routing settings.</p>
</a></li>
</ul>
</div>
</div>
<!-- This page is for palvelukartta.coffee but neither is not used anymore as
the geocoder API is used nowadays. -->
<div id="disruptions" data-role="page" style="background-color: black;">
<div data-role="header">
<a href="" data-rel="back">Back</a>
<h1>Disruptions</h1>
</div>
<div data-role="content">
<ul data-role="listview" style="margin-bottom: 0">
</ul>
</div>
</div>
<div id="find-nearest" data-role="page">
<div data-role="header">
<a href="" data-rel="back">Back</a>
<h1>Find nearest services</h1>
</div>
<div data-role="content">
</div>
</div>
<!-- "Find nearest services" page -->
<div id="service-directory" data-role="page">
<div data-role="header">
<!-- jQuery mobile back button to go one page back in history -->
<a href="" data-rel="back">Back</a>
<h1>Find nearest services</h1>
</div>
<div data-role="content">
<ul data-role="listview">
</ul>
</div>
</div>
<!-- "Nearest services" page -->
<div id="service-list" data-role="page">
<div data-role="header">
<a href="" data-rel="back">Back</a>
<h1>Nearest services</h1>
</div>
<div data-role="content">
<ul data-role="listview">
</ul>
</div>
</div>
<!-- "Nearby bus stops" page -->
<div id="bus-stop-page" data-role="page" style="background-color: black;">
<div data-role="header">
<a href="" data-rel="back">Back</a>
<h1>Bus stops nearby</h1>
</div>
<div data-role="content">
<ul data-role="listview" style="margin-bottom: 0">
</ul>
</div>
</div>
<!-- "Kutsuplus" page -->
<div id="kutsuplus-page" data-role="page" style="background-color: black;">
<div data-role="header">
<a href="" data-rel="back">Back</a>
<h1 id="kutsuplus-page-header">Kutsuplus from:</h1>
</div>
<div data-role="content">
<ul data-role="listview" style="margin-bottom: 0">
</ul>
</div>
</div>
<!-- "Bus stop info" page -->
<div id="bus-stop-info" data-role="page" style="background-color: black;">
<div data-role="header">
<a href="" data-rel="back">Back</a>
<h1 id="bus-stop-info-header">Bus stop info</h1>
</div>
<div data-role="content">
<ul data-role="listview" style="margin-bottom: 0">
</ul>
</div>
</div>
<!-- Settings page -->
<div id="settings" data-role="page">
<div data-role="header">
<a href="" data-rel="back">Back</a>
<h1>Settings</h1>
</div>
<div data-role="content">
<ul data-role="listview" style="margin-bottom: 0">
<li>
<fieldset id="modesettings" data-role="controlgroup" data-type="horizontal">
<label><input type="checkbox" name="BUS"><img src="static/images/bus_stop.svg" style="height: 20px;" /></label>
<label><input type="checkbox" name="TRAM"><img src="static/images/tram_stop.svg" style="height: 20px;"/></label>
<label><input type="checkbox" name="RAIL"><img src="static/images/train_station2.svg" style="height: 20px;"/></label>
<label><input type="checkbox" name="SUBWAY"><img src="static/images/subway.svg" style="height: 20px;"/></label>
</fieldset>
</li>
<li>
<input type="checkbox" name="wheelchair" id="wheelchair" />
<label for="wheelchair"><img src="static/images/wheelchair.svg" height="20" style="margin-right:16px; margin-left: 16px" />Wheelchair accessible</label>
</li>
<li>
<input type="checkbox" name="prefer-free" id="prefer-free" />
<label for="prefer-free">Prefer free routes</label>
</li>
<li>
<input type="checkbox" name="use-speech" id="use-speech" />
<label for="use-speech">Speak navigation instructions</label>
</li>
</ul>
</div>
</div>
<!-- Live map page -->
<div id="live-page" data-role="page">
<div data-role="header" data-theme="b">
<a href="" data-rel="back">Back</a>
<h1>Live map</h1>
</div>
</div>
<script src="cordova.js" type="text/javascript"></script>
<script src="static/js/jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="static/js/handlebars.min.js" type="text/javascript"></script>
<script src="static/js/leaflet.js" type="text/javascript"></script>
<script src="static/js/leaflet.label.js" type="text/javascript"></script>
<script src="static/js/underscore-min.js" type="text/javascript"></script>
<script src="static/js/backbone-min.js" type="text/javascript"></script>
<script src="static/js/moment.min.js" type="text/javascript"></script>
<script src="static/js/leaflet-osm-notes.js" type="text/javascript"></script>
<script src="static/js/leaflet.geometryutil.js" type="text/javascript"></script>
<script src="http://dev.hsl.fi:9002/faye/client.js" type="text/javascript"></script>
<script>
// Functional testing with TestEm using mocha+chai-framework.
if (window.location.hash === '#testem') {
window.testem_mode = true;
jQuery(document).ready(function($) {
$('#front-page').bind('pageinit', function() {
var loadDependencies, suite = '/tests/test_functional.js';
loadDependencies = function(urls, callback) {
if (urls.length > 0) {
$.getScript(urls.shift(0), function() {
loadDependencies(urls, callback);
});
} else { callback(); }
};
loadDependencies([
'/testem/mocha.js', '/testem/chai.js', '/testem.js'
], function() {
mocha.setup('bdd');
$.getScript(suite, function() { mocha.run(); });
});
});
});
}
</script>
<script>
$(document).on("deviceready", function(){
navigator.splashscreen.hide();
});
</script>
<!-- Initialization related code -->
<script src="static/js/init.js" ></script>
<!-- define the functions communicating with background service for notification -->
<script src="static/js/ntfservice.js" ></script>
<!-- Configure the geographical area where the app is to be used in -->
<script src="static/js/config.js" ></script>
<!-- "Colorful iconic & retina-proof markers for Leaflet,
based on the Font Awesome/Twitter Bootstrap icons" -->
<script src="static/js/leaflet-awesome-markers.js" ></script>
<!-- Palvelukartta is not currently used. It utilizes
REST API for City of Helsinki Service Map -->
<script src="static/js/palvelukartta.js" ></script>
<!-- Compass control to show device orientation -->
<script src="static/js/compass.js" ></script>
<!-- Marker rotated with css transform -->
<script src="static/js/rotatedmarker.js" ></script>
<!-- Handles routing and map drawing -->
<script src="static/js/routing.js" ></script>
<!-- Handles autocompletion related tasks for the "Where do you want to go?" filter at the first page -->
<script src="static/js/autocomplete.js" ></script>
<!-- Handles POI related task such as finding nearby services and geocoding -->
<script src="static/js/poi.js" ></script>
<!-- Component that handles communication with the navigator-server that
provides real-time info for the public transportation -->
<script src="static/js/realtime.js" ></script>
<!-- Allow to read an address from a QR-Code -->
<script src="static/js/qrcode.js" ></script>
<!-- Contact Chooser -->
<script src="static/js/contactchooser.js" ></script>
<!-- Actives google speech recognition to pronounce an address -->
<script src="static/js/speechrecognition.js" ></script>
<!-- Load jQuery Mobile as last because init.js handles the jQuery Mobile mobileinit message. -->
<script src="static/js/jquery.mobile-1.3.1.min.js" ></script>
<!-- Handles physical buttons (menu and back) of the phone-->
<script src="static/js/physicalbuttons.js" ></script>
<!-- Handles nearby bus stops logic-->
<script src="static/js/busstops.js" ></script>
<script src="static/js/physicalbuttons.js"></script>
<script src="static/js/nearestmacaddress.js"></script>
<!-- Handles buying the sms ticket -->
<script src="static/js/ticket.js"></script>
<!-- Push disruptions notifications -->
<script src="static/js/notification.js"></script>
<!-- Used for geolocationing -->
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
</body>
</html>