-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
89 lines (75 loc) · 2.91 KB
/
index.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
<!DOCTYPE html>
<html manifest="manifest.appcache">
<head>
<meta charset="utf-8">
<meta http-equiv="pragma" content="no-cache">
<title>Convertor</title>
<script type="text/javascript" src="js/convertor.js"></script>
<style>
body, html {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<ul id="propsContainer"></ul>
<form name="property_form">
<font face="Arial, Helvetica" size="3"><b>Property:</b></font>
<select name="the_menu" size="1" onchange="UpdateUnitMenu(this, document.form_A.unit_menu); UpdateUnitMenu(this, document.form_B.unit_menu)"></select>
</form>
<script language="JavaScript">
// This fragment initializes the property dropdown menu using the data defined
// above in the 'Data Definitions' section
FillMenuWithArray(document.property_form.the_menu, property);
</script>
<form name="form_A" onsubmit="return false">
<font color="black" face="arial, helvetica" size="5">
<b>From: </b>
</font>
<p>
<select name="unit_menu" onchange="CalculateUnit(this.form, document.form_B)"></select>
</p>
<p>
<input name="unit_input" size="20" maxlength="20" value="" placeholder="Value to convert" type="number" onkeyup="CalculateUnit(this.form, document.form_B)">
</p>
</form>
<form name="form_B" onsubmit="return false">
<font color="black" face="arial, helvetica" size="5">
<b>To: </b>
</font>
<p>
<select name="unit_menu" onchange="CalculateUnit(document.form_A, document.form_B)"></select>
</p>
<p>
<input name="unit_input" disabled="disabled" size="20" maxlength="20" value="" placeholder="Converted value" type="number" onchange="CalculateUnit(this.form, document.form_B)">
</p>
</form>
<form name="util_form">
<input name="clear_form" value=" Clear Form " onclick="ClearForm()" type="button">
<input name="clear_form" value=" Switch unit types" onclick="Switch()" type="button">
</form>
<script language="JavaScript">
// *** Start-up and refresh/reload Commands **********************************
//
// Since the first property is automatically selected, initialize the unit
// menus with its units too...
// .. But, only initialize unit menus when the Property menu hasn't been used
if (document.property_form.the_menu.selectedIndex == 0){
if (document.images){
// Also, define the window name for correct targeting
window.name="JSUC_main";
FillMenuWithArray(document.form_A.unit_menu, unit[0]);
FillMenuWithArray(document.form_B.unit_menu, unit[0]);
} else {
// Check to see if the browser will let you resize the drop-down
// menus. The user will already have seen errors, but at least
// give him/her a clue...
alert("The browser you are using won't let you run JSUC correctly. Maybe you should upgrade... You shpuld try Firefox");
}
}
</script>
</body>
</html>