forked from CodeWithASmile/BoatRemote
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configuration.html
96 lines (80 loc) · 3.01 KB
/
configuration.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
<!DOCTYPE html>
<html class="ui-mobile"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"><!-- base href="http://www.codewithasmile.co.uk/pebble/configuration.html" -->
<title>Boat Remote</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="configuration_files/jquery.css">
<script src="configuration_files/jquery-1.js"></script>
<script src="configuration_files/jquery.js"></script>
<script>
function gup( name ){
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null ) return "";
else return results[1];}
function loadValues() {
$("#server").val(gup("server"));
$("#port").val(gup("port"));
$("#phone_gps").val(gup("phone_gps"));
$("#phone_gps").slider("refresh");
}
function saveOptions() {
var options = {
'server': $("#server").val(),
'port': $("#port").val(),
'phone_gps': $("#phone_gps").val(),
}
return options;
}
$().ready(function() {
$("#b-submit").click(function() {
console.log("Submit");
var location = "pebblejs://close#" + encodeURIComponent(JSON.stringify(saveOptions()));
console.log("Warping to: " + location);
console.log(location);
document.location = location;
});
});
</script>
</head>
<body class="ui-mobile-viewport ui-overlay-c" onload="loadValues()">
<div style="min-height: 678px;" tabindex="0" data-url="main" data-role="page" id="main">
<div role="banner" data-role="header">
<h1 aria-level="1" role="heading" class="ui-title">Boat Remote</h1>
</div>
<div role="main" data-role="content">
<div>
This pebble app requires companion software to function. For more information and to download the software please go to http://www.codewithasmile.co.uk/boat/boat-remote.
</div>
<div data-role="fieldcontain">
<label for="server">Server:</label>
<textarea cols="40" rows="8" name="server" id="server"></textarea>
</div>
<div data-role="fieldcontain">
<label for="port">Port:</label>
<textarea cols="40" rows="8" name="port" id="port"></textarea>
</div>
<div data-role="fieldcontain">
<label class="ui-input-radio" for="phone_gps">Use Phone GPS For Anchor Location:</label>
<select name="phone_gps" id="phone_gps" data-role="slider">
<option value="no">No</option>
<option value="yes">Yes</option>
</select>
</div>
<div>
<fieldset>
<div>
<div>
<fieldset class="ui-grid-a">
<div class="ui-block-b"><button type="submit" data-theme="a" id="b-submit">Submit</button></div>
</fieldset>
</div>
</div>
</fieldset>
</div>
</div>
</div>
<div><span></span><h1>loading</h1></div></body></html>