forked from mockko/livereload
-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.html
120 lines (103 loc) · 2.52 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
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
<html>
<head>
<title>LiveReload Options</title>
<style type="text/css">
body {
background-color: #ececec;
color: #565656;
font: 62.5% Helvetica, Arial, sans-serif;
}
.wrapper {
margin: 0 auto;
position: relative;
width: 320px;
}
h2 {
font-size: 2em;
margin: 25px 0 0;
text-align: center;
}
#options {
-webkit-border-radius: 20px;
-webkit-box-shadow: 2px 2px 10px #ccc;
background-color: #fff;
margin: 25px auto 0;
padding: 25px 10px;
text-align: center;
width: 260px;
}
#options label {
display: block;
font-size: 1.65em;
font-weight: bold;
letter-spacing: -0.025em;
margin: 0 0 5px 15px;
text-align: left;
}
#options input {
-webkit-border-radius: 5px;
background-color: #eaeaea;
background: -webkit-gradient(linear, left top, left bottom, color-stop(0.0, #ffffff), color-stop(1.0, #eaeaea));
border: 1px solid #cacaca;
color: #444;
font-size: 1.4em;
margin: 0 0 25px;
padding: 8px 10px;
width: 240px;
}
#options button {
-webkit-border-radius: 5px;
background-color: #dedede;
background: -webkit-gradient(linear, left top, left bottom, color-stop(0.0, #ffffff), color-stop(1.0, #dedede));
border: 1px solid #dedede;
color: #484848;
font-size: 1.65em;
font-weight: bold;
padding: 10px 15px;
}
#status {
text-align: center;
font-size: 120%;
padding: 1em;
}
</style>
</head>
<script type="text/javascript">
// Saves options to localStorage.
function save_options() {
var host = document.getElementById("host").value;
localStorage["host"] = host;
var port = document.getElementById("port").value;
localStorage["port"] = port;
var bkg = chrome.extension.getBackgroundPage();
bkg.livereload.updateSettings();
// Update status to let user know options were saved.
var status = document.getElementById("status");
status.innerHTML = "Options Saved.";
setTimeout(function() {
status.innerHTML = "";
}, 750);
}
// Restores select box state to saved value from localStorage.
function restore_options() {
var hostEl = document.getElementById("host");
hostEl.value = localStorage["host"] ?
localStorage["host"] : '';
var portEl = document.getElementById("port");
portEl.value = localStorage["port"] ?
localStorage["port"] : '';
}
</script>
<body >
<h2>LiveReload Options</h2>
<div id="options">
<label for="host">Host:</label>
<input id="host" type="text" placeholder="localhost">
<label for="port">Port:</label>
<input id="port" type="number" min="0" max="65535" value="35729">
<br>
<button >
</div>
<div id="status"></div>
</body>
</html>
You can’t perform that action at this time.