2150 |
mathias |
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
2 |
|
|
|
3 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
|
|
|
4 |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
|
5 |
<head>
|
|
|
6 |
<title>dijit.place tests</title>
|
|
|
7 |
<script type="text/javascript" src="../../../dojo/dojo.js"
|
|
|
8 |
djConfig="isDebug: true, extraLocale: ['de-de', 'en-us']"></script>
|
|
|
9 |
<script type="text/javascript">
|
|
|
10 |
dojo.require("dijit.dijit");
|
|
|
11 |
</script>
|
|
|
12 |
<script>
|
|
|
13 |
dojo.addOnLoad(function(){
|
|
|
14 |
var vp = dijit.getViewport();
|
|
|
15 |
alert("viewport w="+vp.w + ", h=" + vp.h);
|
|
|
16 |
});
|
|
|
17 |
</script>
|
|
|
18 |
<style type="text/css">
|
|
|
19 |
@import "../../../dojo/resources/dojo.css";
|
|
|
20 |
@import "../../themes/tundra/tundra.css";
|
|
|
21 |
@import "../css/dijitTests.css";
|
|
|
22 |
|
|
|
23 |
body {
|
|
|
24 |
padding: 1em;
|
|
|
25 |
}
|
|
|
26 |
.formQuestion {
|
|
|
27 |
background-color:#d0e3f5;
|
|
|
28 |
padding:0.3em;
|
|
|
29 |
font-weight:900;
|
|
|
30 |
font-family:Verdana, Arial, sans-serif;
|
|
|
31 |
font-size:0.8em;
|
|
|
32 |
color:#5a5a5a;
|
|
|
33 |
}
|
|
|
34 |
.formAnswer {
|
|
|
35 |
background-color:#f5eede;
|
|
|
36 |
padding:0.3em;
|
|
|
37 |
margin-bottom:1em;
|
|
|
38 |
}
|
|
|
39 |
.pageSubContentTitle {
|
|
|
40 |
color:#8e8e8e;
|
|
|
41 |
font-size:1em;
|
|
|
42 |
font-family:Verdana, Arial, sans-serif;
|
|
|
43 |
margin-bottom:0.75em;
|
|
|
44 |
}
|
|
|
45 |
.small {
|
|
|
46 |
width: 2.5em;
|
|
|
47 |
}
|
|
|
48 |
.medium {
|
|
|
49 |
width: 10em;
|
|
|
50 |
}
|
|
|
51 |
.long {
|
|
|
52 |
width: 20em;
|
|
|
53 |
}
|
|
|
54 |
|
|
|
55 |
.dojoValidationTextBoxMessage {
|
|
|
56 |
display: inline;
|
|
|
57 |
margin-left: 1em;
|
|
|
58 |
font-weight: bold;
|
|
|
59 |
font-style: italic;
|
|
|
60 |
font-family: Arial, Verdana, sans-serif;
|
|
|
61 |
color: #f66;
|
|
|
62 |
font-size: 0.9em;
|
|
|
63 |
}
|
|
|
64 |
|
|
|
65 |
.noticeMessage {
|
|
|
66 |
font-weight: normal;
|
|
|
67 |
font-family:Arial, Verdana, sans-serif;
|
|
|
68 |
color:#663;
|
|
|
69 |
font-size:0.9em;
|
|
|
70 |
}
|
|
|
71 |
</style>
|
|
|
72 |
</head>
|
|
|
73 |
|
|
|
74 |
<body class=tundra>
|
|
|
75 |
<h2 class="pageSubContentTitle">Test dijit.place</h2>
|
|
|
76 |
<p>Currently this just tests getViewport(). Change the size of your browser window and then reload,
|
|
|
77 |
and see if it reports the browser window size correctly.<br>
|
|
|
78 |
<p>All the text below is just filler text...<br>
|
|
|
79 |
<!-- to test form submission, you'll need to create an action handler similar to
|
|
|
80 |
http://www.utexas.edu/teamweb/cgi-bin/generic.cgi -->
|
|
|
81 |
<form id="form1" action="" name="example" method="post">
|
|
|
82 |
|
|
|
83 |
<div class="formQuestion">
|
|
|
84 |
<span class="emphasize"><label for="q01">First Name: </label></span>
|
|
|
85 |
<span class="noticeMessage"> TextBox class, <b>tabIndex=2</b>, Attributes: {trim: true, ucFirst: true, class: 'medium'}, First letter of each word is upper case.</span>
|
|
|
86 |
</div>
|
|
|
87 |
<div class="formAnswer">
|
|
|
88 |
<input id="q01" type="text" name="firstname" value="testing testing" class="medium" tabIndex=2
|
|
|
89 |
dojoType="dijit.form.TextBox"
|
|
|
90 |
trim="true"
|
|
|
91 |
ucfirst="true" />
|
|
|
92 |
</div>
|
|
|
93 |
|
|
|
94 |
<div class="formQuestion">
|
|
|
95 |
<span class="emphasize"><label for="q02">Last Name: </label></span>
|
|
|
96 |
<span class="noticeMessage"> TextBox class, Attributes: {trim: true, uppercase: true, class: 'medium'}, all letters converted to upper case. </span>
|
|
|
97 |
</div>
|
|
|
98 |
<div class="formAnswer">
|
|
|
99 |
<input id="q02" type="text" name="lastname" value="testing testing" class="medium"
|
|
|
100 |
dojoType="dijit.form.TextBox"
|
|
|
101 |
trim="true"
|
|
|
102 |
uppercase="true" />
|
|
|
103 |
</div>
|
|
|
104 |
|
|
|
105 |
<div class="formQuestion">
|
|
|
106 |
<span class="emphasize"><label for="q03">Age: </label></span>
|
|
|
107 |
<span class="noticeMessage"> TextBox class, <b>tabIndex=1</b>, Attributes: {trim: true, digit: true, class: 'small'}, all but digits extracted.</span>
|
|
|
108 |
</div>
|
|
|
109 |
<div class="formAnswer">
|
|
|
110 |
<input id="q03" type="text" name="age" value="38" class="small" tabIndex=1
|
|
|
111 |
dojoType="dijit.form.NumberTextBox"
|
|
|
112 |
promptMessage="(optional) Enter an age between 0 and 120"
|
|
|
113 |
constraints={places:0,min:0,max:120}
|
|
|
114 |
onChange="console.debug('onChange fired for widget id = ' + this.id + ' with value = ' + arguments[0]);"
|
|
|
115 |
digit="true"
|
|
|
116 |
trim="true"
|
|
|
117 |
/>
|
|
|
118 |
</div>
|
|
|
119 |
|
|
|
120 |
<div class="formQuestion">
|
|
|
121 |
<span class="emphasize"><label for="q04">Occupation: </label></span>
|
|
|
122 |
<span class="noticeMessage">ValidationTextBox class,
|
|
|
123 |
Attributes: {lowercase: true, required: true}. Displays a prompt message if field is missing. </span>
|
|
|
124 |
</div>
|
|
|
125 |
<div class="formAnswer">
|
|
|
126 |
<input id="q04" type="text" name="occupation" class="medium"
|
|
|
127 |
dojoType="dijit.form.ValidationTextBox"
|
|
|
128 |
lowercase="true"
|
|
|
129 |
required="true"
|
|
|
130 |
promptMessage="Enter an occupation" />
|
|
|
131 |
</div>
|
|
|
132 |
|
|
|
133 |
<div class="formQuestion">
|
|
|
134 |
<span class="emphasize"><label for="q05">Elevation: </label></span>
|
|
|
135 |
<span class="noticeMessage">IntegerTextBox class,
|
|
|
136 |
Attributes: {required: true, min:-20000, max:+20000 }, Enter feet above sea level with a sign.</span>
|
|
|
137 |
</div>
|
|
|
138 |
<div class="formAnswer">
|
|
|
139 |
<input id="q05" class="medium"/>
|
|
|
140 |
</div>
|
|
|
141 |
|
|
|
142 |
<div class="formQuestion">
|
|
|
143 |
<span class="emphasize"><label for="q08">Annual Income: </label></span>
|
|
|
144 |
<span class="noticeMessage">CurrencyTextBox class,
|
|
|
145 |
Attributes: {fractional: true}. Enter whole and cents. Currency symbol is optional.</span>
|
|
|
146 |
</div>
|
|
|
147 |
<div class="formAnswer">
|
|
|
148 |
<input id="q08" type="text" name="income1" class="medium" value="54775.53"
|
|
|
149 |
dojoType="dijit.form.CurrencyTextBox"
|
|
|
150 |
required="true"
|
|
|
151 |
currency="USD"
|
|
|
152 |
invalidMessage="Invalid amount. Include dollar sign, commas, and cents. Example: $12,000.00" />USD
|
|
|
153 |
</div>
|
|
|
154 |
|
|
|
155 |
<div class="formAnswer">
|
|
|
156 |
<input id="q08eur" type="text" name="income2" class="medium" value="54775.53"
|
|
|
157 |
dojoType="dijit.form.CurrencyTextBox"
|
|
|
158 |
required="true"
|
|
|
159 |
currency="EUR"
|
|
|
160 |
invalidMessage="Invalid amount. Include euro sign, commas, and cents. Example: €12,000.00" />EUR
|
|
|
161 |
</div>
|
|
|
162 |
<!--
|
|
|
163 |
<div class="formQuestion">
|
|
|
164 |
<span class="emphasize"><label for="q08a">Annual Income: </label></span>
|
|
|
165 |
<span class="noticeMessage">Old regexp currency textbox,
|
|
|
166 |
Attributes: {fractional: true}. Enter dollars and cents.</span>
|
|
|
167 |
</div>
|
|
|
168 |
<div class="formAnswer">
|
|
|
169 |
<input id="q08a" type="text" name="income3" class="medium" value="$54,775.53"
|
|
|
170 |
dojoType="dijit.form.ValidationTextBox"
|
|
|
171 |
regExpGen="dojo.regexp.currency"
|
|
|
172 |
trim="true"
|
|
|
173 |
required="true"
|
|
|
174 |
constraints={fractional:true}
|
|
|
175 |
invalidMessage="Invalid amount. Include dollar sign, commas, and cents. Example: $12,000.00" />
|
|
|
176 |
</div>
|
|
|
177 |
|
|
|
178 |
<div class="formQuestion">
|
|
|
179 |
<span class="emphasize"><label for="q09">IPv4 Address: </label></span>
|
|
|
180 |
<span class="noticeMessage">IpAddressTextBox class,
|
|
|
181 |
Attributes: {allowIPv6: false, allowHybrid: false}. Also Dotted Hex works, 0x18.0x11.0x9b.0x28</span>
|
|
|
182 |
</div>
|
|
|
183 |
<div class="formAnswer">
|
|
|
184 |
<input id="q09" type="text" name="ipv4" class="medium" value="24.17.155.40"
|
|
|
185 |
dojoType="dijit.form.ValidationTextBox"
|
|
|
186 |
regExpGen="dojo.regexp.ipAddress"
|
|
|
187 |
trim="true"
|
|
|
188 |
required="true"
|
|
|
189 |
constraints={allowIPv6:false,allowHybrid:false}
|
|
|
190 |
invalidMessage="Invalid IPv4 address." />
|
|
|
191 |
</div>
|
|
|
192 |
|
|
|
193 |
<div class="formQuestion">
|
|
|
194 |
<span class="emphasize"><label for="q10"> IPv6 Address: </label></span>
|
|
|
195 |
<span class="noticeMessage">IpAddressTextBox class,
|
|
|
196 |
Attributes: {allowDottedDecimal: false, allowDottedHex: false}.
|
|
|
197 |
Also hybrid works, x:x:x:x:x:x:d.d.d.d</span>
|
|
|
198 |
</div>
|
|
|
199 |
<div class="formAnswer">
|
|
|
200 |
<input id="q10" type="text" name="ipv6" class="long" value="0000:0000:0000:0000:0000:0000:0000:0000"
|
|
|
201 |
dojoType="dijit.form.ValidationTextBox"
|
|
|
202 |
regExpGen="dojo.regexp.ipAddress"
|
|
|
203 |
trim="true"
|
|
|
204 |
uppercase = "true"
|
|
|
205 |
required="true"
|
|
|
206 |
constraints={allowDottedDecimal:false, allowDottedHex:false, allowDottedOctal:false}
|
|
|
207 |
invalidMessage="Invalid IPv6 address, please enter eight groups of four hexadecimal digits. x:x:x:x:x:x:x:x" />
|
|
|
208 |
</div>
|
|
|
209 |
|
|
|
210 |
<div class="formQuestion">
|
|
|
211 |
<span class="emphasize"><label for="q11"> URL: </label></span>
|
|
|
212 |
<span class="noticeMessage">UrlTextBox class,
|
|
|
213 |
Attributes: {required: true, trim: true, scheme: true}. </span>
|
|
|
214 |
</div>
|
|
|
215 |
<div class="formAnswer">
|
|
|
216 |
<input id="q11" type="text" name="url" class="long" value="http://www.xyz.com/a/b/c?x=2#p3"
|
|
|
217 |
dojoType="dijit.form.ValidationTextBox"
|
|
|
218 |
regExpGen="dojo.regexp.url"
|
|
|
219 |
trim="true"
|
|
|
220 |
required="true"
|
|
|
221 |
constraints={scheme:true}
|
|
|
222 |
invalidMessage="Invalid URL. Be sure to include the scheme, http://..." />
|
|
|
223 |
</div>
|
|
|
224 |
|
|
|
225 |
<div class="formQuestion">
|
|
|
226 |
<span class="emphasize"><label for="q12"> Email Address </label></span>
|
|
|
227 |
<span class="noticeMessage">EmailTextBox class,
|
|
|
228 |
Attributes: {required: true, trim: true}. </span>
|
|
|
229 |
</div>
|
|
|
230 |
<div class="formAnswer">
|
|
|
231 |
<input id="q12" type="text" name="email" class="long" value="fred&barney@stonehenge.com"
|
|
|
232 |
dojoType="dijit.form.ValidationTextBox"
|
|
|
233 |
regExpGen="dojo.regexp.emailAddress"
|
|
|
234 |
trim="true"
|
|
|
235 |
required="true"
|
|
|
236 |
invalidMessage="Invalid Email Address." />
|
|
|
237 |
</div>
|
|
|
238 |
|
|
|
239 |
<div class="formQuestion">
|
|
|
240 |
<span class="emphasize"><label for="q13"> Email Address List </label></span>
|
|
|
241 |
<span class="noticeMessage">EmailListTextBox class,
|
|
|
242 |
Attributes: {required: true, trim: true}. </span>
|
|
|
243 |
</div>
|
|
|
244 |
<div class="formAnswer">
|
|
|
245 |
<input id="q13" type="text" name="email" class="long" value="a@xyz.com; b@xyz.com; c@xyz.com; "
|
|
|
246 |
dojoType="dijit.form.ValidationTextBox"
|
|
|
247 |
regExpGen="dojo.regexp.emailAddressList"
|
|
|
248 |
trim="true"
|
|
|
249 |
required="true"
|
|
|
250 |
invalidMessage="Invalid Email Address List." />
|
|
|
251 |
</div>
|
|
|
252 |
-->
|
|
|
253 |
|
|
|
254 |
<div class="formQuestion">
|
|
|
255 |
<span class="emphasize"><label for="q14"> Date (American format) </label></span>
|
|
|
256 |
<span class="noticeMessage">DateTextBox class,
|
|
|
257 |
Attributes: {locale: "en-us", required: true}. Works for leap years</span>
|
|
|
258 |
</div>
|
|
|
259 |
<div class="formAnswer">
|
|
|
260 |
<input id="q14" type="text" name="date1" class="medium" value="2005-12-30"
|
|
|
261 |
dojoType="dijit.form.DateTextBox"
|
|
|
262 |
constraints={locale:'en-us'}
|
|
|
263 |
required="true"
|
|
|
264 |
promptMessage="mm/dd/yyyy"
|
|
|
265 |
invalidMessage="Invalid date. Use mm/dd/yyyy format." />
|
|
|
266 |
</div>
|
|
|
267 |
|
|
|
268 |
<div class="formQuestion">
|
|
|
269 |
<span class="emphasize"><label for="q15"> Date (German format) </label></span>
|
|
|
270 |
<span class="noticeMessage">DateTextBox class,
|
|
|
271 |
Attributes: {locale: "de-de", min:2006-01-01, max:2006-12-31}. Works for leap years</span>
|
|
|
272 |
</div>
|
|
|
273 |
<div class="formAnswer">
|
|
|
274 |
<input id="q15" class="medium"/>
|
|
|
275 |
</div>
|
|
|
276 |
|
|
|
277 |
<div class="formQuestion">
|
|
|
278 |
<span class="emphasize"><label for="q16"> 12 Hour Time </label></span>
|
|
|
279 |
<span class="noticeMessage">TimeTextBox class,
|
|
|
280 |
Attributes: {formatLength: "medium", required: true, trim: true}</span>
|
|
|
281 |
</div>
|
|
|
282 |
<div class="formAnswer">
|
|
|
283 |
<input id="q16" type="text" name="time1" class="medium" value="5:45:00 pm"
|
|
|
284 |
dojoType="dijit.form.ValidationTextBox"
|
|
|
285 |
validator="dojo.date.local.parse"
|
|
|
286 |
constraints={formatLength:'medium',selector:'time'}
|
|
|
287 |
trim="true"
|
|
|
288 |
required="true"
|
|
|
289 |
invalidMessage="Invalid time." />
|
|
|
290 |
</div>
|
|
|
291 |
|
|
|
292 |
<div class="formQuestion">
|
|
|
293 |
<span class="emphasize"><label for="q17"> 24 Hour Time</label></span>
|
|
|
294 |
<span class="noticeMessage">TimeTextBox class,
|
|
|
295 |
Attributes: {displayFormat:"HH:mm:ss", required: true, trim: true}</span>
|
|
|
296 |
</div>
|
|
|
297 |
<div class="formAnswer">
|
|
|
298 |
<input id="q17" type="text" name="time2" class="medium" value="17:45:00"
|
|
|
299 |
dojoType="dijit.form.ValidationTextBox"
|
|
|
300 |
validator="dojo.date.local.parse"
|
|
|
301 |
constraints={formatLength:'short',selector:'time',timePattern:'HH:mm:ss'}
|
|
|
302 |
trim="true"
|
|
|
303 |
required="true"
|
|
|
304 |
invalidMessage="Invalid time. Use HH:mm:ss where HH is 00 - 23 hours." />
|
|
|
305 |
</div>
|
|
|
306 |
|
|
|
307 |
<!--
|
|
|
308 |
<div class="formQuestion">
|
|
|
309 |
<span class="emphasize"><label for="q18"> US State 2 letter abbr. </label></span>
|
|
|
310 |
<span class="noticeMessage">UsStateTextBox class,
|
|
|
311 |
Attributes: {required: true, trim: true, uppercase: true}</span>
|
|
|
312 |
</div>
|
|
|
313 |
<div class="formAnswer">
|
|
|
314 |
<input id="q18" type="text" name="state" class="small" value="CA"
|
|
|
315 |
dojoType="dijit.form.ValidationTextBox"
|
|
|
316 |
regExpGen="dojo.regexp.us.state"
|
|
|
317 |
constraints={allowTerritories:false}
|
|
|
318 |
trim="true"
|
|
|
319 |
uppercase="true"
|
|
|
320 |
required="true"
|
|
|
321 |
invalidMessage="Invalid US state abbr." />
|
|
|
322 |
</div>
|
|
|
323 |
|
|
|
324 |
<div class="formQuestion">
|
|
|
325 |
<span class="emphasize"><label for="q19"> US Zip Code </label></span>
|
|
|
326 |
<span class="noticeMessage">UsZipTextBox class,
|
|
|
327 |
Attributes: {required: true, trim: true} Five digit Zip code or 5 + 4.</span>
|
|
|
328 |
</div>
|
|
|
329 |
<div class="formAnswer">
|
|
|
330 |
<input id="q19" type="text" name="zip" class="medium" value="98225-1649"
|
|
|
331 |
dojoType="dijit.form.ValidationTextBox"
|
|
|
332 |
validator="dojo.validate.us.isZipCode"
|
|
|
333 |
trim="true"
|
|
|
334 |
required="true"
|
|
|
335 |
invalidMessage="Invalid US Zip Code." />
|
|
|
336 |
</div>
|
|
|
337 |
|
|
|
338 |
<div class="formQuestion">
|
|
|
339 |
<span class="emphasize"><label for="q20"> US Social Security Number </label></span>
|
|
|
340 |
<span class="noticeMessage">UsSocialSecurityNumberTextBox class,
|
|
|
341 |
Attributes: {required: true, trim: true} </span>
|
|
|
342 |
</div>
|
|
|
343 |
<div class="formAnswer">
|
|
|
344 |
<input id="q20" type="text" name="ssn" class="medium" value="123-45-6789"
|
|
|
345 |
dojoType="dijit.form.ValidationTextBox"
|
|
|
346 |
validator="dojo.validate.us.isSocialSecurityNumber"
|
|
|
347 |
trim="true"
|
|
|
348 |
required="true"
|
|
|
349 |
invalidMessage="Invalid US Social Security Number." />
|
|
|
350 |
</div>
|
|
|
351 |
|
|
|
352 |
<div class="formQuestion">
|
|
|
353 |
<span class="emphasize"><label for="q21"> 10-digit US Phone Number </label></span>
|
|
|
354 |
<span class="noticeMessage">UsPhoneNumberTextBox class,
|
|
|
355 |
Attributes: {required: true, trim: true} </span>
|
|
|
356 |
</div>
|
|
|
357 |
<div class="formAnswer">
|
|
|
358 |
<input id="q21" type="text" name="phone" class="medium" value="(123) 456-7890"
|
|
|
359 |
dojoType="dijit.form.ValidationTextBox"
|
|
|
360 |
validator="dojo.validate.us.isPhoneNumber"
|
|
|
361 |
trim="true"
|
|
|
362 |
required="true"
|
|
|
363 |
invalidMessage="Invalid US Phone Number." />
|
|
|
364 |
</div>
|
|
|
365 |
-->
|
|
|
366 |
<div class="formQuestion">
|
|
|
367 |
<span class="emphasize"><label for="q22"> Regular Expression </label></span>
|
|
|
368 |
<span class="noticeMessage">RegexpTextBox class,
|
|
|
369 |
Attributes: {required: true} </span>
|
|
|
370 |
</div>
|
|
|
371 |
<div class="formAnswer">
|
|
|
372 |
<input id="q22" type="text" name="phone" class="medium" value="someTestString"
|
|
|
373 |
dojoType="dijit.form.ValidationTextBox"
|
|
|
374 |
regExp="[\w]+"
|
|
|
375 |
required="true"
|
|
|
376 |
invalidMessage="Invalid Non-Space Text." />
|
|
|
377 |
</div>
|
|
|
378 |
|
|
|
379 |
<div class="formQuestion">
|
|
|
380 |
<span class="emphasize"><label for="q23"> Password </label></span>
|
|
|
381 |
<span class="noticeMessage">(just a test that type attribute is obeyed) </span>
|
|
|
382 |
</div>
|
|
|
383 |
<div class="formAnswer">
|
|
|
384 |
<input id="q23" type="password" name="password" class="medium"
|
|
|
385 |
dojoType="dijit.form.TextBox" />
|
|
|
386 |
</div>
|
|
|
387 |
|
|
|
388 |
<div class="formQuestion">
|
|
|
389 |
<span class="emphasize"><label for="ticket1651">Trac ticket 1651: </label></span>
|
|
|
390 |
<span class="noticeMessage">value: null should show up as empty</span>
|
|
|
391 |
</div>
|
|
|
392 |
<div class="formAnswer">
|
|
|
393 |
<input id="ticket1651" class="medium" value="not null"/>
|
|
|
394 |
</div>
|
|
|
395 |
|
|
|
396 |
<button name="button" onclick="displayData(); return false;">view data</button>
|
|
|
397 |
<input type="submit" name="submit" />
|
|
|
398 |
</form>
|
|
|
399 |
</body>
|
|
|
400 |
</html>
|