-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.html
137 lines (128 loc) · 5.13 KB
/
test.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!--suppress XmlHighlighting -->
<html>
<head>
<title>EssenceJS test</title>
<meta charset="UTF-8" />
<meta name="author" content="Maximilian Berkmann" />
<meta http-equiv="pragma" content="no-cache" />
<script type="text/javascript" src="1.1/essence.js" async defer></script>
<script type="text/javascript" async defer>
var bodyBg, ba, r, g, b, csl, lr;
function start () {
if (typeof(conv) != "function" || !isType(Colour, "Object") || !isType(Console, "Object") || !isType(virtualHistory, "Object")) setTimeout("start()", 100);
bodyBg = new Colour(255); ba = new Colour(0); r = new Colour(255, 0, 0); g = new Colour(0, 255, 0); b = new Colour(0, 0, 255);
csl = new Console();
csl.place("csl");
lr = $G["lorem"].replace(/(\.|!|\?|;|:|"|,|\t|\n|\f|\r|\v|\{|})+/gm, " ").split(" ").remove("");
}
setTimeout("start()", 150);
function effect () {
$e("body").setCSS("background", bodyBg.hex);
$e("#ba").setCSS("color", ba.hex);
$e("#r").setCSS("color", r.hex);
$e("#g").setCSS("color", g.hex);
$e("#b").setCSS("color", b.hex);
}
function effect3 () {
$e("body").setCSS("background", "#fff");
$e("#ba").setCSS("color", "#000");
$e("#r").setCSS("color", "#000");
$e("#g").setCSS("color", "#000");
$e("#b").setCSS("color", "#000");
}
function effect2 () {
bodyBg.negative();
ba.negative();
r.negative();
g.negative();
b.negative();
$e("body").setCSS("background", "#000");
$e("#ba").setCSS("color", "#fff"||ba.hex);
$e("#r").setCSS("color", r.hex);
$e("#g").setCSS("color", g.hex);
$e("#b").setCSS("color", b.hex);
}
var root, root0, root1, root2;
function simpleNodes () {
/*var base = null, tmp = new intNode(5, base);
base = tmp;
//head insert a new node
tmp = new intNode(7, base);
base = tmp;
Essence.say(base.show());
tmp = new intNode(5, base);
base = tmp;
Essence.say(base.show());
var aList = null;
tmp = new intLinkedList(10, aList, "aList");
aList = tmp;
Essence.say(aList.show());
tmp = new intLinkedList(6, aList, "aList");
aList = tmp;
Essence.say(aList.show());
root = new TreeNode(0, new TreeNode(1, new TreeNode(3, new TreeNode(7), new TreeNode(8)), new TreeNode(4, new TreeNode(9), new TreeNode(10))),
new TreeNode(2, new TreeNode(5, new TreeNode(11), new TreeNode(12)), new TreeNode(6, new TreeNode(13), new TreeNode(14))));
root0 = new TreeNode(0, new TreeNode(1, new TreeNode(2, new TreeNode(3), new TreeNode(4)), new TreeNode(5, new TreeNode(6), new TreeNode(7))),
new TreeNode(8, new TreeNode(9, new TreeNode(10), new TreeNode(11)), new TreeNode(12, new TreeNode(13), new TreeNode(14))));
root1 = new TreeNode(0, new TreeNode(2, new TreeNode(1, new TreeNode(3), new TreeNode(4)), new TreeNode(6, new TreeNode(5), new TreeNode(7))),
new TreeNode(8, new TreeNode(10, new TreeNode(9), new TreeNode(11)), new TreeNode(12, new TreeNode(14), new TreeNode(13))));
root2 = new TreeNode(0, new TreeNode(2, new TreeNode(4, new TreeNode(6), new TreeNode(8)), new TreeNode(10, new TreeNode(12), new TreeNode(14))),
new TreeNode(1, new TreeNode(3, new TreeNode(5), new TreeNode(7)), new TreeNode(9, new TreeNode(11), new TreeNode(13))));
println("<fieldset><b>Root</b><br />Pre order: ("+root.getPreOrder()+")");
root.preOrder();
println("In order: ("+root.getInOrder()+")");
root.inOrder();
println("Post order: ("+root.getPostOrder()+")");
root.postOrder();
println("<b>Root 0</b><br />Pre order: ("+root0.getPreOrder()+")");
root0.preOrder();
println("In order: ("+root0.getInOrder()+")");
root0.inOrder();
println("Post order: ("+root0.getPostOrder()+")");
root0.postOrder();
println("<b>Root 1</b><br />Pre order: ("+root1.getPreOrder()+")");
root1.preOrder();
println("In order: ("+root1.getInOrder()+")");
root1.inOrder();
println("Post order: ("+root1.getPostOrder()+")");
root1.postOrder();
println("<b>Root 2</b><br />Pre order: ("+root2.getPreOrder()+")");
root2.preOrder();
println("In order: ("+root2.getInOrder()+")");
root2.inOrder();
println("Post order: ("+root2.getPostOrder()+")");
root2.postOrder();
print("</fieldset>", true);*/
}
function postHTMLinit () {
Essence.init();
UI.run();
if (isNon($n("#btn"))) {
Essence.say("I couldn't find the node #btn !\The element is the following:\n"+$e("#btn"));
Essence.say("$e('#btn').node= "+$e("#btn").node, "info");
} else $e("#btn").on('click', function(event){evtLog(event);EvtShow(event);});
simpleNodes();
Calendar.set();
}
function testDL () {
Essence.say($n("span#ceval"));
CECheck("span#ceval");
}
/*function lineTest (b, c) {
b();
Essence.say("line: " + getLineNum());
c();
}*/
</script>
</head>
<body onpageshow='postHTMLinit();' onload='Essence.preInit();'>
<span id="test" onmouseover="Essence.applyCSS(true)">lorent</span>
<div id="ColourTest" onMouseover='effect()' onClick="effect2()" onMouseout="effect3()">
<span id='ba'>Black</span> <span id='r'>Red</span> <span id='g'>Green</span> <span id='b'>Blue</span>
</div><br />
<input type="button" value="event" id="btn" />
<br /><span id="ceval" onclick="testDL()">Click on me to test your download speed.</span>
<br /><div id="csl">Console !</div>
<div id="calendar"></div>
</body>
</html>