-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpebbleconfig.html
More file actions
85 lines (68 loc) · 3.3 KB
/
pebbleconfig.html
File metadata and controls
85 lines (68 loc) · 3.3 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
<!DOCTYPE html>
<!-- saved from url=(0038)http://getbootstrap.com/examples/grid/ -->
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>SimonRemote Configuration</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<!-- Custom styles for this template -->
<!-- <link href="http://getbootstrap.com/examples/grid/grid.css" rel="stylesheet"> -->
<!-- Just for debugging purposes. Don't actually copy this line! -->
<!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body class="ui-mobile-viewport ui-overlay-a">
<div class="container">
<div class="page-header">
<h1>SimonRemote</h1>
</div>
<div class="form-group">
<label for="exampleInputPassword1">8-Character Channel ID</label>
<input type="text" style="text-transform: uppercase" class="form-control" id="channel" placeholder="ex. ABCDEFGH">
</div>
<button class="btn btn-primary btn-lg btn-save btn-block ui-btn ui-shadow ui-corner-all" onclick="done()">Save</button>
<button class="btn btn-default btn-lg btn-save btn-block ui-btn ui-shadow ui-corner-all" onclick="cancel()">Cancel</button>
<br>
<h4>Note</h4>
To find the 8-Character code associated with your Mac, please install the SimonRemote Mac application from <a href="http://simonremote.github.io">http://simonremote.github.io</a> and click the menu-bar icon.<br><br>
<img src="http://i.imgur.com/ryfHCck.png" alt="SimonRemote Code" >
<br><br>
</div> <!-- /container -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script language="javascript" type="text/javascript">
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
var channel;
function init() {
channel = document.getElementById("channel");
channel.value = window.localStorage.getItem("code");
}
function done() {
var channelCode = channel.value.trim().toUpperCase();
window.localStorage.setItem("code",channelCode);
var data=JSON.stringify({code:channelCode});
var return_to = getParameterByName('return_to') || 'pebblejs://close#';
console.log(return_to + encodeURIComponent(data));
location.href = return_to + encodeURIComponent(data);
}
function cancel() {
location.href = "pebblejs://close";
}
window.addEventListener("load", init, false);
</script>
</body>
</html>