-
Notifications
You must be signed in to change notification settings - Fork 4
/
options.html
executable file
·55 lines (50 loc) · 1.1 KB
/
options.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
<html>
<head>
<title>
Custom URL Shortener Options
</title>
<style>
body {
color: #999;
}
#content {
width: 300px;
margin: 0 auto;
padding: 30px;
}
</style>
<script>
function saveOptions(){
var service = document.getElementById('service').value;
var status = document.getElementById('status');
if (service != ""){
localStorage['url_service'] = service;
// let them know it's ok
status.innerHTML = "Options Saved";
showService();
}
else {
status.innerHTML = "Error - Incorrect Service";
}
// make the ok go away
setTimeout(function() {
status.innerHTML = "";
}, 2000);
}
function showService(){
document.getElementById("old-service").innerHTML = localStorage['url_service'];
}
</script>
</head>
<body onload="showService()">
<div id='content'>
Service: http://<span id='old-service'></span>
<br><br>
New Service: <br>http://<input type='text' size=30 id='service'/>
<br><br>
<button value='Save Options' onclick='saveOptions()'>Save Options</button>
<br><br>
<div id='status'>
</div>
</div>
</body>