forked from joaool/MotherGithub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_container.html
186 lines (169 loc) · 8 KB
/
test_container.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<!--
* http://download.dojotoolkit.org/release-1.2.3/dojo-release-1.2.3/dojox/form/tests/test_BusyButton.html
* http://www.sitepen.com/blog/2008/10/17/dojo-building-blocks-of-the-web/
*
* <!DOCTYPE html>
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<script type="text/javascript" src="Dojo Toolkit/dojo-release-1.7.1/dojo/dojo.js" djconfig="parseOnLoad: true, isDebug: true" >
</script>
<link href="Dojo Toolkit/dojo-release-1.7.1/dijit/themes/claro/claro.css" rel="stylesheet">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
-->
<!-- -->
<!-- -->
<title>Test container v1.0</title>
<style type="text/css" media="all">
.claro.Mother .thumbNail .hoverThumbNail{/*not showing coz of DomStyle.set(this.thumbNail, "border", "red"); inside thumbNail.js*/
border:3px solid #87AF06;
}
.claro.Mother .thumbNail .placeHolder{
border:1px solid red;
}
</style>
<style type="text/css">
#wrapper {
height:200px;
width:200px;
background:#ededed;
color:#000;
}
#wrapper p {
padding:20px;
}
</style>
<!--
<link href="../dojo1.9.2/dijit/themes/claro/claro.css" rel="stylesheet"> -->
<!--<link type="text/css" rel="stylesheet" href="Mother/bootstrap.css" />--> <!-- efeito de halo -->
<!--<link rel="stylesheet" href="Mother/font-awesome.css"> -->
<!--<script type="text/javascript" src="../dojo1.9.2/dojo/dojo.js" djconfig="parseOnLoad: true, isDebug: true" ></script> -->
<script>
dojoConfig= {
has: {
"dojo-firebug": true
},
parseOnLoad: false,
debugAtAllCosts: true,
foo: "bar",
async: true
};
</script>
<script type="text/javascript" src="../dojo1.9.2/dojo/dojo.js"></script>
<!--<script src="Mother/jquery-1.8.1.min.js"></script> -->
<!--<script src="Mother/bootstrap.js"></script>-->
<link href="../dojo1.9.2/dijit/themes/claro/claro.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="Mother/Mother.css"/>
<style type="text/css" media="all">
.claro.Mother {/*prevents text selection highlighting outside current div */
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
</style>
<!--<link href="Dojo Toolkit/dojo-release-1.7.1/dojox/layout/resources/ResizeHandle.css " rel="stylesheet">-->
<!--<link rel="stylesheet" href="../dgrid/css/dgrid.css"> -->
<!------ Mother CSS ----------------------------------------------------------------- -->
<!--- For Mother Builder --->
<link rel="stylesheet" type="text/css" href="Mother/MotherBuilder.css" />
<!--- For Mother Forms A -BlueHills, B-Simple Green C- Tree D-Chess E-light blue F(A+C)=>(fz,f0)-->
<!--<link rel="stylesheet" type="text/css" href="Mother/MotherF.css"/> -->
<!--
<link rel="stylesheet" type="text/css" href="Mother/Mother.css"/>
-->
<!-- ----------------------------------------------------------------------------------- -->
<!-- <link href="Dojo Toolkit/dojo-release-1.7.1/dijit/themes/claro/claro.css" rel="stylesheet"> -->
<!--<script type="text/javascript" src="//api.filepicker.io/v1/filepicker.js"></script>-->
<script>
oDbg=null;//so that we can use "this" inside this html with embedded script
require([
"dojo/query",
"dojo/dom",
"dojo/dom-construct",
"dijit/registry",
"Mother/areasFactory.js",
"Mother/textbox.js",
"Mother/numberbox.js",
"Mother/container.js",
],
function(query,dom,domConstruct,registry,canvas,textbox,numberbox,container){
console.log("Inicio");
var canvas = new canvas();//by default a base container (the full screen) is defined
var num1 = canvas.createNumberbox({left:320, top:50, width:200, height:50, value:129.2, borderColor:"purple"});
console.log("num1-> id="+num1.id+" left="+num1.left+" top="+num1.top+" width="+num1.width+" height="+num1.height+" zIndex="+num1.zIndex+" value="+num1.value+" domId="+num1.domId);
var num2 = canvas.createNumberbox({left:1000, top:50, width:340, height:50, value: 123,borderThickness: 2,borderColor: "blue"});
var num3 = new numberbox({left:1200, top:250, width:100, height:30, value:23});
num3.setBorder({borderThickness:5, borderColor:"red"});
num1.toggleItalic(true);
num2.toggleItalic(false);
var txt1 = canvas.createTextbox({name: "Junkas",left: 130, top: 50, width: 200,height: 100,value: "junkas"});
var txtc2 = canvas.createTextbox({left:700, top:150, width:100, height:50, value:"abc", borderColor: "yellow"});
var numc2 = canvas.createNumberbox({left:710, top:210, width:80, height:30, value:23.4});
num1.setFontSize(20);
num1.setBorder({borderThickness:4});
txt1.setBorder({borderThickness:5, borderColor:"blue"});
txt1.toggleBold(true);
num1.toggleItalic(true);
canvas.containerSummaryDump();
cFree = new container({left:600, top:80, width:200, height:40, borderThickness:10, borderColor:"red"});//a free container
//--------------------------------- to show current dijita on screen -------------------------
k=1;
query('.dijit').forEach(function(node){//captures all dijits in DOM
widget = dijit.byNode(node);
console.log("*************->"+k+" id="+widget.get("id")+" value="+widget.get("value"));
k++;
});
k=1;
query('div').forEach(function(node){//captures all divs in DOM
console.log("=============================->"+k+" id="+node.id);
k++;
});
var canvasContainer = registry.byId("_1");
//canvasContainer.destroyRecursive(); //to destroy a dijit widget by id (in this case the canvas)
k=1
query('.dijitContentPane').forEach(function(node){//captures all containers in DOM
widget = dijit.byNode(node);
console.log("+++++++++++++++++++++++++++++++++++++++++++->"+k+" id="+widget.get("id"));
k++;
});
console.log("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$");
console.log("------------------------------------------- now the container.... -----------------------------------------------");
console.log("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$");
var c1 = canvas.createContainer({name: "YellowSubmarine", left: 80, top: 40, width: 500, height: 260, borderThickness: 7, borderColor: "yellow"});
canvas.baseContainer.childDump();
c1.addExistingChild([num1,txt1]);
// c1 = new container({left:500, top:100, width:500, height:40, borderThickness:10, borderColor:"red"});
var c2 = canvas.createContainer({left: 640, top: 140, width: 220, height: 100,borderColor: "blue"});
c2.setBorder({borderThickness: 7, borderColor: "green"});
c2.addExistingChild([txtc2,numc2]);
console.log("---------------------------------------<< after c2 creation with txtc2 and numc2 >>-----------------------------");
// canvas.baseContainer.childDump();
c2.moveTo({left: 130});
console.log("-------------------------------------------------------<< after move (only) of c2 >>-----------------------------");
c1.addExistingChild([c2]);
c1.moveTo({left: 600, top: 150}); //move everything togheter
c1.childDump();
c2.childDump();
canvas.baseContainer.childDump();
console.log("------------------------------------------------- summary.... -----------------------------------------------");
console.log("totalAreas = "+canvas.lastAreaOrder+" TotalTextboxes = "+canvas.lastTextboxOrder+" TotalNumberboxes = "+canvas.lastNumberboxOrder+" TotalContainers = "+canvas.lastContainerOrder);
console.log("--------------------------------------- container done.... -----------------------------------------------");
console.log(document.title+"...... END..");
}//closing of main function
);//closing of require function
</script>
</head>
<body class="claro Mother">
<!--
<div id="wrapper" style="position:absolute;left:50;top:100;">
<p>Name:
<input type="text" id="user" name="user"></p>
</div>
-->
</body>
</html>