aboutsummaryrefslogtreecommitdiff
path: root/includes/js/dijit/tests/test_TitlePane.html
blob: d0096c010663771d86cd99bc617c1527f34db4f8 (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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
	"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>TitlePane Test</title>

	<style type="text/css">
		@import "../../dojo/resources/dojo.css";
		@import "css/dijitTests.css";
	</style>
	
	<script type="text/javascript" src="../../dojo/dojo.js"
		djConfig="parseOnLoad: true, isDebug: true"></script>
	<script type="text/javascript" src="_testCommon.js"></script>

	<script language="JavaScript" type="text/javascript">
		dojo.require("dijit.TitlePane");
		dojo.require("dojo.parser");	// scan page for widgets and instantiate them

		// widgets used inside subpage loaded via href=
		dojo.require("dijit.form.Button");
		dojo.require("dijit.form.ComboBox");

		function randomMessageId(){
			return Math.floor(Math.random() * 3) + 3;
		}

		dojo.declare("dijit.TestTitlePane", dijit.TitlePane, {
			templateString: '<div class="dijitTitlePane">' +
							'    <div class="dijitTitlePaneTitle" dojoAttachPoint="titleBarNode" style="cursor: default;">' +
							'        <div dojoAttachEvent="onclick:toggle,onkeypress: _onTitleKey,onfocus:_handleFocus,onblur:_handleFocus" tabindex="0"' +
							'                waiRole="button" dojoAttachPoint="focusNode,arrowNode" class="dijitInline dijitArrowNode" style="cursor: pointer;"><span dojoAttachPoint="arrowNodeInner" class="dijitArrowNodeInner"></span></div>' +
							'        <div dojoAttachPoint="titleNode" class="dijitTitlePaneTextNode"></div>' +
							'    </div>' +
							'    <div class="dijitTitlePaneContentOuter" dojoAttachPoint="hideNode">' +
							'        <div class="dijitReset" dojoAttachPoint="wipeNode">' +
							'            <div class="dijitTitlePaneContentInner" dojoAttachPoint="containerNode" waiRole="region" tabindex="-1">' +
							'            </div>' +
							'        </div>' +
							'    </div>' +
							'</div>'
		});
	</script>
</head>
<body>
	<h1 class="testTitle">Dijit TitlePane Test</h1>

	<h1>Test #1: plain title pane, width=300px</h1>
	<div dojoType="dijit.TitlePane" title="Title Pane #1" style="width: 300px;">
		Lorem Ipsum Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque
		iaculis, nulla id semper faucibus, pede tellus nonummy magna, vitae adipiscing
		orci arcu ut augue. Nunc condimentum, magna a vestibulum convallis, libero purus
		pulvinar orci, sed vestibulum urna sem ut pede. More Ipsum...
		Sed sollicitudin suscipit risus. Nam ullamcorper. Sed nisl lectus, pellentesque
		nec, malesuada eget, ornare a, libero. Lorem ipsum dolor sit amet,
		consectetuer adipiscing elit.
	</div>

	<h1>Test #2: title pane with form, width=300px</h1>

	<div dojoType="dijit.TitlePane" title="Title Pane #2" id="pane_2" style="width: 300px;">
		<form>
			Age: <input><br>
			Discount card <input type=checkbox><br>
			<button>Submit</button><br>
		</form>
	</div>
	<br>

	<h1>Test #3: initially closed pane</h1>
	<div id="closed" dojoType="dijit.TitlePane" title="Initially closed pane" open="false" width="200">
		<form>
			<title for="age">Age: </title><input id="age"><br>
			<title for="discount">Discount card </title><input type=checkbox id="discount"><br>
			<button>Submit</button><br>
		</form>
	</div>
	<button onclick="dijit.byId('closed').setContent('hello world! (' + new Date() + ')');">reset content</button>

	<h1>Test #4: title pane with href (initially closed)</h1>
	<p>The pane should open to "Loading..." message and then 2 seconds later it should slide open more to show loaded data.</p>
	<div dojoType="dijit.TitlePane" duration=1000 title="Pane from href" href="layout/getResponse.php?delay=3000&messId=3" open="false">
		Loading...
	</div>

	<h1>Test #5: title pane with href (initially closed)</h1>
	<p>The pane should start to open to "Loading..." but halfway through href data will be loaded, and it should expand correctly.</p>
	<div dojoType="dijit.TitlePane" duration=1000 title="Pane from href" href="layout/getResponse.php?delay=500&messId=3" open="false">
		Loading...
	</div>

	<h1>Test #6: nested title pane</h1>
	<div dojoType="dijit.TitlePane" title="Outer pane" width="300">
		<p>This is a title pane, containing another title pane ...
		<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque iaculis, nulla id semper faucibus, pede tellus nonummy magna, vitae adipiscing orci arcu ut augue. Nunc condimentum, magna a vestibulum convallis, libero purus pulvinar orci, sed vestibulum urna sem ut pede.
More Ipsum...

		<div dojoType="dijit.TitlePane" title="Inner pane" width="250">
			<p>And this is the inner title pane...
			<p>Sed sollicitudin suscipit risus. Nam ullamcorper. Sed nisl lectus, pellentesque nec, malesuada eget, ornare a, libero. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
		</div>

		<p>And this is the closing line for the outer title pane.
	</div>

	<h1>Test #7: subclassed title pane (only arrow is selectable and focusable)</h1>
	<div dojoType="dijit.TestTitlePane" title="Title Pane #7" style="width: 300px;">
		Lorem Ipsum Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque
		iaculis, nulla id semper faucibus, pede tellus nonummy magna, vitae adipiscing
		orci arcu ut augue. Nunc condimentum, magna a vestibulum convallis, libero purus
		pulvinar orci, sed vestibulum urna sem ut pede. More Ipsum...
		Sed sollicitudin suscipit risus. Nam ullamcorper. Sed nisl lectus, pellentesque
		nec, malesuada eget, ornare a, libero. Lorem ipsum dolor sit amet,
		consectetuer adipiscing elit.
	</div>

	<table style="border: solid blue 2px; margin-top: 1em;">
		<tr>
			<td>
				Here's some text below the title panes (to make sure that closing a title pane releases the space that the content was taking up)
			</td>
		</tr>
	</table>

</body>
</html>