| 1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
| 2 |
"http://www.w3.org/TR/html4/strict.dtd"> |
| 3 |
<html> |
| 4 |
<head> |
| 5 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 6 |
<title>Test TextBox</title> |
| 7 |
|
| 8 |
<script type="text/javascript" src="../../../dojo/dojo.js" |
| 9 |
data-dojo-config="isDebug: true"></script> |
| 10 |
<script type="text/javascript"> |
| 11 |
dojo.require("dijit.dijit"); // optimize: load dijit layer |
| 12 |
dojo.require("dijit.form.NumberTextBox"); |
| 13 |
dojo.require("dijit.form.CurrencyTextBox"); |
| 14 |
dojo.require("dijit.form.DateTextBox"); |
| 15 |
dojo.require("dijit.form.ValidationTextBox"); |
| 16 |
dojo.require("dojo.date.locale"); |
| 17 |
dojo.require("dojo.date.stamp"); |
| 18 |
dojo.require("dojo.parser"); // scan page for widgets and instantiate them |
| 19 |
dojo.require("doh.runner"); |
| 20 |
</script> |
| 21 |
<script src="test_i18n.js"></script> |
| 22 |
<script type="text/javascript"> |
| 23 |
dojo.ready(function(){ |
| 24 |
doh.register("parse", function(){ |
| 25 |
dojo.parser.parse(); |
| 26 |
}); |
| 27 |
doh.register("t", getAllTestCases()); |
| 28 |
doh.run(); |
| 29 |
}); |
| 30 |
</script> |
| 31 |
|
| 32 |
<style type="text/css"> |
| 33 |
@import "../../themes/claro/document.css"; |
| 34 |
@import "../../themes/claro/claro.css"; |
| 35 |
@import "../css/dijitTests.css"; |
| 36 |
|
| 37 |
.title { |
| 38 |
background-color:#ddd; |
| 39 |
} |
| 40 |
|
| 41 |
.hint { |
| 42 |
background-color:#eee; |
| 43 |
} |
| 44 |
|
| 45 |
.testExample { |
| 46 |
background-color:#fbfbfb; |
| 47 |
padding:1em; |
| 48 |
margin-bottom:1em; |
| 49 |
border:1px solid #bfbfbf; |
| 50 |
} |
| 51 |
|
| 52 |
.dojoTitlePaneLabel label { |
| 53 |
font-weight:bold; |
| 54 |
} |
| 55 |
|
| 56 |
td {white-space:nowrap} |
| 57 |
</style> |
| 58 |
</head> |
| 59 |
|
| 60 |
<body class="claro"> |
| 61 |
<h1 class="testTitle">Dijit TextBox Globalization Test</h1> |
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
<script> |
| 67 |
(function(){ |
| 68 |
genFormatTestCases("Natural Language Casing Mapping", "dijit.form.TextBox", [ |
| 69 |
|
| 70 |
{ attrs: {uppercase: "true"}, |
| 71 |
desc: "Upper casing: Basic Latin", |
| 72 |
value: "abcdefghijklmnopqrstuvwxyz", |
| 73 |
expValue: "ABCDEFGHIJKLMNOPQRSTUVWXYZ", |
| 74 |
comment: "" |
| 75 |
}, |
| 76 |
|
| 77 |
{ attrs: {uppercase: "true"}, |
| 78 |
desc: "Upper casing: Latin with accents", |
| 79 |
value: "àáâãäåæçèéêëìíîïðñòóôõö", |
| 80 |
expValue: "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ", |
| 81 |
comment: "" |
| 82 |
}, |
| 83 |
|
| 84 |
{ attrs: {uppercase: "true"}, |
| 85 |
desc: "Upper casing: Turkish", |
| 86 |
value: "ıi", |
| 87 |
expValue: "Iİ", |
| 88 |
comment: "<a href='#cmt_1'>See #1.</a>" |
| 89 |
}, |
| 90 |
|
| 91 |
{ attrs: {uppercase: "true"}, |
| 92 |
desc: "Upper casing: Russian", |
| 93 |
value: "абвгдежз", |
| 94 |
expValue: "АБВГДЕЖЗ", |
| 95 |
comment: "" |
| 96 |
}, |
| 97 |
|
| 98 |
{ attrs: {uppercase: "true"}, |
| 99 |
desc: "Upper casing: German", |
| 100 |
value: "ß", |
| 101 |
expValue: "SS", |
| 102 |
comment: "<a href='#cmt_1'>See #1.</a>" |
| 103 |
}, |
| 104 |
|
| 105 |
{ attrs: {lowercase: "true"}, |
| 106 |
desc: "Lower casing: Turkish", |
| 107 |
value: "Iİ", |
| 108 |
expValue: "ıi", |
| 109 |
comment: "<a href='#cmt_1'>See #1.</a>" |
| 110 |
}, |
| 111 |
|
| 112 |
{ attrs: {propercase: "true"}, |
| 113 |
desc: "Title/Proper casing: Latin", |
| 114 |
value: "\u01F1abc", |
| 115 |
expValue: "\u01F2abc", |
| 116 |
comment: "<a href='#cmt_1'>See #1.</a>" |
| 117 |
} |
| 118 |
]); |
| 119 |
|
| 120 |
genFormatTestCases("White-space Detecting", "dijit.form.TextBox", [ |
| 121 |
|
| 122 |
{ attrs: {trim: "true"}, |
| 123 |
desc: "Normal space & tab", |
| 124 |
value: " abc\t\t\t", |
| 125 |
expValue: "abc", |
| 126 |
comment: "" |
| 127 |
}, |
| 128 |
|
| 129 |
{ attrs: {trim: "true"}, |
| 130 |
desc: "NO-BREAK SPACE", |
| 131 |
value: "\u00A0abc\u00A0", |
| 132 |
expValue: "abc", |
| 133 |
comment: "Failed in IE. <a href='#cmt_2'>See #2.</a>" |
| 134 |
}, |
| 135 |
|
| 136 |
{ attrs: {trim: "true"}, |
| 137 |
desc: "EN QUAD", |
| 138 |
value: "\u2000abc\u2000", |
| 139 |
expValue: "abc", |
| 140 |
comment: "Failed in IE. <a href='#cmt_2'>See #2.</a>" |
| 141 |
}, |
| 142 |
|
| 143 |
{ attrs: {trim: "true"}, |
| 144 |
desc: "IDEOGRAPHIC SPACE", |
| 145 |
value: "\u3000abc\u3000", |
| 146 |
expValue: "abc", |
| 147 |
comment: "Failed in IE. <a href='#cmt_2'>See #2.</a>" |
| 148 |
} |
| 149 |
|
| 150 |
|
| 151 |
]); |
| 152 |
|
| 153 |
})(); |
| 154 |
</script> |
| 155 |
|
| 156 |
<h2 class="testTitle">Issues & Comments </h2> |
| 157 |
<a name="cmt_1"><h3 class="testTitle">Issue #1 <sup style="color:red">Not fixed. Avoid using this function of TextBox.</sup></h3></a> |
| 158 |
<p> |
| 159 |
Strictly speaking, all casing manipulation must use ICU case mapping rules (routine). However, the default JavaScript routines used by Dojo |
| 160 |
do not support ICU case mapping rules in all browsers. |
| 161 |
</p> |
| 162 |
|
| 163 |
<a name="cmt_2"><h3 class="testTitle">Issue #2 <sup style="color:red">Not fixed. Avoid using this function of TextBox.</sup></h3></a> |
| 164 |
<p> |
| 165 |
Trimming must get rid of all Unicode characters with the white space property. However, the default JavaScript routines used by Dojo |
| 166 |
do not support get character properties in some browsers like IE. Other browsers like Firefox might support trimming more white space |
| 167 |
characters. |
| 168 |
</p> |
| 169 |
|
| 170 |
</body> |
| 171 |
</html> |
| 172 |
|
| 173 |
|