Also apply the __toString fix to UserInfo
[cacert-mgr.git] / external / ZendFramework-1.9.5 / externals / dojo / demos / nihao / demo.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
3 <html>
4 <head>
5
6 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
7 <title>Dojo Globalization Hello World</title>
8
9 <link rel="stylesheet" href="demo.css">
10
11 <script type="text/javascript">
12 // set the global locale for Dojo from the request parameter
13 var result = location.href.match(/[\?\&]locale=([^\&]+)/);
14 djConfig = { locale: result && result[1] || "en-us" }; // default locale is en-us
15 </script>
16 <script type="text/javascript" src="../../dojo/dojo.js" charset="utf-8"></script>
17
18 <script type="text/javascript">
19 dojo.require("dojo.date.locale");
20 dojo.require("dojo.number");
21 dojo.require("dojo.string");
22 dojo.require("dojo.parser");
23 dojo.require("dijit.form.DateTextBox");
24
25 // load the resource bundle for HelloWorld
26 dojo.requireLocalization("demos.nihao", "helloworld");
27
28 var resourceBundle;
29
30 dojo.addOnLoad(function(){
31 // create the DateTextBox from the HTML segment with the dojoType set
32 dojo.parser.parse();
33
34 // make current locale selected
35 dojo.byId('langList').value = dojo.locale;
36
37 // get the resource bundle object of the current global locale
38 resourceBundle = dojo.i18n.getLocalization("demos.nihao", "helloworld");
39
40 // do formatting and update the resource strings
41 dojo.byId('locale').innerHTML = resourceBundle.localeSelect;
42 dojo.byId('content').innerHTML = dojo.string.substitute(
43 resourceBundle.contentStr,
44 [dojo.date.locale.format(new Date(), {selector:'date', formatLength:'long'})]);
45 dojo.byId('date').innerHTML = resourceBundle.dateSelect;
46
47 dateChanged();
48 });
49
50 function localeChanged(){
51 open("demo.html?locale=" + dojo.byId("langList").value, "_self");
52 }
53
54 function dateChanged(){
55 if(resourceBundle){
56 var stamp = dijit.byId("dateBox").getValue();
57 if(stamp){
58 dojo.byId('secondsToGo').innerHTML = dojo.string.substitute(
59 resourceBundle.dateStr,
60 [dojo.number.format((stamp - new Date()) / 1000)]);
61 }
62 }
63 }
64 </script>
65 </head>
66
67 <body class="tundra">
68 <h1>Dojo Globalization Hello World</h1>
69 <p>
70 <span id="locale"></span>
71 <select id="langList" onchange="localeChanged();" >
72 <option value="en-us">en-US</option>
73 <option value="fr-fr">fr-FR</option>
74 <option value="zh-cn">zh-CN</option>
75 </select>
76 </p>
77 <hr>
78 <p id="content"></p>
79 <p>
80 <span id="date"></span>
81 <input id="dateBox" type="text" dojoType="dijit.form.DateTextBox" constraints="{formatLength:'long'}" onchange="dateChanged();">
82 </p>
83 <p id="secondsToGo"></p>
84 </body>
85 </html>