This repository has been archived by the owner on Feb 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig.html
224 lines (205 loc) · 7.46 KB
/
config.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
<html>
<head>
<title>2cloud</title>
<link href="http://fonts.googleapis.com/css?family=Josefin+Sans:100,100italic,300,300italic,400,400italic,600,600italic,700,700italic" rel="stylesheet" type="text/css" >
<link href="http://fonts.googleapis.com/css?family=Tinos:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css" >
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.8.13/jquery-ui.min.js"></script>
<style type="text/css">
body {
font-family: 'Lato', sans-serif;
background-color: #3C5A76;
background: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 600, from(#7393AC), to(#3C5A76));
background: -moz-radial-gradient(50% 50%, farthest-side, #7393AC, #3C5A76);
}
#header {
width: 100%;
text-align: right;
link-decoration: none;
text-color: #FFFFFF;
}
#menubar {
width: 15%;
float: left;
}
#menubar li {
padding-top: 5px;
}
#content {
width: 65%;
margin: 0 auto;
}
#progress {
font-size: 28px;
text-align: center;
width: 100%;
font-family: 'Lato', sans-serif;
font-weight: 600;
position: fixed;
bottom: 0px;
margin-bottom: 36px;
}
#instructions {
padding: 1%;
font-size: 18px;
color: #FFFFFF;
text-shadow: 0px 2px 3px #555;
font-size: 28px;
margin: 0 auto;
}
#continue {
text-align: right;
width: 100%;
}
#footer {
text-align: center;
width: 100%;
clear: both;
padding-top: 2%;
font-size: 14px;
position: fixed;
bottom: 0px;
color: #FFFFFF;
text-shadow: 0px 2px 3px #555;
}
.bullet {
padding: 2px;
font-size: 46px;
opacity: 0.5;
}
.completed {
color: #ffffff;
}
.centered {
margin: 0px auto;
text-align: center;
}
.continuebutton {
-moz-box-shadow:inset 0px 1px 0px 0px #ffffff;
-webkit-box-shadow:inset 0px 1px 0px 0px #ffffff;
box-shadow:inset 0px 1px 0px 0px #ffffff;
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #dfdfdf) );
background:-moz-linear-gradient( center top, #ededed 5%, #dfdfdf 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#dfdfdf');
background-color:#ededed;
-moz-border-radius:6px;
-webkit-border-radius:6px;
border-radius:6px;
border:1px solid #dcdcdc;
display:inline-block;
color:#444444;
font-family:arial;
font-size:15px;
font-weight:bold;
padding:6px 24px;
text-decoration:none;
text-shadow:1px 1px 0px #ffffff;
}
.continuebutton:hover {
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #dfdfdf), color-stop(1, #ededed) );
background:-moz-linear-gradient( center top, #dfdfdf 5%, #ededed 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#dfdfdf', endColorstr='#ededed');
background-color:#dfdfdf;
}
.continuebutton:active {
position:relative;
top:1px;
}
.textarea {
-moz-box-shadow:inset 0px 1px 0px 0px #ffffff;
-webkit-box-shadow:inset 0px 1px 0px 0px #ffffff;
box-shadow:inset 0px 1px 0px 0px #ffffff;
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #dfdfdf) );
background:-moz-linear-gradient( center top, #ededed 5%, #dfdfdf 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#dfdfdf');
background-color:#ededed;
-moz-border-radius:6px;
-webkit-border-radius:6px;
border-radius:6px;
border:1px solid #dcdcdc;
display:inline-block;
color:#444444;
font-family:arial;
font-size:25px;
font-weight:bold;
text-decoration:none;
text-shadow:1px 1px 0px #ffffff;
width: 600px;
height: 56px;
margin-bottom: 10px;
margin-right: 10px;
padding-left: 5px;
}
#title {
text-align: center;
font-size: 48px;
color: #ffffff;
text-shadow: 0px 2px 3px #555;
}
.checkbox {
margin-right: 5px;
}
</style>
<script type="text/javascript" src="config.js"></script>
<script type="text/javascript" src="socket.js"></script>
<script type="text/javascript" src="auth.js"></script>
<script type="text/javascript">
function bodyLoad() {
config.load();
document.getElementById("a2c_config.host").value = config.host;
document.getElementById("a2c_config.key").value = config.key;
document.getElementById("a2c_config.secret").value = config.secret;
document.getElementById("a2c_config.callback").value = config.callback;
document.getElementById("a2c_config.identifier").value = config.identifier;
}
function save() {
var settings = new Object();
var host = document.getElementById("a2c_config.host").value;
if(host.indexOf("://") == -1)
host = "http://" + host;
if(host.charAt(host.length - 1) != "/")
host += "/";
var callback = document.getElementById("a2c_config.callback").value;
if(callback.charAt(0) == "/")
callback = callback.substring(1);
settings.host = host;
settings.secureHost = settings.host.replace("http://", "https://");
settings.key = document.getElementById("a2c_config.key").value;
settings.secret = document.getElementById("a2c_config.secret").value;
settings.callback = callback;
settings.identifier = document.getElementById("a2c_config.identifier").value.replace(/\//g, "").replace(/:/g, "");
var changedIdentifier = (settings.identifier != config.identifier);
var changedHost = (settings.host != config.host);
config.save(settings);
chrome.extension.getBackgroundPage().config.load();
if(changedHost) {
auth.initiate();
}else if(changedIdentifier) {
sockets.getTokenRequest();
}
window.close();
}
</script>
</head>
<body onLoad="window.setTimeout(bodyLoad(), 100);">
<div id="header">
<a href="http://help.2cloudproject.com" id="helpLink" class="continuebutton">Help</a>
</div>
<div id="content">
<div id="title">
2cloud Settings
</div>
<div id="instructions">
<div id="instructionText">
<input type="url" id="a2c_config.host" class="textarea" placeholder="Host"/><label for="a2c_config.host">Host</label><br />
<input type="text" id="a2c_config.key" class="textarea" placeholder="Key"/><label for="a2c_config.key">Key</label><br />
<input type="text" id="a2c_config.secret" class="textarea" placeholder="Secret"/><label for="a2c_config.secret">Secret</label><br />
<input type="text" id="a2c_config.callback" class="textarea" placeholder="Callback"/><label for="a2c_config.callback">Callback</label><br />
<input type="text" id="a2c_config.identifier" class="textarea" placeholder="Device Name"/><label for="a2c_config.identifier">Device</label><br />
<p><button onClick="save();" class="continuebutton">Save</button></p>
</div>
</div>
</div>
<div id="footer">The 2cloud Project is Open Source software sponsored by <a href="http://www.secondbit.org">Second Bit, LLC</a> and released under the MIT license.</div>
</body>
</html>