base-test.js added
[xynt.git] / test_dd.html
1 <html>
2 <head>
3 <script type="text/javascript" src="commons.js"></script>
4 <script type="text/javascript" src="xynt-base.js"></script>
5 <script type="text/javascript" src="xynt-dd.js"></script>
6 <script type="text/javascript" src="xynt-link.js"></script>
7 <script type="text/javascript">
8   function dropt1()
9   {
10     ; //alert("t1");
11   }
12   window.onload = function() {
13     console.log("HT"+$('t1'));
14     Drag.call($('t1'), dropt1, -1600, 1600, 10,10);
15   }
16 </script>
17 <!--
18 <script type="text/javascript">
19
20 function Adamo() {
21     this.name = "adamo";
22 }
23
24 Adamo.prototype = {
25     alupa: null,
26
27     pname: function()
28     {
29         console.log("NAME: "+this.name);
30     }
31 }
32
33 function Caino() {
34     this.super.constructor.call(this);
35     this.nname = "caino";
36 }
37
38 Caino.prototype = {
39     gojira: null,
40
41     pname2: function()
42     {
43         console.log("NAME:  "+this.name);
44         console.log("NNAME: "+this.nname);
45     }
46 }
47
48 function Extends_simple(sub, super)
49 {
50     var thinF = function(){};
51     thinF.prototype = super.prototype;
52     var tmp = new thinF();
53
54     for( var f in sub.prototype) {
55         tmp[f] = sub.prototype[f];
56         tmp['constructor'] = sub;
57     }
58     if( super.prototype.constructor == Object.prototype.constructor ){
59         super.prototype.constructor = super;
60     }
61     tmp['super'] = super.prototype;
62     sub.prototype = tmp;
63 }
64
65 Extends_simple(Caino, Adamo);
66
67 var c = new Caino();
68
69 console.log("A "+c.alupa);
70 console.log("G "+c.gojira);
71 console.log("U "+c.unko);
72
73 c.pname();
74 c.pname2();
75
76 function PreA() {
77     this.a_din = "adamo";
78 }
79
80 PreA.prototype = {
81     a_attr: "a attr content",
82     name: "PreA",
83
84     a_func: function()
85     {
86         console.log("A_NAME: "+this.a_din);
87         console.log("A_ATTR: "+this.a_attr);
88     }
89 }
90
91 function A() {
92     PreA.call(this);
93 }
94 A.prototype = {
95     name: "A"
96 }
97 Extends(A, PreA);
98
99 function B() {
100     this.b_din = "bonobo";
101 }
102
103 B.prototype = {
104     name: "B",
105     b_attr: "b attr content",
106
107     b_func: function()
108     {
109         console.log("B_NAME: "+this.b_din);
110         console.log("B_ATTR: "+this.b_attr);
111     }
112 }
113
114 function C() {
115     this.c_din = "canuca";
116 }
117
118 C.prototype = {
119     name: "C",
120     c_attr: "c attr content",
121
122     c_func: function()
123     {
124         console.log("C_NAME: "+this.c_din);
125         console.log("C_ATTR: "+this.c_attr);
126     }
127 }
128
129
130 function Summo() {
131     this.s_name = "caino";
132     A.call(this);
133     B.call(this);
134     C.call(this);
135
136 }
137
138 Summo.prototype = {
139     name: "Summo",
140     s_attr: null,
141
142
143     c_func: function()
144     {
145          console.log("c_func overwrited");
146     },
147
148     s_func: function()
149     {
150          this.a_func();
151          this.b_func();
152          this.c_func();
153          console.log("name: "+this.name);
154     }
155 }
156
157 Extends(Summo, A, B, C);
158
159
160 s_ist = new Summo();
161 s_ist.s_func();
162
163 </script>
164 -->
165
166 </head>
167 <body>
168 <!-- task:begin -->
169 <div id="board" style="width: 1600; height: 800px; background-color: #f0f0f0; border: 1px solid black; position: relative;">
170
171   <div id="t1" style="z-index: 1; left: 10px; top: 10px; width: 100px; height: 21px; border: 1px solid gray; background-color: #c0c0ff; position: absolute;"></div>
172   
173 </div>
174 </body>
175 </html>