Also apply the __toString fix to UserInfo
[cacert-mgr.git] / external / ZendFramework-1.9.5 / externals / dojo / demos / i18n / 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 <title>Dijit I18N Demo</title>
7
8 <link rel="stylesheet" href="demo.css">
9
10 <script>
11 var djConfig = {
12 parseOnLoad: false,
13 isDebug: true
14 };
15 var locale, lang, bidi;
16
17 // read in HREF arguments
18 if(window.location.href.indexOf("?") > -1){
19 var str = window.location.href.substr(window.location.href.indexOf("?")+1);
20 var ary = str.split(/&/);
21 for(var i=0; i<ary.length; i++){
22 var split = ary[i].split(/=/),
23 key = split[0],
24 value = split[1];
25 switch(key){
26 case "locale":
27 djConfig.locale = locale = value;
28 lang = locale.replace(/-.*/, "");
29 break;
30 case "dir":
31 document.getElementsByTagName("html")[0].dir = value;
32 bidi = value;
33 break;
34 }
35 }
36 }
37 </script>
38 <script type="text/javascript" src="../../dojo/dojo.js" charset="utf-8"></script>
39 <script type="text/javascript">
40 dojo.require("demos.i18n.src");
41 var model;
42 dojo.addOnLoad(function(){
43 model = new i18nTreeModel({ lang: lang });
44
45 dojo.parser.parse();
46 dojo.byId("locale").innerHTML = locale || "default";
47 dojo.byId("dir").innerHTML = bidi || "default";
48 dojo.fadeOut({
49 node:"preLoader",
50 onEnd: function(){
51 dojo.style("preLoader", "display", "none");
52 },
53 delay:100,
54 duration:400
55 }).play();
56 });
57 </script>
58
59 </head>
60 <body class="tundra">
61 <div id="preLoader"><p></p></div>
62 <div id="main" style="width: 100%; height: 100%" dojoType="dijit.layout.BorderContainer">
63 <div dojoType="dijit.layout.ContentPane" region="top">
64 <h1 class="testTitle" dir="ltr">
65 Dijit I18N Demo (locale=<span id="locale"></span> dir=<span id="dir"></span>)
66 </h1>
67 <p dir="ltr">
68 Use the tree to select a language or a language/country combo; the page will reload
69 in the specified locale. Note that tree is also rerendered using the specified language for top level tree items.
70 Arabic and Hebrew display right-to-left so be sure to try those.
71 </p>
72 <p dir="ltr">
73 This won't work perfectly unless you've done a full build of dojo.cldr,
74 see <a href="../../util/buildscripts/cldr/README">the CLDR readme</a>.
75 </p>
76 <p dir="ltr">
77 Country data courtesy of <a href="http://ws.geonames.org/">Geonames</a>.
78 </p>
79 </div>
80
81 <div dojoType="dijit.layout.ContentPane" region="leading" style="width: 30%" splitter="true">
82 <div dojoType="dijit.Tree" id="mytree" model="model" openOnClick="true">
83 <!-- override functions for display of each node -->
84 <script type="dojo/method" event="getIconClass" args="item">
85 var icon =
86 item.countryName ?
87 ("countryIcon country" + item.countryCode + "Icon") :
88 dijit.Tree.prototype.getIconClass.apply(this, arguments);
89 return icon;
90 </script>
91 <script type="dojo/method" event="getLabel" args="item">
92 if(item.root){ return "Continents"; }
93 return item.name || item.countryName || item; // language items are just strings... change?
94 </script>
95
96 <!-- clicking a node refreshes the page with new locale setting -->
97 <script type="dojo/method" event="onClick" args="item, node">
98 if(item.type=="locale") { // language
99 var locale = item.iso, lang = locale.replace(/-.*/, ""),
100 dir = (/ar|fa|he|ps|ur|yi/i).test(lang) ? "rtl" : "ltr";
101 window.location.href = window.location.href.replace(/\?.*/, "") + "?locale=" + locale + "&dir=" + dir;
102 }
103 </script>
104 </div>
105 </div>
106
107 <div dojoType="dijit.layout.ContentPane" region="center">
108 <table>
109 <tr>
110 <td width="20%">
111 <label for="calendar" dir="ltr">Calendar (stand alone):</label>
112 </td>
113 <td width="50%">
114 <input dojoType="dijit._Calendar"/>
115 </td>
116 </tr>
117 <tr>
118 <td>
119 <label for="palette" dir="ltr">Color palette:</label>
120 </td>
121 <td>
122 <span dojoType="dijit.ColorPalette"></span>
123 </td>
124 </tr>
125 <tr>
126 <td>
127 <label for="date" dir="ltr">Date textbox:</label>
128 </td>
129 <td>
130 <input id="date" dojoType="dijit.form.DateTextBox" value="2006-07-04"/>
131 </td>
132 </tr>
133 <tr>
134 <td>
135 <label for="spinner" dir="ltr">Number spinner:</label>
136 </td>
137 <td>
138 <input id="spinner" dojoType="dijit.form.NumberSpinner" value="123456789"/>
139 </td>
140 </tr>
141 <tr>
142 <td>
143 <label for="currency" dir="ltr">Currency textbox:</label>
144 </td>
145 <td>
146 <input id="currency" type="text" name="income1" value="54775.53"
147 dojoType="dijit.form.CurrencyTextBox"
148 required="true"
149 constraints="{fractional:true}"
150 currency="USD"/>
151 </td>
152 </tr>
153 <tr>
154 <td>
155 <label for="combo1" dir="ltr">ComboBox:</label>
156 </td>
157 <td>
158 <select id="combo1" dojoType="dijit.form.ComboBox">
159 <option>option #1</option>
160 <option>option #2</option>
161 <option>option #3</option>
162 </select>
163 </td>
164 </tr>
165 <!--
166 <tr>
167 <td><label for="combo2" dir="ltr">Combo on languages and countries:</label></td>
168 <td>
169 <input id="combo2" dojoType="dijit.form.ComboBox"
170 value=""
171 store="store"
172 searchAttr="name"
173 name="anything"/>
174 </td>
175 </tr>
176 -->
177 </table>
178 </div>
179 </div>
180 </body>
181 </html>