aboutsummaryrefslogtreecommitdiff
path: root/includes/js/dijit/tests/i18n/number.html
blob: 0a1b717adc3599e29c34a2dba3f3a9a83ada4c88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
	"http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>Test NumberTextBox</title>

		<script type="text/javascript" src="../../../dojo/dojo.js"
			djConfig="isDebug: true, extraLocale: ['zh-cn','fr-fr']"></script>
		<script type="text/javascript" src="../../../dojo/currency.js"></script>
		<script type="text/javascript" src="../../../dojo/number.js"></script>
		<script type="text/javascript">
			dojo.require("dijit.form.NumberTextBox");
			dojo.require("dijit.form.CurrencyTextBox");
			dojo.require("dijit.form.DateTextBox");
			dojo.require("dijit.form.ValidationTextBox");
			dojo.require("dojo.date.locale");
			dojo.require("dojo.date.stamp");
			dojo.require("dojo.parser");	// scan page for widgets and instantiate them
			dojo.require("doh.runner");
		</script>
		<script src="test_i18n.js"></script>
		<script type="text/javascript">
			dojo.addOnLoad(function(){
				doh.register("t", getAllTestCases());
				doh.run();
			});
		</script>

		<style type="text/css">
			@import "../../../dojo/resources/dojo.css";
			@import "../../themes/tundra/tundra.css";
			@import "../css/dijitTests.css";

			.title {
				background-color:#ddd;
			}

			.hint {
				background-color:#eee;
			}

			.testExample {
				background-color:#fbfbfb;
				padding:1em;
				margin-bottom:1em;
				border:1px solid #bfbfbf;
			}

			.dojoTitlePaneLabel label {
				font-weight:bold;
			}

			td {white-space:nowrap}
		</style>
	</head>

	<body class="tundra">
		<h1 class="testTitle">Dijit TextBox Globalization Test for Number</h1>

<!--		<h2 class="testTitle">Press the following button to start all test after this page is loaded.</h2>
		<button id="startButton" onclick="startTest()">Start Test</button>-->
		<p>
			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.
		</p>

		<script>
		(function() {

			genFormatTestCases("Number Format", "dijit.form.NumberTextBox", [

				{ attrs: {lang: "zh-cn"},
				  desc: "Locale: zh_CN",
				  value: "12345.067",
				  expValue: "12,345.067",
				  comment: ""
				},
				{ attrs: {lang: "zh-cn"},
				  desc: "Locale: zh_CN",
				  value: "-12345.067",
				  expValue: "-12,345.067",
				  comment: ""
				},

				{ attrs: {lang: "fr-fr"},
				  desc: "Locale: fr_FR",
				  value: "12345.067",
				  expValue: "12&nbsp;345,067",
				  comment: ""
				},
				{ attrs: {lang: "fr-fr"},
				  desc: "Locale: zh_CN",
				  value: "-12345.067",
				  expValue: "-12&nbsp;345,067",
				  comment: ""
				}
			]);

			genValidateTestCases("Number Validate", "dijit.form.NumberTextBox", [

				{ attrs: {lang: "zh-cn"},
				  desc: "Locale: zh_CN",
				  value: 12345.067,
				  expValue: "12,345.067",
				  comment: ""
				},
				{ attrs: {lang: "zh-cn"},
				  desc: "Locale: zh_CN",
				  value: -12345.067,
				  expValue: "-12,345.067",
				  comment: ""
				},

				{ attrs: {lang: "fr-fr"},
				  desc: "Locale: fr_FR",
				  value: 12345.067,
				  expValue: "12&nbsp;345,067",
				  comment: ""
				},
				{ attrs: {lang: "fr-fr"},
				  desc: "Locale: zh_CN",
				  value: -12345.067,
				  expValue: "-12&nbsp;345,067",
				  comment: ""
				}
			]);

			dojo.parser.parse();

		})();

		</script>
	</body>
</html>