-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptions.html
150 lines (130 loc) · 3.3 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
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
<html>
<head>
<style>
body {
font-family:helvetica, arial, sans-serif;
font-size:80%;
margin:10px;
}
#header {
padding-bottom:1.5em;
padding-top:1.5em;
}
#header h1 {
font-size: 156%;
display:inline;
padding-bottom:43px;
padding-left:75px;
padding-top:40px;
background:url(voice-128.png) no-repeat;
background-size:67px;
background-position:1px 18px;
}
#footer {
margin-left: 24px;
margin-top: 12px;
}
.gc-settings-content {
margin: 6px 6px 0 6px;
padding: 10px 10px 10px 10px;
color: #333;
border: 1px solid #dedede;
-webkit-border-radius: 5px 5px;
}
.gc-settings-table {
width: 100%;
font-size: 1em;
}
.gc-settings-table .left,
.gc-settings-table .right {
vertical-align: top;
border-bottom: 0 dotted #aaa;
}
.gc-settings-table th {
text-align: right;
width: 1%;
white-space: nowrap;
padding: 12px 24px 12px 12px;
}
.gc-settings-table td {
width: 99%;
white-space: nowrap;
padding: 12px;
}
</style>
<title>Yucata Extension Options</title>
</head>
<script type="text/javascript">
var gameplayRadio;
var languageRadio;
// Saves options to localStorage.
function save_options() {
var gameplayBvr = '1';
for ( var i = 0; i < gameplayRadio.length; i++) {
if (gameplayRadio[i].checked) {
gameplayBvr = gameplayRadio[i].value;
}
}
localStorage["gameplay_type"] = gameplayBvr;
var languageBvr = '1';
for ( var i = 0; i < languageRadio.length; i++) {
if (languageRadio[i].checked) {
languageBvr = languageRadio[i].value;
}
}
localStorage["selected_language"] = languageBvr;
// 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 gameplay = localStorage['gameplay_type'] || '1';
gameplayRadio = document.yucata.gameplay;
for ( var i = 0; i < gameplayRadio.length; i++) {
gameplayRadio[i].checked = false;
if (gameplayRadio[i].value == gameplay) {
gameplayRadio[i].checked = true;
}
}
var gameplay = localStorage['selected_language'] || '1';
languageRadio = document.yucata.language;
for ( var i = 0; i < languageRadio.length; i++) {
languageRadio[i].checked = false;
if (languageRadio[i].value == gameplay) {
languageRadio[i].checked = true;
}
}
}
</script>
<body onload="restore_options()">
<form name="yucata">
<div class="gc-settings-content">
<table class="gc-settings-table" id="gc-settings-voicemail-content">
<tr>
<th class="left">Default Behavior</th>
<td class="right">
<input type="radio" id="gametab" name="gameplay" value="1"/>
<label for="gametab">Launch Game in Tab</label><br/>
<input type="radio" id="overviewtab" name="gameplay" value="2"/>
<label for="overviewtab">Launch Overview in Tab</label><br/>
</td>
</tr>
<tr>
<th class="left">Language</th>
<td class="right">
<input type="radio" id="english" name="language" value="1"/>
<label for="english">English</label><br/>
<input type="radio" id="german" name="language" value="2"/>
<label for="german">German</label><br/>
</td>
</tr>
</table>
</div>
</form>
<button onclick="save_options()">Save</button>
</body>
</html>