-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
73 lines (55 loc) · 1.88 KB
/
index.html
File metadata and controls
73 lines (55 loc) · 1.88 KB
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
<html>
<head>
<title>ComScan</title>
<script language="javascript" src="javascript/comscan.js"></script>
<script language="javascript" src="tests/CK12.js"></script>
<body>
<table id="listtable">
<script>
function getCK12iterator(){
//console.log("Enter CK12 parse function")
//starting with CK12Raw, we're going to build outselves a iterator.
pagesGraph={}
console.log(Object.keys(CK12Raw['Grid']).length)
singlepage=CK12Raw['Grid']["0"]
pagename=singlepage[0]
pagesGraph[pagename]=parseOVFPage(singlepage)
for (i =1;i<Object.keys(CK12Raw['Grid']).length;i++){
singlepage=CK12Raw['Grid'][""+i]
pagename=singlepage[0]
thing=parseOVFPage(singlepage)
thing.push(new MenuItem(21,"back","ovf(back())",""))
pagesGraph[pagename]=thing
}
iterator=new PagesIterator(pagesGraph)
iterator.rootNodeID="toppage"
iterator.currentNode = iterator.graph["toppage"]
return iterator
}
function parseOVFPage(singlePage){
//console.log("in single page parse")
itemList=[];
var i=0
var j=0
for(i=0;i<4;i++){
for(j=0;j<4;j++){
if(singlePage[1][i][j]=="")
continue
itemList.push(new MenuItem(i+j,singlePage[1][i][j],singlePage[3][i][j],singlePage[1][i][j]))
}
}
return itemList
}
pagesGraph = {
0: [new MenuItem(4, "Bashful", "", "Bashful"), new MenuItem(5, "Happy", "", "Happy"), new MenuItem(43,"Animals", "A" , "Animals"), new MenuItem(8, "Frederick", "", "Frederick")],
"A": [new MenuItem(99, "Apple", "", "Apple"), new MenuItem(2, "Ant", "", "Ant"), new MenuItem(6, "B page","B" , "B page"), new MenuItem(22, "Back","ovf(back())", "")],
"B": [new MenuItem(29, "Baby", "", "Baby"), new MenuItem(22, "Bot", "", "Bot"), new MenuItem(26, "Boat", "", "Boat"), new MenuItem(21,"Back","ovf(back())", "")]
}
board= getCK12iterator()
board.refreshHTML();
setInterval(function(){board.next()},1700);
</script>
</table>
<button onclick="board.activate()">Activate!</button>
</body>
</html>