2150 |
mathias |
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 NumberTextBox</title>
|
|
|
7 |
|
|
|
8 |
<script type="text/javascript" src="../../../dojo/dojo.js"
|
|
|
9 |
djConfig="isDebug: true, extraLocale: ['zh-cn','fr-fr','ar-eg','hi-in']"></script>
|
|
|
10 |
<script type="text/javascript" src="../../../dojo/currency.js"></script>
|
|
|
11 |
<script type="text/javascript" src="../../../dojo/number.js"></script>
|
|
|
12 |
<script type="text/javascript">
|
|
|
13 |
dojo.require("dijit.form.NumberTextBox");
|
|
|
14 |
dojo.require("dijit.form.CurrencyTextBox");
|
|
|
15 |
dojo.require("dijit.form.DateTextBox");
|
|
|
16 |
dojo.require("dijit.form.ValidationTextBox");
|
|
|
17 |
dojo.require("dojo.date.locale");
|
|
|
18 |
dojo.require("dojo.date.stamp");
|
|
|
19 |
dojo.require("dojo.parser"); // scan page for widgets and instantiate them
|
|
|
20 |
dojo.require("doh.runner");
|
|
|
21 |
</script>
|
|
|
22 |
<script src="test_i18n.js"></script>
|
|
|
23 |
<script type="text/javascript">
|
|
|
24 |
dojo.addOnLoad(function(){
|
|
|
25 |
doh.register("t", getAllTestCases());
|
|
|
26 |
doh.run();
|
|
|
27 |
});
|
|
|
28 |
</script>
|
|
|
29 |
|
|
|
30 |
<style type="text/css">
|
|
|
31 |
@import "../../../dojo/resources/dojo.css";
|
|
|
32 |
@import "../../themes/tundra/tundra.css";
|
|
|
33 |
@import "../css/dijitTests.css";
|
|
|
34 |
|
|
|
35 |
.title {
|
|
|
36 |
background-color:#ddd;
|
|
|
37 |
}
|
|
|
38 |
|
|
|
39 |
.hint {
|
|
|
40 |
background-color:#eee;
|
|
|
41 |
}
|
|
|
42 |
|
|
|
43 |
.testExample {
|
|
|
44 |
background-color:#fbfbfb;
|
|
|
45 |
padding:1em;
|
|
|
46 |
margin-bottom:1em;
|
|
|
47 |
border:1px solid #bfbfbf;
|
|
|
48 |
}
|
|
|
49 |
|
|
|
50 |
.dojoTitlePaneLabel label {
|
|
|
51 |
font-weight:bold;
|
|
|
52 |
}
|
|
|
53 |
|
|
|
54 |
td {white-space:nowrap}
|
|
|
55 |
</style>
|
|
|
56 |
</head>
|
|
|
57 |
|
|
|
58 |
<body class="tundra">
|
|
|
59 |
<h1 class="testTitle">Dijit TextBox Globalization Test for Number</h1>
|
|
|
60 |
|
|
|
61 |
<!-- <h2 class="testTitle">Press the following button to start all test after this page is loaded.</h2>
|
|
|
62 |
<button id="startButton" onclick="startTest()">Start Test</button>-->
|
|
|
63 |
<p>
|
|
|
64 |
Before start this test, make sure the <b>dojo/cldr/nls</b> contains the data for "zh-cn", "fr-fr", "ar-eg" and "hi-in". If not, convert these CLDR data and put them there.
|
|
|
65 |
</p>
|
|
|
66 |
|
|
|
67 |
<script>
|
|
|
68 |
(function() {
|
|
|
69 |
|
|
|
70 |
genFormatTestCases("Number Format", "dijit.form.NumberTextBox", [
|
|
|
71 |
|
|
|
72 |
{ attrs: {lang: "zh-cn"},
|
|
|
73 |
desc: "Locale: zh_CN",
|
|
|
74 |
value: "12345.067",
|
|
|
75 |
expValue: "12,345.067",
|
|
|
76 |
comment: ""
|
|
|
77 |
},
|
|
|
78 |
{ attrs: {lang: "zh-cn"},
|
|
|
79 |
desc: "Locale: zh_CN",
|
|
|
80 |
value: "-12345.067",
|
|
|
81 |
expValue: "-12,345.067",
|
|
|
82 |
comment: ""
|
|
|
83 |
},
|
|
|
84 |
|
|
|
85 |
{ attrs: {lang: "fr-fr"},
|
|
|
86 |
desc: "Locale: fr_FR",
|
|
|
87 |
value: "12345.067",
|
|
|
88 |
expValue: "12 345,067",
|
|
|
89 |
comment: "Failed in IE. The currency textbox should not reject the value generated by itself. <a href='currency.html#cmt_1'>See #1 (currency.html).</a>"
|
|
|
90 |
},
|
|
|
91 |
{ attrs: {lang: "fr-fr"},
|
|
|
92 |
desc: "Locale: zh_CN",
|
|
|
93 |
value: "-12345.067",
|
|
|
94 |
expValue: "-12 345,067",
|
|
|
95 |
comment: "Failed in IE. The currency textbox should not reject the value generated by itself. <a href='currency.html#cmt_1'>See #1 (currency.html).</a>"
|
|
|
96 |
},
|
|
|
97 |
|
|
|
98 |
{ attrs: {lang: "ar-eg"},
|
|
|
99 |
desc: "Locale: ar_EG",
|
|
|
100 |
value: "12345.067",
|
|
|
101 |
expValue: "12٬345٫067",
|
|
|
102 |
comment: ""
|
|
|
103 |
},
|
|
|
104 |
{ attrs: {lang: "ar-eg"},
|
|
|
105 |
desc: "Locale: ar_EG",
|
|
|
106 |
value: "-12345.067",
|
|
|
107 |
expValue: "12٬345٫067-",
|
|
|
108 |
comment: ""
|
|
|
109 |
},
|
|
|
110 |
|
|
|
111 |
{ attrs: {lang: "ar-eg", constraints: "{localeDigit: true}"},
|
|
|
112 |
desc: "Locale: ar_EG",
|
|
|
113 |
value: "12345.067",
|
|
|
114 |
expValue: "١٢\u066C٣٤٥\u066B٠٦٧",
|
|
|
115 |
comment: "<a href='currency.html#cmt_2'>See #2 (currency.html).</a>"
|
|
|
116 |
},
|
|
|
117 |
{ attrs: {lang: "ar-eg", constraints: "{localeDigit: true}"},
|
|
|
118 |
desc: "Locale: ar_EG",
|
|
|
119 |
value: "-12345.067",
|
|
|
120 |
expValue: "١٢\u066C٣٤٥\u066B٠٦٧-",
|
|
|
121 |
comment: "<a href='currency.html#cmt_2'>See #2 (currency.html).</a>"
|
|
|
122 |
},
|
|
|
123 |
|
|
|
124 |
{ attrs: {lang: "hi-in", constraints: "{localeDigit: true}"},
|
|
|
125 |
desc: "Locale: hi_IN",
|
|
|
126 |
value: "123456789.068",
|
|
|
127 |
expValue: "१२,३४,५६,७८९.०६८",
|
|
|
128 |
comment: "<a href='currency.html#cmt_2'>See #2 (currency.html).</a>"
|
|
|
129 |
},
|
|
|
130 |
{ attrs: {lang: "hi-in", constraints: "{localeDigit: true}"},
|
|
|
131 |
desc: "Locale: hi_IN",
|
|
|
132 |
value: "-123456789.068",
|
|
|
133 |
expValue: "-१२,३४,५६,७८९.०६८",
|
|
|
134 |
comment: "<a href='currency.html#cmt_2'>See #2 (currency.html).</a>"
|
|
|
135 |
}
|
|
|
136 |
]);
|
|
|
137 |
|
|
|
138 |
genValidateTestCases("Number Validate", "dijit.form.NumberTextBox", [
|
|
|
139 |
|
|
|
140 |
{ attrs: {lang: "zh-cn"},
|
|
|
141 |
desc: "Locale: zh_CN",
|
|
|
142 |
value: 12345.067,
|
|
|
143 |
expValue: "12,345.067",
|
|
|
144 |
comment: ""
|
|
|
145 |
},
|
|
|
146 |
{ attrs: {lang: "zh-cn"},
|
|
|
147 |
desc: "Locale: zh_CN",
|
|
|
148 |
value: -12345.067,
|
|
|
149 |
expValue: "-12,345.067",
|
|
|
150 |
comment: ""
|
|
|
151 |
},
|
|
|
152 |
|
|
|
153 |
{ attrs: {lang: "fr-fr"},
|
|
|
154 |
desc: "Locale: fr_FR",
|
|
|
155 |
value: 12345.067,
|
|
|
156 |
expValue: "12 345,067",
|
|
|
157 |
comment: "Failed in IE. <a href='currency.html#cmt_1'>See #1 (currency.html).</a>"
|
|
|
158 |
},
|
|
|
159 |
{ attrs: {lang: "fr-fr"},
|
|
|
160 |
desc: "Locale: zh_CN",
|
|
|
161 |
value: -12345.067,
|
|
|
162 |
expValue: "-12 345,067",
|
|
|
163 |
comment: "Failed in IE. <a href='currency.html#cmt_1'>See #1 (currency.html).</a>"
|
|
|
164 |
},
|
|
|
165 |
|
|
|
166 |
{ attrs: {lang: "ar-eg"},
|
|
|
167 |
desc: "Locale: ar_EG",
|
|
|
168 |
value: 12345.067,
|
|
|
169 |
expValue: "12٬345٫067",
|
|
|
170 |
comment: ""
|
|
|
171 |
},
|
|
|
172 |
{ attrs: {lang: "ar-eg"},
|
|
|
173 |
desc: "Locale: ar_EG",
|
|
|
174 |
value: -12345.067,
|
|
|
175 |
expValue: "12٬345٫067-",
|
|
|
176 |
comment: ""
|
|
|
177 |
},
|
|
|
178 |
|
|
|
179 |
{ attrs: {lang: "ar-eg", constraints: "{localeDigit: true}"},
|
|
|
180 |
desc: "Locale: ar_EG",
|
|
|
181 |
value: 12345.067,
|
|
|
182 |
expValue: "١٢\u066C٣٤٥\u066B٠٦٧",
|
|
|
183 |
comment: "<a href='currency.html#cmt_2'>See #2 (currency.html).</a>"
|
|
|
184 |
},
|
|
|
185 |
{ attrs: {lang: "ar-eg", constraints: "{localeDigit: true}"},
|
|
|
186 |
desc: "Locale: ar_EG",
|
|
|
187 |
value: -12345.067,
|
|
|
188 |
expValue: "١٢\u066C٣٤٥\u066B٠٦٧-",
|
|
|
189 |
comment: "<a href='currency.html#cmt_2'>See #2 (currency.html).</a>"
|
|
|
190 |
},
|
|
|
191 |
|
|
|
192 |
{ attrs: {lang: "hi-in", constraints: "{localeDigit: true}"},
|
|
|
193 |
desc: "Locale: hi_IN",
|
|
|
194 |
value: 123456789.068,
|
|
|
195 |
expValue: "१२,३४,५६,७८९.०६८",
|
|
|
196 |
comment: "<a href='currency.html#cmt_2'>See #2 (currency.html).</a>"
|
|
|
197 |
},
|
|
|
198 |
{ attrs: {lang: "hi-in", constraints: "{localeDigit: true}"},
|
|
|
199 |
desc: "Locale: hi_IN",
|
|
|
200 |
value: -123456789.068,
|
|
|
201 |
expValue: "-१२,३४,५६,७८९.०६८",
|
|
|
202 |
comment: "<a href='currency.html#cmt_2'>See #2 (currency.html).</a>"
|
|
|
203 |
}
|
|
|
204 |
]);
|
|
|
205 |
|
|
|
206 |
dojo.parser.parse();
|
|
|
207 |
|
|
|
208 |
})();
|
|
|
209 |
|
|
|
210 |
</script>
|
|
|
211 |
</body>
|
|
|
212 |
</html>
|
|
|
213 |
|
|
|
214 |
|