aboutsummaryrefslogtreecommitdiff
path: root/includes/js/dojox/layout/tests/test_FloatingPane.html
blob: 016f8a6303ad71bf91e8bb8f91d3c5cc3d1c44e2 (plain)
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>dojox.layout.FloatPane - simplest extension on TitlePane ... ever.</title>
		
	<script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug:true, parseOnLoad: true" ></script>
	<script type="text/javascript" src="../../../dijit/tests/_testCommon.js"></script>
	<script type="text/javascript" src="../FloatingPane.js"></script>
	<script type="text/javascript">
		// dojo.require("dojox.layout.FloatingPane"); 
		dojo.require("dijit.layout.TabContainer");
		dojo.require("dijit.form.ComboBox"); 
		dojo.require("dijit.form.Button"); 
		dojo.require("dojo.parser"); // scan page for widgets
	</script>
	<style type="text/css">
		@import "../../../dojo/resources/dojo.css";
		@import "../../../dijit/themes/dijit.css";
		@import "../../../dijit/themes/tundra/tundra.css";
		@import "../../../dijit/tests/css/dijitTests.css";
		@import "../resources/FloatingPane.css"; 
		@import "../resources/ResizeHandle.css"; 

	/* body { background:url('gridUnderlay.png') top left; }  */

		.alternateDock {
			position:absolute; 
			background-color:#ededed; 
			right:0px; top:0px; 
			border-left:1px solid #ccc; 
			height:100%; 
		
		}
		#alternateDock ul.dojoxDockList { display:block; }
		.testFixedSize {
			width:300px;
			height:200px;
			padding:7px;			
		}
	</style>
	<script type="text/javascript">

		function makeFloater() {
			// programatically created FloatingPane with srcNode ref
			var tmp = new dojox.layout.FloatingPane({  
				title: "dynamically created ...",
				id:"floater3",
				closeable:true,
				resizable:true,
				dockable: false
			},"nonFloater");
			tmp.startup(); 
		}

		var mi = 1;
		function brandNewFloater(){
			var node = document.createElement('div');
			node.innerHTML = dojo.byId('contentHolder').innerHTML;
			dojo.body().appendChild(node);
			dojo.addClass(node,"testFixedSize");
			var tmp = new dojox.layout.FloatingPane({
				title:" New Floater #"+(mi++),
				dockable: false,
				maxable: true,
				closable: true,
				resizable: false
			},node);
			tmp.startup();
			tmp.resize({ w:300, h:125 });			
		}

		var vpx, vpy = null;
		dojo.addOnLoad(makeFloater);

	</script>

</head>
<body>


		<a href="javascript:dijit.byId('floater1').hide()">hide first pane</a> |
		<a href="javascript:dijit.byId('floater1').show()">show first pane</a> |
		<a href="javascript:dijit.byId('floater1').minimize()">minimize 'uncloseable, dockable' pane pane</a> |
		<a href="javascript:brandNewFloater()">new floater</a>

		<div dojoType="dojox.layout.FloatingPane" title="Floater test ... " resizable="true" id="floater1" style="position:absolute; width:100px; height:100px; top:100px; left:0px; " duration="300">
		<p style="margin:0; padding:10px;">I am the content to be floated around</p>
		</div>

		<div dojoType="dojox.layout.FloatingPane" title="un-closable, dockable" style="width:200px; position:absolute; top:100px; left:100px;" closable="false" id="floater2">
		<p style="padding:8px; margin:0;">
		I am dockable, though I have no dockTo="" attribute. I will create or use an existing dock 
		on the bottom of the screen.
		<br><br>
		Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In porta. Etiam mattis libero nec ante. Nam 
		porta lacus eu ligula. Cras mauris. Suspendisse vel augue. Vivamus aliquam orci ut eros. Nunc 
		eleifend sagittis turpis. purus purus in nibh. Phasellus in nunc.
		</p>
		</div> 
		
		<div id="nonFloater" style="width:100px; height:100px; top:100px; left:300px;" duration="750" >
		<p style="padding:8x; margin:2px;">
		I am made into a FloatingPane in dojo.addOnLoad();<br><br>
		Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In porta. Etiam mattis libero nec ante. Nam 
		porta lacus eu ligula. Cras mauris. Suspendisse vel augue. Vivamus aliquam orci ut eros. Nunc eleifend 
		sagittis turpis. purus purus in nibh. Phasellus in nunc.
		</p>
		</div>

		<div title="Alt Dock 1" style="width:100px; height:100px; position:absolute; top:200px; left:0; position:absolute; " 
			dojoType="dojox.layout.FloatingPane" duration="350" resizable="true" 
			dockTo="alternateDock" executeScripts="true" href="_script.html">
		</div>
		<div title="Alt Dock 2" dojoType="dojox.layout.FloatingPane" resizable="true" style="width:100px; height:100px; position:absolute; top:200px; left:100px;" duration="350" dockTo="alternateDock">
		<p style="color:#666; padding:8px; margin:0;">
		Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In porta. Etiam mattis libero nec ante. Nam 
		porta lacus eu ligula. Cras mauris. Suspendisse vel augue. Vivamus aliquam orci ut eros. Nunc eleifend 
		sagittis turpis. purus purus in nibh. Phasellus in nunc.
		</p>
		</div>

		
		<div dojoType="dojox.layout.FloatingPane" 
			resizeable="false" style="width:100px; 100px; top:200px; left:200px; position:absolute; " title="foobar" 
			closable="false" dockable="false"><p style="padding:12px;">
		This is just a pane. You cannot close me, you cannot resize me, you cannot minimize me.
		</p>
		</div> 

		<div dojoType="dojox.layout.FloatingPane"  id="remotePane"
			title="Remote Pane" href="doc0.html" resizable="true"
			style="width:250px; height:250px; background:#fff; position:absolute; top:300px; left:0px;"
		></div>    

		<div dojoType="dojox.layout.Dock" id="alternateDock" class="alternateDock"></div>

    <div style="display:none;" id="contentHolder"><p style="padding:13px; margin:0;">
		I am content. I am hidden right now.  This content is used to populate the newly created
		node being attached to the DOM to insert a new FloatingPane without a srcNodeRef. This
		node is not being manipulated, just having it's innerHTML read. For demonstration purposes.
		</p>
		</div>
		
		<div dojotype="dojox.layout.FloatingPane" title="Child layout test" 
			style="width:400px; height:300px;" resizable="true">
			<div dojotype="dijit.layout.TabContainer">
				<div dojotype="dijit.layout.ContentPane" title="Tab 1">
					First Page
				</div>
				<div dojotype="dijit.layout.ContentPane" title="Tab 2">
					<div dojotype="dijit.layout.TabContainer">
						<div dojotype="dijit.layout.ContentPane" title="Sub-tab 1">
							Story of Paul.
						</div>
						<div dojotype="dijit.layout.ContentPane" title="Sub-tab 2">
							Story about Paul.
						</div>
						<div dojotype="dijit.layout.ContentPane" title="Sub-tab 3">
							Story about... guess who.
						</div>
					</div>
				</div>
			</div>
		</div>		
</body>
</html>