This repository has been archived by the owner on Aug 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
228 lines (189 loc) · 8.31 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
<title>Bike Bell app</title>
<script src="libs/leaflet.js"></script>
<!-- <script src='https://api.mapbox.com/mapbox.js/v2.2.4/mapbox.js'></script> -->
<script src="libs/jquery/jquery-2.1.4.js"></script>
<script src="libs/jquery-mobile/jquery.mobile-1.4.5.js"></script>
<link rel="stylesheet" href="ui/css/leaflet.css" />
<!-- <link href='https://api.mapbox.com/mapbox.js/v2.2.4/mapbox.css' rel='stylesheet' /> -->
<link rel="stylesheet" href="libs/jquery-mobile/jquery.mobile-1.4.5.css" />
<link rel="stylesheet" type="text/css" href="ui/css/fablab.css" />
<script>
// Redirect console.log to Evothings Workbench.
if (window.hyper && window.hyper.log) {
console.log = hyper.log;
}
</script>
<script src="util.js"></script>
<script src="config.js"></script>
<script>
console.log('===========');
var _VERSION = '0.4.12-20161112';
var settings = window.localStorage;
document.addEventListener(
'DOMContentLoaded',
function () {
logActivity('Application version <strong class="meta version">' + _VERSION + '</strong> loaded on ' + formatTimestamp(new Date()) + ' :: events will be logged here');
});
</script>
<script src="geo.js"></script>
</head>
<body>
<div data-role="page" data-theme="b">
<div data-role="header">
<span class="menu-btn ui-btn ui-btn-left ui-icon-user ui-btn-icon-notext" data-icon="user">User menu</span>
<h1>Sensibel</h1>
<div class="mobile-nav"> <!-- style="display:inline-block;position:absolute; right: 20px; z-index:100;" -->
<a class="menu-btn ui-btn ui-btn-right ui-icon-bars ui-btn-icon-notext" data-icon="bars">Menu</a>
<div class="burger menu">
<ul>
<li><a href="javascript: switchTab($('#nav-map'));"><img src="ui/images/smico3.png" />Map</a></li>
<li><a onclick="$('#dev\\.diagnostics').toggle(); $(this).children('img').toggle();"><img type="application/xml+svg" src="libs/jquery-mobile/images/icons-svg/check-white.svg" />Developer options</a></li>
</ul>
<!--
<menuitem>
<a id="menu.connect" onclick="connect();">Connect</a>
</menuitem>
<menuitem>
<a id="menu.connect" onclick="console.log('blend on'); app.on();">Blend light ON</a>
</menuitem>
<menuitem>
<a id="menu.connect" onclick="console.log('blend off'); app.off();">Blend light OFF</a>
</menuitem>
<menuitem>
<a href="#about">About</a>
</menuitem>
<menuitem>
<a onclick="navigator.app.exitApp();">Restart</a>
</menuitem>
-->
<h3>A group divider</h3>
<ul>
<!-- <li><a onclick="SENSOR.disconn();">Disconnect</a></li> -->
<li><a id="menu.settings" data-rel="popup" href="#settings" data-position-to="window" data-transition="slideup">Settings</a></li>
<li><a onclick="window.location.reload();">Restart</a></li>
<li><a onclick="navigator.app.exitApp();">Exit</a></li>
</ul>
</div>
</div>
<p class="status"><strong class="label">Status: </strong><span id="status">Ready</span></p>
<div role="main" class="ui-content">
<div data-role="tabs" class="ui-tabs">
<div data-role="navbar" class="ui-tabs-nav">
<ul>
<li><a href="#panel-logs" class="ui-tabs-anchor">Logs</a></li>
<li class="ui-tabs-active"><a href="#panel-dash" class="ui-tabs-anchor ui-btn-active">Dashboard</a></li> <!-- FIXME: this option should be default, may be moved to map tab to test map display -->
<li id="nav-map"><a href="#panel-map" class="ui-tabs-anchor">Map</a></li>
</ul>
</div>
<div id="panel-logs" class="ui-tabs-panel swipeable">
<div id="dev.diagnostics" data-role="controlgroup" data-type="horizontal" data-shadow="true" data-theme="a" data-corners="true">
<fieldset>
<legend>Developer diagnostics</legend>
<div class="basic tools">
<input type="button" onclick="basicScan(app.target);" value="Scan" />
<input type="button" onclick="basicConnect(app.target);" value="Connect" />
<input type="button" onclick="basicRead(app.target);" value="Read" />
<input type="button" onclick="basicWrite('BTN_GOOD_FIXME');" style="color:green;" value="Green" />
<input type="button" disabled="disabled" data-disabled="true" onclick="basicWrite(BTN_BAD_FIXME);" style="color:red;" value="Red" />
<input type="button" onclick="basicDisconnect(app.target);" value="Disconnect" />
<input type="button" disabled="disabled" data-disabled="true" onclick="basicCheckStatus(app.target);" value="Check conn" />
<input type="button" onclick="resetBLE(initSensor);" value="Reset BLE" />
<label for="fauxOn">BLE</label>
<!-- NB: this switch won't take effect until next time you connect -->
<input type="checkbox" onchange="config.useFauxConnection=this.checked;" data-theme="b" id="fauxOn" data-role="flipswitch" data-mini="true" data-on-text="Fake" data-off-text="Real" />
</div>
</fieldset>
</div>
<p id="activities" class="console log" />
</div>
<div id="panel-dash" class="ui-tabs-panel swipeable">
<!-- FIXME - just a temporary spacer because I know no better -->
<div id="dash-canvas" class="section map shim hack">
<img class="underlay" src="ui/images/nz-dark-matter-460x310.png" alt="This is your maptain speaking"/>
</div>
<div data-role="controlgroup" data-type="horizontal" class="outer majora">
<input type="button" disabled="disabled" value="Wait" data-wrapper-class="inner majora adaptive wait" id="adaptive-wait" />
<input type="button" onclick="connectSensor();" value="Connect" data-wrapper-class="inner majora adaptive connect" id="adaptive-connect" />
<input type="button" onclick="adaptiveStart();" value="Start" data-wrapper-class="inner majora adaptive start" id="adaptive-start" />
<input type="button" onclick="adaptiveFinish();" value="Finish" data-wrapper-class="inner majora adaptive stop" id="adaptive-stop" />
<input type="button" onclick="adaptiveReview();" value="Review" data-wrapper-class="inner majora adaptive review" id="adaptive-review" />
</div>
</div>
<div id="panel-map" class="ui-tabs-panel" style="height:100%">
<!-- <section id="track"> -->
<div id="track-canvas" class="section map hack"><pre>
Quite
terrible
I
know.
A
spacer
in
the
hackingest
sense
in
stead (yes, 2 words)
of
a
map.
Never
to
be
rendered
or
otherwise
brought
to
light
one
hopes
</pre></div>
<script>
// map.invalidateSize(false);
</script>
</div>
</div>
</div>
</div>
<div data-role="popup" id="settings" class="ui-content" data-title="Settings" data-dismissible="false">
<h4>Sensibel settings</h4>
<form>
<label for="pairedDevice">Device name:</label>
<input type="text" data-setting="pairedDevice" name="pairedDevice" id="pairedDevice" />
<label for="fakeConnect">BLE</label>
<!-- select element required, checkbox/boolean values won't play nicely with localStorage .. -->
<select data-theme="b" data-role="flipswitch" data-mini="true" id="fakeConnect" data-setting="connectAuthenticity" name="fakeConnect" data-disables-selector="#pairedDevice" data-disables-value="fake">
<!-- onchange="document.getElementById('pairedDevice').disabled=(this.value == 'fake')" -->
<option value="fake">Fake</option>
<option value="real">Real</option>
</select>
<label for="riderName">Rider:</label>
<input type="text" data-setting="riderName" name="riderName" id="riderName" />
<fieldset>
<legend>Temporary / Development</legend>
<label for="bucketName">Bucket name:</label>
<input type="text" data-setting="bucketName" name="bucketName" id="bucketName" />
</fieldset>
<input type="reset" value="Cancel" id="action-cancel" />
<input type="submit" value="Save" id="action-save" />
</form>
</div>
</div>
<!-- library code -->
<script src="cordova.js"></script>
<script src="libs/evothings/evothings.js"></script>
<script src="libs/evothings/easyble/easyble.js"></script>
<script src="libs/togeojson.js"></script> <!-- TODO: check if I'm using this one -->
<!-- app inclusions -->
<script src="ui.js"></script>
<script src="sensor.js"></script>
<script src="diagnostics.js"></script>
<script src="sensibell.js"></script>
</body>
</html>