| 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 |
data-dojo-config="isDebug: true, extraLocale: ['zh-cn','fr-fr']"></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 for Number</h1> |
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
<p> |
| 66 |
Before start this test, make sure the <b>dojo/cldr/nls</b> contains the data for "zh-cn", "fr-fr". If not, convert these CLDR data and put them there. |
| 67 |
</p> |
| 68 |
|
| 69 |
<script> |
| 70 |
(function(){ |
| 71 |
|
| 72 |
genFormatTestCases("Number Format", "dijit.form.NumberTextBox", [ |
| 73 |
|
| 74 |
{ attrs: {lang: "zh-cn"}, |
| 75 |
desc: "Locale: zh_CN", |
| 76 |
value: "12345.067", |
| 77 |
expValue: "12,345.067", |
| 78 |
comment: "" |
| 79 |
}, |
| 80 |
{ attrs: {lang: "zh-cn"}, |
| 81 |
desc: "Locale: zh_CN", |
| 82 |
value: "-12345.067", |
| 83 |
expValue: "-12,345.067", |
| 84 |
comment: "" |
| 85 |
}, |
| 86 |
|
| 87 |
{ attrs: {lang: "fr-fr"}, |
| 88 |
desc: "Locale: fr_FR", |
| 89 |
value: "12345.067", |
| 90 |
expValue: "12 345,067", |
| 91 |
comment: "" |
| 92 |
}, |
| 93 |
{ attrs: {lang: "fr-fr"}, |
| 94 |
desc: "Locale: zh_CN", |
| 95 |
value: "-12345.067", |
| 96 |
expValue: "-12 345,067", |
| 97 |
comment: "" |
| 98 |
} |
| 99 |
]); |
| 100 |
|
| 101 |
genValidateTestCases("Number Validate", "dijit.form.NumberTextBox", [ |
| 102 |
|
| 103 |
{ attrs: {lang: "zh-cn"}, |
| 104 |
desc: "Locale: zh_CN", |
| 105 |
value: 12345.067, |
| 106 |
expValue: "12,345.067", |
| 107 |
comment: "" |
| 108 |
}, |
| 109 |
{ attrs: {lang: "zh-cn"}, |
| 110 |
desc: "Locale: zh_CN", |
| 111 |
value: -12345.067, |
| 112 |
expValue: "-12,345.067", |
| 113 |
comment: "" |
| 114 |
}, |
| 115 |
|
| 116 |
{ attrs: {lang: "fr-fr"}, |
| 117 |
desc: "Locale: fr_FR", |
| 118 |
value: 12345.067, |
| 119 |
expValue: "12 345,067", |
| 120 |
comment: "" |
| 121 |
}, |
| 122 |
{ attrs: {lang: "fr-fr"}, |
| 123 |
desc: "Locale: zh_CN", |
| 124 |
value: -12345.067, |
| 125 |
expValue: "-12 345,067", |
| 126 |
comment: "" |
| 127 |
} |
| 128 |
]); |
| 129 |
|
| 130 |
})(); |
| 131 |
|
| 132 |
</script> |
| 133 |
</body> |
| 134 |
</html> |
| 135 |
|
| 136 |
|