Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
96 lines (79 sloc) 2.45 KB
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Development</title>
<script src="Entity.js" type="text/javascript"></script>
<script type="text/javascript">
function test1(){
LivingThing = $e({
cname: 'LivingThing',
isAlive: true,
init : function (first_name, last_name) {
this.first_name = first_name;
this.last_name = last_name;
this.isAlive = true;
},
play : function () {
console.log(this.first_name + ' played from Class LivingThing');
},
doSomething: function() {
console.log(this.first_name + ' did something in Class LivingThing');
}
});
Person = $e({
cname: 'Person',
extend: LivingThing,
init : function (first_name, last_name) {
this.first_name = first_name;
this.last_name = last_name;
},
play : function () {
console.log(this.first_name + ' played from Class Person');
}
});
person = new Person('Bob', 'Clay');
console.log('value of first name is ' + person.first_name);
console.log('value of last name is -' + person.last_name);
person.play();
person.doSomething();
Programmer = $e({
cname: 'Programmer',
extend: Person,
init : function (first_name, last_name) {
this.$super.init.apply(this, arguments);
},
play : function () {
console.log(this.first_name + ' played from Class Programmer');
}
});
programmer = new Programmer('Mary', 'Black');
console.log('value of first name is ' + programmer.first_name);
console.log('value of last name is ' + programmer.last_name);
console.log('value of isAlive is ' + programmer.isAlive);
programmer.play();
programmer.doSomething();
}
</script>
<script>
//$e.Event.ready(function(){console.log('Ready >>> 1');});
function test2(){
var ace = document.getElementById("fire");
funcX = function() {alert('XXX');};
ace.oberve('mouseover', funcX, true);
ace.oberve('mouseover', function() {alert('YYY');}, true);
//Entity.Event.remove(ace, 'click', funcX);
}
</script>
<style>
#box {
width: 100px;
background-color: red;
}
</style>
</head>
<body onload = "test2()">
<button id="fire">Fire!</button>
</body>
</html>