forked from LC100E/lc100e.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenu_select.html
executable file
·105 lines (95 loc) · 2.94 KB
/
menu_select.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
<!DOCTYPE html>
<html>
<head>
<META http-equiv="Content-Type" content="text/html" charset="iso-8859-1">
<link rel="stylesheet" href="./tree.css" type="text/css">
<SCRIPT language="JavaScript" src="sub.js"></SCRIPT>
<script type="text/javascript">
// <!--
async function loadXML(xmlFile) {
var xhttp = new XMLHttpRequest();
return new Promise(function(resolve, reject) {
xhttp.onreadystatechange = function() {
if (this.readyState == 4) {
if (xhttp.status >= 300) {
reject("Error, status code = " + xhttp.status)
} else {
resolve(xhttp.responseXML);
}
}
};
xhttp.open("GET", xmlFile, true);
xhttp.send();
});
}
async function init(){
var XmlFile="list.xml"; // �z�[���f�B���N�g���ւ̑��p�X
var HomePath="./"
var xmldoc = await loadXML(Homepath + XmlFile);
var Root=xmldoc.documentElement; // ���[�g�m�[�h�̎擾
var Len=Root.childNodes.length; // �q�m�[�h���̎擾
for(var i=0;i<Len;i++) {
if (Root.childNodes(i).nodeName == "title") {
document.write("<B>" + Root.childNodes(i).text + "</B><BR>");
} else if (Root.childNodes(i).nodeName == "dates") {
document.write("<select name='dataselect' size='1' tabindex='0' onchange='ChangeTree()'>")
document.write("<option value='' selected='selected'>Select the Production Date:</option>")
var childNode = Root.childNodes.item(i); //�q�m�[�h�ɃJ�����g���ړ�
var childLen = childNode.childNodes.length;
for(var j=0;j<childLen;j++) {
var sValue = childNode.childNodes.item(j).getAttribute('value');
var sDispText = childNode.childNodes.item(j).text;
document.write("<option value='" + sValue + "'>" + sDispText + "</option>")
}
document.write("</select>")
}
}
}
function ChangeTree() {
var sChkDate =dataselect.value;
var sStDate="";
var sEdDate="";
if(sChkDate=="ALL"){
sStDate=sChkDate;
sEdDate="";
}else{
var iSepaPos= sChkDate.indexOf("-");// �J�n�I���̋��ʒu�擾
if (iSepaPos == 0) {
// �I�����t�̂�
sStDate = "";
sEdDate = sChkDate.substring(1);
}else if (iSepaPos > 0){
sStDate = sChkDate.substring(0,iSepaPos);
sEdDate = sChkDate.substring(iSepaPos + 1);
}
}
if (sChkDate!=""){
parent.parent.pdf.location.href = "./pdf.html";
parent.menu_tree.location.href = "./menu_tree.html?stdate=" + sStDate + "&eddate=" + sEdDate;
}
}
//-->
</script>
<TITLE id="menuSelect"></TITLE>
<script type="text/javascript">
// <!--
GetTitleName("menuSelect");
//-->
</script>
</head>
<body class="tree">
<div class="MenuArea">
<FONT face="Arial">
<TABLE>
<TR><TD nowrap>
<script type="text/javascript">
// <!--
init();
//-->
</script>
</TD></TR>
</TABLE>
</FONT>
</div>
</body>
</html>