Debian Codegraph @

dijit/tests/_BidiSupport/form/noTextDirTextWidgets.html

raw symbols SCIP
1 <!DOCTYPE html>
2
3 <html>
4 <head>
5 <meta http-equiv="Content-type" content="text/html; charset=utf-8">
6 <title>DOH input fields witout textDir support Tests</title>
7
8 <style type="text/css">
9 @import "../../../../dijit/themes/tundra/tundra.css";
10 @import "../../../../dojo/resources/dojo.css";
11 </style>
12
13 <!-- required: dojo.js -->
14 <script type="text/javascript" src="../../../../dojo/dojo.js"
15 data-dojo-config="async: true, isDebug: true, has: { 'dojo-bidi': true }"></script>
16
17 <script type="text/javascript">
18 require([
19 "doh/runner",
20 "dojo/dom",
21 "dojo/parser",
22 "dijit/registry",
23 "dojo/domReady!"
24 ], function(doh, dom, parser, registry){
25
26 doh.register("parse", {
27 name: "parse",
28 timeout: 10000,
29 runTest: function() {
30 // Parse is asynchronous because it pulls in modules like DateTextBox, so return its promise
31 return parser.parse();
32 }
33 });
34
35 doh.register("initial direction of the textBoxes", [
36 {
37 name: "Group 1",
38
39 runTest: function(){
40
41 var textBox1 = registry.byId("local_1"),
42 textBox2 = registry.byId("local_12"),
43 textBox3 = registry.byId("local_2"),
44 textBox4 = registry.byId("local_22");
45
46 doh.is("rtl", textBox1.textDir, "textDir of - " + textBox1.id);
47 doh.is("", textBox1.dir, "dir of - " + textBox1.id);
48 doh.t(textBox1.focusNode.dir === textBox1.textDir, "textDir != dir of - " + textBox1.id);
49
50 doh.is("ltr", textBox2.textDir, "textDir of - " + textBox2.id);
51 doh.is("", textBox2.dir, "dir of - " + textBox2.id);
52 doh.t(textBox2.focusNode.dir === textBox2.textDir, "textDir != dir of - " + textBox2.id);
53
54 doh.is("rtl", textBox3.textDir, "textDir of - " + textBox3.id);
55 doh.is("rtl", textBox3.dir, "dir of - " + textBox3.id);
56 doh.t(textBox3.focusNode.dir === textBox3.textDir, "textDir != dir of - " + textBox3.id);
57
58 doh.is("ltr", textBox4.textDir, "textDir of - " + textBox4.id);
59 doh.is("rtl", textBox4.dir, "dir of - " + textBox4.id);
60 doh.t(textBox4.focusNode.dir === textBox4.textDir, "textDir != dir of - " + textBox4.id);
61 }
62 },
63 {
64 name: "Group 2",
65
66 runTest: function(){
67
68 var textBox1 = registry.byId("localLong_1"),
69 textBox2 = registry.byId("localLong_12"),
70 textBox3 = registry.byId("localLong_2"),
71 textBox4 = registry.byId("localLong_22");
72
73 doh.is("rtl", textBox1.textDir, "textDir of - " + textBox1.id);
74 doh.is("ltr", textBox1.dir, "dir of - " + textBox1.id);
75 doh.t(textBox1.focusNode.dir === textBox1.textDir, "textDir != dir of - " + textBox1.id);
76
77 doh.is("ltr", textBox2.textDir, "textDir of - " + textBox2.id);
78 doh.is("", textBox2.dir, "dir of - " + textBox2.id);
79 doh.t(textBox2.focusNode.dir === textBox2.textDir, "textDir != dir of - " + textBox2.id);
80
81 doh.is("rtl", textBox3.textDir, "textDir of - " + textBox3.id);
82 doh.is("rtl", textBox3.dir, "dir of - " + textBox3.id);
83 doh.t(textBox3.focusNode.dir === textBox3.textDir, "textDir != dir of - " + textBox3.id);
84
85 doh.is("ltr", textBox4.textDir, "textDir of - " + textBox4.id);
86 doh.is("rtl", textBox4.dir, "dir of - " + textBox4.id);
87 doh.t(textBox4.focusNode.dir === textBox4.textDir, "textDir != dir of - " + textBox4.id);
88 }
89 },
90 {
91 name: "Group 3",
92
93 runTest: function(){
94
95 var textBox1 = registry.byId("integerspinner_1"),
96 textBox2 = registry.byId("integerspinner_12"),
97 textBox3 = registry.byId("integerspinner_2"),
98 textBox4 = registry.byId("integerspinner_22");
99
100 doh.is("rtl", textBox1.textDir, "textDir of - " + textBox1.id);
101 doh.is("", textBox1.dir, "dir of - " + textBox1.id);
102 doh.t(textBox1.focusNode.dir === textBox1.textDir, "textDir != dir of - " + textBox1.id);
103
104 doh.is("ltr", textBox2.textDir, "textDir of - " + textBox2.id);
105 doh.is("", textBox2.dir, "dir of - " + textBox2.id);
106 doh.t(textBox2.focusNode.dir === textBox2.textDir, "textDir != dir of - " + textBox2.id);
107
108 doh.is("rtl", textBox3.textDir, "textDir of - " + textBox3.id);
109 doh.is("rtl", textBox3.dir, "dir of - " + textBox3.id);
110 doh.t(textBox3.focusNode.dir === textBox3.textDir, "textDir != dir of - " + textBox3.id);
111
112 doh.is("ltr", textBox4.textDir, "textDir of - " + textBox4.id);
113 doh.is("rtl", textBox4.dir, "dir of - " + textBox4.id);
114 doh.t(textBox4.focusNode.dir === textBox4.textDir, "textDir != dir of - " + textBox4.id);
115 }
116 },
117 {
118 name: "Group 4",
119
120 runTest: function(){
121
122 var textBox1 = registry.byId("curren_1"),
123 textBox2 = registry.byId("curren_12"),
124 textBox3 = registry.byId("curren_2"),
125 textBox4 = registry.byId("curren_22");
126
127 doh.is("rtl", textBox1.textDir, "textDir of - " + textBox1.id);
128 doh.is("", textBox1.dir, "dir of - " + textBox1.id);
129 doh.t(textBox1.focusNode.dir === textBox1.textDir, "textDir != dir of - " + textBox1.id);
130
131 doh.is("ltr", textBox2.textDir, "textDir of - " + textBox2.id);
132 doh.is("", textBox2.dir, "dir of - " + textBox2.id);
133 doh.t(textBox2.focusNode.dir === textBox2.textDir, "textDir != dir of - " + textBox2.id);
134
135 doh.is("rtl", textBox3.textDir, "textDir of - " + textBox3.id);
136 doh.is("rtl", textBox3.dir, "dir of - " + textBox3.id);
137 doh.t(textBox3.focusNode.dir === textBox3.textDir, "textDir != dir of - " + textBox3.id);
138
139 doh.is("ltr", textBox4.textDir, "textDir of - " + textBox4.id);
140 doh.is("rtl", textBox4.dir, "dir of - " + textBox4.id);
141 doh.t(textBox4.focusNode.dir === textBox4.textDir, "textDir != dir of - " + textBox4.id);
142 }
143 },
144 {
145 name: "Group 5",
146
147 runTest: function(){
148
149 var textBox1 = registry.byId("q1"),
150 textBox2 = registry.byId("q2"),
151 textBox3 = registry.byId("q3"),
152 textBox4 = registry.byId("q4");
153
154 doh.is("rtl", textBox1.textDir, "textDir of - " + textBox1.id);
155 doh.is("ltr", textBox1.dir, "dir of - " + textBox1.id);
156 doh.t(textBox1.focusNode.dir === textBox1.textDir, "textDir != dir of - " + textBox1.id);
157
158 doh.is("ltr", textBox2.textDir, "textDir of - " + textBox2.id);
159 doh.is("ltr", textBox2.dir, "dir of - " + textBox2.id);
160 doh.t(textBox2.focusNode.dir === textBox2.textDir, "textDir != dir of - " + textBox2.id);
161
162 doh.is("rtl", textBox3.textDir, "textDir of - " + textBox3.id);
163 doh.is("rtl", textBox3.dir, "dir of - " + textBox3.id);
164 doh.t(textBox3.focusNode.dir === textBox3.textDir, "textDir != dir of - " + textBox3.id);
165
166 doh.is("ltr", textBox4.textDir, "textDir of - " + textBox4.id);
167 doh.is("rtl", textBox4.dir, "dir of - " + textBox4.id);
168 doh.t(textBox4.focusNode.dir === textBox4.textDir, "textDir != dir of - " + textBox4.id);
169 }
170 }
171 ]);
172
173 doh.run();
174 });
175 </script>
176 </head>
177
178 <body class="tundra">
179 <h1 class="testTitle">Test DateTextBox Widget with _BidiSupport</h1>
180 <div class="dojoTitlePaneLabel">
181 <label for="local_1">Group 1: Date (local format) </label>
182 </div>
183 <div class="testExample">
184 <table>
185 <tr>
186 <th>
187 <label for="local_1"><b>dir = </b>ltr, <b>textDir = </b>rtl</label><br>
188 <input id="local_1" data-dojo-type="dijit/form/DateTextBox"
189 data-dojo-props='name: "noDOMvalue", value: "2008-12-31", type: "text", textDir: "rtl"'/>
190 </th>
191 <th>
192 <label for="local_12"><b>dir = </b>ltr, <b>textDir = </b>ltr</label><br>
193 <input id="local_12" data-dojo-type="dijit/form/DateTextBox"
194 data-dojo-props='name: "noDOMvalue12", value: "2008-12-31", type: "text", textDir: "ltr"'/>
195 </th>
196 </tr>
197 <tr>
198 <th>
199 <label for="local_2"><b>dir = </b>rtl, <b>textDir = </b>rtl</label><br>
200 <input id="local_2" data-dojo-type="dijit/form/DateTextBox"
201 data-dojo-props='name: "noDOMvalue2", value: "2008-12-31", type: "text", dir: "rtl", textDir: "rtl"'/>
202 </th>
203 <th>
204 <label for="local_22"><b>dir = </b>rtl, <b>textDir = </b>ltr</label><br>
205 <input id="local_22" data-dojo-type="dijit/form/DateTextBox"
206 data-dojo-props='name: "noDOMvalue22", value: "2008-12-31", type: "text", dir: "rtl", textDir: "ltr"'/>
207 </th>
208 </tr>
209 </table>
210 </div>
211 <div class="dojoTitlePaneLabel">
212 <label for="localLong_1">Group 2: Date (local format - long) </label>
213 </div>
214 <div class="testExample">
215 <table>
216 <tr>
217 <th>
218 <label for="localLong_1"><b>dir = </b>ltr, <b>textDir = </b>rtl</label><br>
219 <input id="localLong_1" data-dojo-id="localLong_1" data-dojo-type="dijit/form/DateTextBox"
220 data-dojo-props='type: "text", name: "date1", value: "2005-12-30",
221 constraints: {min: "2004-01-01", max: "2006-12-31", formatLength: "long"},
222 required: true,
223 trim: true,
224 dir: "ltr", textDir: "rtl",
225 invalidMessage: "Invalid date."'/>
226 </th>
227 <th>
228 <label for="localLong_12"><b>dir = </b>ltr, <b>textDir = </b>ltr</label><br>
229 <input id="localLong_12" data-dojo-id="localLong_12" data-dojo-type="dijit/form/DateTextBox"
230 data-dojo-props='type: "text", name: "date12", value: "2005-12-30",
231 constraints: {min: "2004-01-01", max: "2006-12-31", formatLength: "long"},
232 required: true,
233 trim: true,
234 invalidMessage: "Invalid date." ,
235 textDir: "ltr"'/>
236 </th>
237 </tr>
238 <tr>
239 <th>
240 <label for="localLong_2"><b>dir = </b>rtl, <b>textDir = </b>rtl</label><br>
241 <input id="localLong_2" data-dojo-id="localLong_2" data-dojo-type="dijit/form/DateTextBox"
242 data-dojo-props='type: "text", name: "date2", value: "2005-12-30",
243 constraints: {min: "2004-01-01",max: "2006-12-31",formatLength: "long"},
244 required: true,
245 trim: true,
246 invalidMessage: "Invalid date." ,
247 dir: "rtl",
248 textDir: "rtl" '/>
249 </th>
250 <th>
251 <label for="localLong_22"><b>dir = </b>rtl, <b>textDir = </b>ltr</label><br>
252 <input id="localLong_22" data-dojo-id="localLong_12" data-dojo-type="dijit/form/DateTextBox"
253 data-dojo-props='type: "text", name: "date12", value: "2005-12-30",
254 constraints: {min: "2004-01-01",max: "2006-12-31",formatLength: "long"},
255 required: true,
256 trim: true,
257 invalidMessage: "Invalid date." ,
258 dir: "rtl",
259 textDir: "ltr"'/>
260 </th>
261 </tr>
262 </table>
263 </div>
264
265 <br>
266 <h1 class="testTitle">Test NumberSpinner Widget with _BidiSupport</h1>
267 <div class="dojoTitlePaneLabel">
268 <label >Group 3 </label>
269 </div>
270
271 Try typing values, and use the up/down arrow keys and/or the arrow push buttons
272
273 <div class="testExample">
274 <table>
275 <tr>
276 <th>
277 <label for="integerspinner_1"><b>dir = </b>ltr, <b>textDir = </b>rtl </label><br>
278 <input id="integerspinner_1" data-dojo-type="dijit/form/NumberSpinner"
279 data-dojo-props='
280 value: 900,
281 "class": "bigFont",
282 constraints: {max: 1550,places: 0},
283 name: "integerspinner_1",
284 textDir: "rtl"'/>
285 </th>
286 <th>
287 <label for="integerspinner_12"><b>dir = </b>ltr, <b>textDir = </b>ltr </label><br>
288 <input id="integerspinner_12" data-dojo-type="dijit/form/NumberSpinner"
289 data-dojo-props='
290 value: 900,
291 "class": "bigFont",
292 constraints: {max: 1550,places: 0},
293 name: "integerspinner_12",
294 textDir: "ltr"'/>
295 </th>
296 </tr>
297 <tr>
298 <th>
299 <label for="integerspinner_2"><b>dir = </b>rtl, <b>textDir = </b>rtl </label><br>
300 <input id="integerspinner_2" data-dojo-type="dijit/form/NumberSpinner"
301 data-dojo-props='
302 value: 900,
303 "class": "bigFont",
304 constraints: {max: 1550,places: 0},
305 dir: "rtl",
306 textDir: "rtl",
307 name: "integerspinner_2"'/>
308 </th>
309 <th>
310 <label for="integerspinner_22"><b>dir = </b>rtl, <b>textDir = </b>ltr </label><br>
311 <input id="integerspinner_22" data-dojo-type="dijit/form/NumberSpinner"
312 data-dojo-props='
313 value: 900,
314 "class": "bigFont",
315 constraints: {max: 1550,places: 0},
316 dir: "rtl",
317 textDir: "ltr",
318 name: "integerspinner_22"'/>
319 </th>
320 </tr>
321 </table>
322 </div>
323
324 <br>
325 <br>
326
327 <h1 class="testTitle">Test CurrencyTextBox Widget with _BidiSupport</h1>
328 <div class="dojoTitlePaneLabel">
329 <label >Group 4</label>
330 </div>
331 <div class="testExample">
332 <table>
333 <tr>
334 <th>
335 <label for="curren_1"><b>dir = </b>ltr, <b>textDir = </b>rtl </label><br>
336 <input id="curren_1" data-dojo-type="dijit/form/CurrencyTextBox"
337 data-dojo-props='name: "curren_1", "class": "medium", value: 54775.53,
338 required: true,
339 constraints: {fractional: true},
340 currency: "USD",
341 textDir: "rtl",
342 invalidMessage: "Invalid amount. Cents are MANDATORY."'/>
343 </th>
344 <th>
345 <label for="curren_12"><b>dir = </b>ltr, <b>textDir = </b>ltr</label><br>
346 <input id="curren_12" data-dojo-type="dijit/form/CurrencyTextBox"
347 data-dojo-props='name: "curren_12", "class": "medium", value: 54775.53,
348 required: true,
349 constraints: {fractional: true},
350 currency: "USD",
351 invalidMessage: "Invalid amount. Cents are MANDATORY.",
352 textDir: "ltr"'/>
353 </th>
354 </tr>
355 <tr>
356 <th>
357 <label for="curren_2"><b>dir = </b>rtl, <b>textDir = </b>rtl </label><br>
358 <input id="curren_2" data-dojo-type="dijit/form/CurrencyTextBox"
359 data-dojo-props='name: "curren_2", "class": "medium", value: 54775.53,
360 required: true,
361 constraints: {fractional: true},
362 currency: "USD",
363 invalidMessage: "Invalid amount. Cents are MANDATORY.",
364 textDir: "rtl",
365 dir: "rtl"'/>
366 </th>
367 <th>
368 <label for="curren_22"><b>dir = </b>rtl, <b>textDir = </b>ltr </label><br>
369 <input id="curren_22" data-dojo-type="dijit/form/CurrencyTextBox"
370 data-dojo-props='name: "curren_22", "class": "medium", value: 54775.53,
371 required: true,
372 constraints: {fractional: true},
373 currency: "USD",
374 invalidMessage: "Invalid amount. Cents are MANDATORY.",
375 textDir: "ltr",
376 dir: "rtl"'/>
377 </th>
378 </tr>
379 </table>
380 </div>
381
382 <h1 class="testTitle">Test TimeTextBox Widget with _BidiSupport</h1>
383 <div class="dojoTitlePaneLabel">
384 <label >Group 5 </label>
385 </div>
386 <div class="testExample">
387 <table>
388 <tr>
389 <th>
390 <label for="q1"><b>dir = </b>ltr, <b>textDir = </b>rtl </label><br>
391 <input id="q1" data-dojo-type="dijit/form/TimeTextBox"
392 data-dojo-props='type: "text", name: "time1", value: "T17:45:00",
393 constraints: {formatLength: "medium"},
394 required: true,
395 invalidMessage: "Invalid time.",
396 textDir: "rtl",
397 dir: "ltr"'/>
398 </th>
399 <th>
400 <label for="q2"><b>dir = </b>ltr, <b>textDir = </b>ltr</label><br>
401 <input id="q2" data-dojo-type="dijit/form/TimeTextBox"
402 data-dojo-props='type: "text", name: "time2", value: "T17: 45: 00",
403 constraints: {formatLength: "medium"},
404 required: true,
405 invalidMessage: "Invalid time.",
406 textDir: "ltr",
407 dir: "ltr"'/>
408 </th>
409 </tr>
410 <tr>
411 <th>
412 <label for="q3"><b>dir = </b>rtl, <b>textDir = </b>rtl </label><br>
413 <input id="q3" data-dojo-type="dijit/form/TimeTextBox"
414 data-dojo-props='type: "text", name: "time3", value: "T17:45:00",
415 constraints: {formatLength: "medium"},
416 required: true,
417 invalidMessage: "Invalid time.",
418 textDir: "rtl",
419 dir: "rtl"'/>
420 </th>
421 <th>
422 <label for="q4"><b>dir = </b>rtl, <b>textDir = </b>ltr </label><br>
423 <input id="q4" data-dojo-type="dijit/form/TimeTextBox"
424 data-dojo-props='type: "text", name: "time4", value: "T17:45:00",
425 constraints: {formatLength: "medium"},
426 required: true,
427 invalidMessage: "Invalid time.",
428 textDir: "ltr",
429 dir: "rtl"'/>
430 </th>
431 </tr>
432 </table>
433 </div>
434 </body>
435 </html>