-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptions.html
45 lines (40 loc) · 1.16 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
<html>
<head>
<script type="text/javascript" src="lib/jquery-1.5.2.min.js"></script>
<script type="text/javascript" src="lib/urlParam.js"></script>
<link rel="stylesheet" href="reset.css" />
<link rel="stylesheet" href="options.css" />
</head>
<body>
<div id="header">
<h1 class="logo">Pivotal TRACr</h1>
</div>
<div id="options">
<h2>OPTIONS</h2>
<div class="option">
Trac Url: <input type="text" name="tracUrl" id="option_tracUrl" class="option_edit" />
</div>
<a id="options_save" href="#">Save</a>
</div>
<script type="text/javascript">
var tab = $.urlParam("tab");
$(".option_edit").each(function() {
var optionName = $(this).attr("name");
var optionValue = localStorage.getItem(optionName);
$(this).val(optionValue)
});
$("#options_save").click(function() {
$(".option_edit").each(function() {
var optionName = $(this).attr("name");
var optionValue = $(this).val();
localStorage.setItem(optionName, optionValue);
});
if (tab) {
chrome.tabs.sendRequest(Number(tab), {action: "optionsSet"});
}
window.close();
return false;
});
</script>
</body>
</html>