Ticket #4573: scope04.html

File scope04.html, 2.3 kB (added by jburke, 9 months ago)

Test file showing Dojo 0.4.3 and Dojo "1.0" loading in the same page, with widget parsing.

Line 
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>Multiversion Dojo: 0.4.3 and 1.0</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                        };
16                </script>
17                <script type="text/javascript" src="http://o.aolcdn.com/dojo/0.4.3/dojo.js"></script>
18               
19                <script type="text/javascript">
20                        //Need scope map defined in a script block. It will not work as part of the
21                        //djConfig attribute on the script that loads Dojo.
22                        //Also, just adding properties instead of redefining djConfig, since that
23                        //will wipe out djConfig values set up by the 0.4.3 dojo.
24                        djConfig.parseOnLoad = true;
25                        djConfig.baseUrl = "../../../";
26                        djConfig.scopeMap = [
27                                ["dojo", "dojo10"],
28                                ["dijit", "dijit10"],
29                                ["dojox", "dojox10"]                                   
30                        ];
31                </script>
32                <script type="text/javascript" src="../../../dojo.js"></script>
33                <script type="text/javascript">
34                        dojo.require("dojo.widget.DropdownDatePicker");
35                        dojo10.require("dijit._Calendar");
36                        dojo10.require("dojo.date.locale");
37                        dojo10.require("dojo.parser"); // scan page for widgets
38
39                        dojo.addOnLoad(function(){
40                                dojo.byId("output043").innerHTML = dojo.version.toString();
41                        });
42                        dojo10.addOnLoad(function(){
43                                dojo.byId("output10").innerHTML = dojo10.version.toString();
44                        });
45
46                        function myHandler(id,newValue){
47                                console.debug("onChange for id = " + id + ", value: " + newValue);
48                        }
49                </script>
50        </head>
51        <body>
52                <h1>Multiversion Dojo: 0.4.3 and 1.0</h1>
53       
54                <p><b>NOTE: This test only works with a built version of Dojo</b></p>
55
56                <p>This page loads Dojo 0.4.3 and Dojo 1.0.</p>
57               
58                <p>Dojo 0.4.3 version: <span id="output043"></span></p>
59               
60                <p>Dojo 1.0 version: <span id="output10"></span></p>
61               
62                <p>
63                        <input dojoType="dropdowndatepicker" value="2006-10-31" containerToggle="wipe" containerToggleDuration="300" >
64                </p>
65               
66                <p class="tundra">
67                        <input id="calendar1" dojo10Type="dijit._Calendar" onChange="myHandler(this.id,arguments[0])">
68                </p>
69               
70        </body>
71</html>