]> git.pond.sub.org Git - eow/blob - static/dojo-release-1.1.1/dojo/tests/_base/_loader/scope/scopeSingle.html
add Dojo 1.1.1
[eow] / static / dojo-release-1.1.1 / dojo / tests / _base / _loader / scope / scopeSingle.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                 <title>Using scope names inside dojo.require/dojoType</title>
6
7                 <link rel="stylesheet" type="text/css" href="../../../../resources/dojo.css" />
8                 <link rel="stylesheet" type="text/css" href="../../../../../dijit/css/dijitTests.css" />
9                 <link rel="stylesheet" type="text/css" href="../../../../../dijit/themes/tundra/tundra.css" />
10                 
11                 <script type="text/javascript">
12                         //djConfig for 0.4.3 setup.
13                         djConfig = {
14                                 isDebug: true,
15                                 parseOnLoad: true,
16                                 baseUrl: "../../../../",
17                                 scopeMap: [
18                                         ["dojo", "jodo"],
19                                         ["dijit", "jidit"],
20                                         ["dojox", "jodox"]                                      
21                                 ]
22                         };
23                 </script>
24
25                 <script type="text/javascript" src="../../../../dojo.js"></script>
26                 <script type="text/javascript">
27
28                         //Notice that dijit._Calendar is required, not jidit._Calendar.
29                         //Same for the dojo resources (not jodo resources).
30                         jodo.require("dijit._Calendar");
31                         jodo.require("dojo.date.locale");
32                         jodo.require("dojo.parser"); // scan page for widgets
33
34                         jodo.addOnLoad(function(){
35                                 jodo.byId("output10").innerHTML = jodo.version.toString();
36                         });
37
38                         function myHandler(id,newValue){
39                                 console.debug("onChange for id = " + id + ", value: " + newValue);
40                         }
41                         function foobar(){
42                                 jodo.byId("typeOut").innerHTML = "typeof dojo: " + (typeof dojo) +  "<br>typeof dijit: " + (typeof dijit) + "<br>typeof dojox: " + (typeof dojox);
43                         }
44                         setTimeout(foobar, 2000);
45                 </script>
46         </head>
47         <body>
48                 <h1>Using scope names inside dojo.require/dojoType</h1>
49         
50                 <p><b>NOTE: This test only works with a built version of Dojo.</b></p>
51
52                 <p>Jodo version: <span id="output10"></span></p>
53
54                 <p><b>typeof dojo, dijit and dojox should be undefined</b>: <br><span id="typeOut"></span></p>
55
56                 <p class="tundra">
57                         <input id="calendar1" jodoType="jidit._Calendar" onChange="myHandler(this.id,arguments[0])">
58                 </p>
59                 
60         </body>
61 </html>
62