-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathoptions.html
More file actions
97 lines (95 loc) · 2.63 KB
/
options.html
File metadata and controls
97 lines (95 loc) · 2.63 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
86
87
88
89
90
91
92
93
94
95
96
97
<html>
<head>
<title>Basecamp URL</title>
<style>
html {
background: #eee;
}
body {
width: 920px;
height: 300px;
background: white;
border-radius: 10px;
-webkit-box-shadow: 0 3px 10px gray;
font: 20px / 36px Helvetica, Arial, sans-serif;
margin: 20px auto;
padding: 20px;
}
#help {
text-align: center;
}
#status {
text-align: center;
color: green;
}
label {
display: block;
text-align: center;
font-size: 28px;
color: gray;
width: 840px;
margin: 40px auto;
}
input {
width: auto;
color: black;
border: 0;
border-bottom: 1px dotted gray;
font-size: 28px;
}
input:focus {
outline: none;
border-bottom-color: black;
}
button {
font-size: 28px;
display: block;
width: 770px;
cursor: pointer;
margin: 20px auto;
padding: 10px 0;
}
</style>
</head>
<script type="text/javascript">
// Saves options to localStorage.
function save_options() {
var text = document.getElementById("url");
var url = text.value;
localStorage["saved_url"] = url;
// Update status to let user know options were saved.
var status = document.getElementById("status");
status.innerHTML = "URL Saved. Redirecting...";
setTimeout(function() {
status.innerHTML = "";
window.location = "main.html";
}, 1000);
//restore_options();
}
// Restores text box state to saved value from localStorage.
function restore_options() {
var saved = localStorage["saved_url"];
if(saved == undefined || saved == null || saved == '') {
var help = document.getElementById("help");
help.innerHTML = "<p>It appears you have not set up your Basecamp URL yet. Please do so by typing it below.</p><p>You can always get back to this page by right clicking the app icon and choosing <strong>Options</strong></p>";
return;
}
var text = document.getElementById("url");
text.value = saved;
}
</script>
<body onload="restore_options()">
<div id="help">
<p>
You can always get back to this page by right clicking the app icon and choosing <strong>Options</strong>
</p>
</div>
<label for="url">https://basecamp.com/
<input type="text" id="url" name="url" />
</label>
<button onclick="save_options()">
Save and go to your Basecamp
</button>
<div id="status"></div>
</body>
</html>