/
index.html
139 lines (113 loc) · 3.16 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
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
138
139
<!DOCTYPE html>
<html debug=false>
<head>
<script type='text/javascript' src='../libs/firebug/firebug.js'></script>
<style>
.null {
background: black !important;
color: red
}
.cotainer, .header, .footer {
display: block;
}
</style>
<!--[if lt IE 8]>
<script src="../../__COMPILE/a.ielt8.js"></script>
<![endif]-->
<!--[if IE 8]>
<script src="../../__COMPILE/a.ie8.js"></script>
<![endif]-->
<script src="../../__COMPILE/a.js?2"></script>
<script>
document.createElement("j");
document.createElement("c");
document.createElement("h");
document.createElement("f");
</script>
</head>
<body>
<j id=test1 style="display:block;background:green;height:40px" class=test color1=gray color2=red color3=yellow>
test123
</j>
<div id=test2 class="test2 linked_data" onrowenter1>
test2
</div>
<c class="container" id=testContainer>
<h class="header">
<h4>Container header</h4>
</h>
<data class="data">
<c class="container">
<h class="header">
<h5>List</h5>
</h>
<ul class="data">
<li>asdf</li>
<li>asdf</li>
<li>asdf</li>
<li>asdf</li>
</ul>
<f class="footer">
<p>List up here</p>
</f>
</c>
<c class="container">
<h class="header">
<h5>Img</h5>
</h>
<img id="test3" class="data" src="https://www.google.ru/images/srpr/logo3w.png?1" />
<f class="footer">
<p>Image up here</p>
</f>
</c>
</data>
<f class="footer">
<p>Container footer</p>
</f>
</c>
<OBJECT id="testObject" WIDTH="162" HEIGHT="150" DATA="gerl.jpg" TYPE="image/jpeg"></OBJECT>
<script>
function main() {
window.addEventListener("someEvent", function doSomething(event) {
var i,
j = event.target;
if(event.detail) {
!isNaN(event.detail) &&
(i = "color" + event.detail),
j.attributes[i] &&
(j.style.backgroundColor = j.attributes[i].value);
}
else {
!~(j.classList+"").indexOf("null") ?
j.classList.add(null) :
j.classList.remove(null)
}
}, false)
var dosome1;
document.addEventListener("someEvent", dosome1 = function(event) {
console.log((this === document ? "document" : "window") + " someEvent " + (event.eventPhase === Event.BUBBLING_PHASE ? "bubble" : event.eventPhase === Event.AT_TARGET ? "target" : "capture") + "" + event.timeStamp)
}, false);
document.addEventListener("someEvent", dosome1, true);
window.addEventListener("someEvent", dosome1, false);
document.addEventListener("someEvent", dosome1, false);
var j = document.getElementsByClassName("test")[0];
j.addEventListener("someEvent", function(e) {
console.log("j someEvent bubble");
}
, false);
j = document.querySelector(".test");
j.addEventListener("someEvent", console.log.bind(null, "j someEvent capture"), true);
//$("test2").addEventListener("someEvent", console.log.bind(null, "test2 someEvent capture"), true);
var att = 0;
var testInterval = setInterval(function() {
j.dispatchEvent(new CustomEvent("someEvent", {bubbles : true, detail : ++att > 3 ? att = 0 : att}));
}, 1000)
window.stopIt = function() {
clearInterval(testInterval);
}
//stopIt();
//window.console.open();
}
document.addEventListener('DOMContentLoaded', main, false);
//window.attachEvent("onload", function(){alert("ololo")})
</script>