-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
87 lines (80 loc) · 2.14 KB
/
main.js
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
console.log("wokring")
var class_works = [
{
"name": "Classwork1",
"meta": "Deterministic Finite Automata",
"link": "CW1.html"
},
{
"name": "Classwork2",
"meta": "NFA and RegExp",
"link": "CW2.html"
},
{
"name": "Classwork3",
"meta": "RegExp",
"link": "CW3.html"
},
{
"name": "Classwork4",
"meta": "Context-free grammars",
"link": "CW4.html"
},
{
"name": "Classwork5",
"meta": "Recursive-descent Parser",
"link": "CW5/index.html"
},
{
"name": "Classwork6",
"meta": "Push-down Automaton",
"link": "CW6.html"
},
{
"name": "Classwork7",
"meta": "microJ Level 3",
"link": "CW7/index.html"
}
]
var home_works = [
{
"name": "Homework1",
"meta": "Simple Syntax Highlighter for string and array",
"link": "HW1.html"
},
{
"name": "Homework2",
"meta": "",
"link": "HW2/database.html"
},
{
"name": "Homework3",
"meta": "withValue() added to microJ1",
"link": "HW3/microJ1.html"
}
]
//var cwtext = document.createTextNode= "Classworks: "
//document.getElementById("div_list").append(cwtext);
var cwtext = document.createTextNode= "Classworks: "
document.getElementById("div_list").append(cwtext);
var obj;
var cw = document.createElement("UL");
document.getElementById("div_list").appendChild(cw);
for (var i = 0; i < class_works.length; i++) {
obj = class_works[i];
var node = document.createElement("LI");
node.innerHTML +=
"<a href ='"+obj.link+"'>"+obj.name+"</a>" + ": "+ obj.meta+"<hr>"
cw.appendChild(node);
}
var hwtext = document.createTextNode= "Homeworks: "
document.getElementById("div_list").append(hwtext);
var hw = document.createElement("UL");
document.getElementById("div_list").appendChild(hw);
for (var i = 0; i < home_works.length; i++) {
obj = home_works[i];
var node = document.createElement("LI");
node.innerHTML +=
"<a href ='"+obj.link+"'>"+obj.name+"</a>: " + obj.meta+"<hr>"
hw.appendChild(node);
}