-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathoptions.html
106 lines (95 loc) · 3.6 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
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/options.css" />
<script>
function loadVals() {
var storedValue = localStorage['popupcolor'];
for(var i=0; i < document.optform.popupcolor.length; ++i) {
if(document.optform.popupcolor[i].value == storedValue) {
document.optform.popupcolor[i].selected = true;
break;
}
}
storedValue = localStorage['tonecolors'];
if(storedValue == 'no') {
document.optform.tonecolors[1].selected = true;
}
else {
document.optform.tonecolors[0].selected = true;
}
storedValue = localStorage['fontSize'];
if(storedValue == 'small') {
document.optform.fontSize[1].selected = true;
}
else {
document.optform.fontSize[0].selected = true;
}
}
function storeVals() {
localStorage['popupcolor'] = document.optform.popupcolor.value;
chrome.extension.getBackgroundPage().zhongwenMain.config.css = localStorage['popupcolor'];
localStorage['tonecolors'] = document.optform.tonecolors.value;
chrome.extension.getBackgroundPage().zhongwenMain.config.tonecolors = localStorage['tonecolors'];
localStorage['fontSize'] = document.optform.fontSize.value;
chrome.extension.getBackgroundPage().zhongwenMain.config.fontSize = localStorage['fontSize'];
}
window.onload = loadVals;
</script>
</head>
<body>
<h2>Options for the Zhongwen Chrome Extension</h2>
On this page you can set your personal preferences for the Zhongwen
Chinese Popup Dictionary Chrome extension.
<p>
<div class="important">Important:
<ol>
<li>
Don't forget to save your changes by clicking on the "Save these settings" button.
<li>
If you change the color of the popup window and you still see the
old popup window color, then simply reload the Chinese page for the
change to become visible.
</ol>
</div>
<hr>
<form id="optform" name="optform">
The <b>Popup color</b> setting allows you to change the background
color of the window showing the dictionary entries.
<p>
Popup color:
<select id="popupcolor" name="popupcolor">
<option value="blue">Blue</option>
<option value="lightblue">Light Blue</option>
<option value="black">Black</option>
<option value="yellow">Yellow</option>
</select>
<p>
<hr>
The <b>Tone colors</b> setting allows you to turn colors for the
pinyin syllables on and off. If tone colors are turned on, you will
see colors corresponding to the tones of the characters:
red = first tone, orange = second tone, green = third tone,
blue = fourth tone.
<p>
Tone colors:
<select id="tonecolors" name="tonecolors">
<option value="yes">Show tone colors</option>
<option value="no">Don't show tone colors</option>
</select>
<p>
<hr>
The <b>Font size</b> setting allows you to change the size of the
characters in the popup window.
<p>
Font size:
<select id="fontSize" name="fontSize">
<option value="large">Use a large font size</option>
<option value="small">Use a smaller font size</option>
</select>
<p>
<hr>
<input style="margin-top: 1em;" type="submit" onClick="storeVals()" value="Save these settings" />
<span class="important">Save your changes here</span>
</form>
</body>
</html>